Я следую примеру Dynamic Dataset из vis и получаю ошибку машинописного текста, когда пытаюсь установить ребра.
У меня просто есть массив ребер, который выглядит следующим образом:
edgesArray = [
{ from: 1, to: 3 },
{ from: 1, to: 2 },
{ from: 2, to: 4 },
{ from: 3, to: 5 },
]
, и я устанавливаю данные как
let data = {
nodes: new vis.DataSet(nodesArray),
edges: new vis.DataSet(edgesArray)
}
Ошибка, которую я получаю, заключается вкрая.
No overload matches this call.
Overload 1 of 2, '(options?: DataSetInitialOptions<"id">): DataSet<Partial<Record<"id", string | number>>, "id">', gave the following error.
Type '{ from: number; to: number; } []' has no properties in common with type 'DataSetInitialOptions<"id">'.
Overload 2 of 2, '(data: Partial<Record<"id", string | number>>[], options?: DataSetInitialOptions<"id">): DataSet<Partial<Record<"id", string | number>>, "id">', gave the following error.
Argument of type '{ from: number; to: number; } []' is not assignable to parameter of type 'Partial<Record<"id", string | number>>[]'.
Я использую VIS-сеть версии 5.2.4.