x6.js bug记录-流程图json数据导入进来之后拖拽节点,节点直接飞走了

添加josn数据进来之后虽然能正常渲染,但是只要一拖拽,则节点就直接飞走了,看不到了。

找了一下午的问题,最后发现。保存的json坐标位置是字符串类型,而这边的位置必须是数字类型。如下:

复制代码
 {
    position: { x: "180", y: "140" },
    size: { width: "60", height: "60" },
    attrs: {
      text: { text: "addData" },
      body: { fill: "#1A9DFF", stroke: "#000" },
      label: { text: "addData", fill: "#333", fontSize: 13 },
    },
    visible: "true",
    shape: "rect",
    id: "ee11d4b2-5e09-45dc-bb24-bb8cc791e11b"
  }

最后将字符串类型改为数字类型就好了

复制代码
  {
    position: { x: 180, y: 140},
    size: { width: 60, height: 60 },
    attrs: {
      text: { text: "addData" },
      body: { fill: "#1A9DFF", stroke: "#000" },
      label: { text: "addData", fill: "#333", fontSize: 13 },
    },
    visible: "true",
    shape: "rect",
    id: "ee11d4b2-5e09-45dc-bb24-bb8cc791e11b"
  }

蛮坑的虽然解决办法简单,但找到该问题却耗费了一下午时间。

相关推荐
hui函数20 小时前
Python系列Bug修复|如何解决 pip install 安装报错 invalid command ‘bdist_wheel’(缺少 wheel)问题
python·bug·pip
hui函数20 小时前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有索引未设为 trusted-host 导致拒绝 问题
python·bug·pip
hui函数21 小时前
Python系列Bug修复|如何解决 pip install 安装报错 Backend ‘setuptools.build_meta’ 不可用 问题
python·bug·pip
hui函数1 天前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有仓库认证失败 401 Unauthorized 问题
python·bug·pip
hui函数1 天前
Python系列Bug修复|如何解决 pip install -r requirements.txt 子目录可编辑安装缺少 pyproject.toml 问题
python·bug·pip
min1811234562 天前
PC端零基础跨职能流程图制作教程
大数据·人工智能·信息可视化·架构·流程图
静听松涛1332 天前
中文PC端多人协作泳道图制作平台
大数据·论文阅读·人工智能·搜索引擎·架构·流程图·软件工程
数说星榆1812 天前
在线高清泳道图制作工具 无水印 PC
大数据·人工智能·架构·机器人·流程图
啊湘2 天前
VSCODE英文界面切换为中文(适用CURSOR等使用)
ide·vscode·编辑器·bug·cursor
hui函数2 天前
Python系列Bug修复|如何解决 pip install -e . 安装报错 “后端不支持可编辑安装(PEP 660)” 问题
python·bug·pip