From 0825293f4f73d30a8d6f7cacb89cc34f50c6e891 Mon Sep 17 00:00:00 2001 From: AlexIchenskiy Date: Mon, 15 Jul 2024 08:14:35 +0200 Subject: [PATCH] Fix: Docs typos --- docs/styles.md | 10 +++++----- docs/view-default.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/styles.md b/docs/styles.md index 7553997..8a3ef9c 100644 --- a/docs/styles.md +++ b/docs/styles.md @@ -96,8 +96,8 @@ const orb = new OrbView(container); orb.data.setDefaultStyle({ getNodeStyle: (node) => { return { - ...node.style, - label: node.data.name, + ...node.getStyle(), + label: node.getData().name, }; }, }); @@ -223,7 +223,7 @@ orb.data.setDefaultStyle({ color: "#FF0000", fontSize: 10, size: 10, - label: `Node: ${node.data.title}`, + label: `Node: ${node.getData().title}`, }; }, getEdgeStyle() { @@ -253,7 +253,7 @@ orb.data.getNodes().forEach((node) => { color: "#FF0000", fontSize: 10, size: 10, - label: `Node: ${node.data.title}`, + label: `Node: ${node.getData().title}`, }); }); orb.data.getEdges().forEach((edge) => { @@ -286,7 +286,7 @@ node.setStyle({ color: "#FF0000", fontSize: 10, size: 10, - label: `Node: ${node.data.title}`, + label: `Node: ${node.getData().title}`, }); // Change the width of all the edges to 1, but keep other style properties diff --git a/docs/view-default.md b/docs/view-default.md index 6d2fb78..849796a 100644 --- a/docs/view-default.md +++ b/docs/view-default.md @@ -263,8 +263,8 @@ access your original properties through `.data` property. There you can find all your nodes that you assigned in the `orb.data.setup()` function. Here you can use your original properties to indicate which ones represent your node coordinates -(`node.data.posX`, `node.data.posY`). All you have to do is return a `IPosition` that requires -2 basic properties: `x` and `y` (`{ x: node.data.posX, y: node.data.posY }`). +(`node.getData().posX`, `node.getData().posY`). All you have to do is return a `IPosition` that requires +2 basic properties: `x` and `y` (`{ x: node.getData().posX, y: node.getData().posY }`). ### Property `render`