From 21f58c2a71486306e9d980448083496b257d989e Mon Sep 17 00:00:00 2001 From: Yanyan-Wang Date: Tue, 7 Apr 2020 20:21:07 +0800 Subject: [PATCH] feat: layout for combo. feat: nonoverlap for combo layout in first stage. --- src/layout/comboForce.ts | 1 - stories/Layout/component/g6force-layout.tsx | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/layout/comboForce.ts b/src/layout/comboForce.ts index 0ee2247bde..e836527a2c 100644 --- a/src/layout/comboForce.ts +++ b/src/layout/comboForce.ts @@ -156,7 +156,6 @@ export default class ComboForce extends BaseLayout { self.initVals(); // init the positions to make the nodes with same combo gather - self.initPos(comboMap); // iterate for (let i = 0; i < maxIteration; i++) { diff --git a/stories/Layout/component/g6force-layout.tsx b/stories/Layout/component/g6force-layout.tsx index 756f9c71c6..128176a4a5 100644 --- a/stories/Layout/component/g6force-layout.tsx +++ b/stories/Layout/component/g6force-layout.tsx @@ -493,6 +493,7 @@ const G6ForceLayout = () => { container: container.current as string | HTMLElement, width: 800, height: 500, +<<<<<<< HEAD fitView: true, modes: { default: ['drag-canvas', 'drag-node', 'zoom-canvas'], @@ -500,6 +501,14 @@ const G6ForceLayout = () => { layout: { type: 'comboForce', linkDistance: 1000, +======= + modes: { + default: ['drag-canvas', 'drag-node'], + }, + layout: { + type: 'comboForce', + linkDistance: 100, +>>>>>>> feat: layout for combo. feat: nonoverlap for combo layout in first stage. // comboIding: true, // comboIdGravity: 5, // preventOverlap: true, @@ -508,11 +517,15 @@ const G6ForceLayout = () => { nodeStrength: 30, linkStrength: 0.1, // preventOverlap: true, +<<<<<<< HEAD preventComboOverlap: true, collideStrength: 0.5, maxIteration: 10, comboPadding: 5, comboSpacing: 10 +======= + preventComboOverlap: true +>>>>>>> feat: layout for combo. feat: nonoverlap for combo layout in first stage. }, defaultEdge: { size: 3,