From 966f5908d94cd9a02a6d086490cf404b0a8dbe33 Mon Sep 17 00:00:00 2001 From: fanyang <1776336252@qq.com> Date: Tue, 27 Aug 2024 11:32:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(example):=20=E4=BF=AE=E5=A4=8Drect=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E4=B8=ADradius=E5=B1=9E=E6=80=A7=E5=9C=A8properties?= =?UTF-8?q?=E4=B8=AD=E4=BD=BF=E7=94=A8=E6=96=B9=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/graph/index.tsx | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/examples/feature-examples/src/pages/graph/index.tsx b/examples/feature-examples/src/pages/graph/index.tsx index 7710ab78a..a4403b2ed 100644 --- a/examples/feature-examples/src/pages/graph/index.tsx +++ b/examples/feature-examples/src/pages/graph/index.tsx @@ -99,9 +99,7 @@ const data = { properties: { width: 80, height: 120, - style: { - radius: 20, - }, + radius: 20, }, }, { @@ -393,6 +391,21 @@ export default function BasicNode() { lfRef?.current?.dnd.startDrag(node) } + const changeNodeBorderColor = () => { + const lf = lfRef.current + if (lf) { + const { nodes } = lf.getSelectElements() + nodes.forEach(({ id, properties }) => { + console.log('properties', properties) + lf.setProperties(id, { + style: { + stroke: 'pink', + }, + }) + }) + } + } + return ( @@ -445,6 +458,13 @@ export default function BasicNode() { +