gpt4 book ai didi

javascript - 如何在vis.js中的节点中存储数据?

转载 作者:行者123 更新时间:2023-12-03 07:33:08 25 4
gpt4 key购买 nike

你能帮我吗?我不知道如何将一些数据放入 vis.js 库(Javascript)的节点中

我知道的唯一属性是“id”,“date”,“label”,“title”,“image”,“x”,“y”,但没有用于存储数据的属性(例如用户的用户名,年龄)等,如果我的节点代表一个用户)

目前,我将数据存储在标题属性的输入类型=“隐藏”中...但我不知道是否有更干净的方法来做到这一点。

(抱歉,如果我的英语不太好)

最佳答案

最后我找到了如何做到这一点。只需添加属性:

nodes.push({
id:xxx,
shape: xxx,
image: xxx,
label: xxx,
title: xxx,
property_1:xxx,
property_2:xxx,
property_3:xxx,
...,
property_n:xxx
});

关于javascript - 如何在vis.js中的节点中存储数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35730987/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com