<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>X6 Edge Animation</title>
<style>
#container {
width: 800px;
height: 600px;
border: 1px solid #000;
background:black;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="https://unpkg.com/@antv/x6@1"></script>
<script >
document.addEventListener('DOMContentLoaded', function() {
const { Graph } = X6;
const graph = new Graph({
container: document.getElementById('container'),
width: 800,
height: 600,
grid: true,
});
// 添加节点
const source = graph.addNode({
shape: 'circle',
x: 40,
y: 40,
width: 60,
height: 60,
attrs: {
body: {
fill: '#2ECC71',
stroke: '#000',