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"
  }

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

相关推荐
phantom_1114 小时前
Cursor 分析 bug 记录
bug·cursor
Direction_Wind1 天前
Flinksql bug: Heartbeat of TaskManager with id container_XXX timed out.
大数据·flink·bug
AIBigModel4 天前
智能情趣设备、爆 bug:可被远程操控。。。
网络·安全·bug
Direction_Wind4 天前
flinksql bug: Received resultset tuples, but no field str
bug
远瞻。4 天前
【bug】diff-gaussian-rasterization Windows下编译 bug 解决
windows·bug
中草药z4 天前
【测试】Bug+设计测试用例
功能测试·测试工具·测试用例·bug·压力测试·测试
我又来搬代码了5 天前
【Android】【bug】Json解析错误Expected BEGIN_OBJECT but was STRING...
android·json·bug
数据爬坡ing5 天前
软件工程总体设计:从抽象到具体的系统构建之道
数据库·流程图·软件工程·可用性测试·软件需求
葵野寺5 天前
【软件测试】BUG篇 — 详解
bug·测试
zzywxc7876 天前
深入解析大模型落地的四大核心技术:微调、提示词工程、多模态应用 及 企业级解决方案,结合代码示例、流程图、Prompt案例及技术图表,提供可落地的实践指南。
人工智能·深度学习·机器学习·数据挖掘·prompt·流程图·editplus