fix:力导向

This commit is contained in:
lwj
2022-04-06 11:59:24 +08:00
parent 7b9fffe0ab
commit a9e5bcd224
5 changed files with 150 additions and 20 deletions
+3 -2
View File
@@ -38,7 +38,7 @@ export class Renderer {
this.shadowG6Instance = new Graph({
container: DOMContainer.cloneNode() as HTMLElement
});
// 力导向的配置选项
const forceOption = {
type: 'force',
linkDistance: 100, // 边长
@@ -51,6 +51,7 @@ export class Renderer {
},
center: [DOMContainer.offsetWidth / 2, DOMContainer.offsetHeight / 3],
};
// 布局配置
const layout = isForce ? forceOption : null;
// 初始化g6实例
this.g6Instance = new Graph({
@@ -65,7 +66,7 @@ export class Renderer {
},
modes: behaviorsModes,
plugins: [tooltip],
layout,
layout, // 布局配置
});
/**
* 固定被拖拽节点
-10
View File
@@ -53,15 +53,6 @@ export class Engine {
* @param prevStep
*/
public render(source: Sources) {
<<<<<<< HEAD
if (source === undefined || source === null) {
return;
}
``
let stringSource = JSON.stringify(source);
if (this.prevStringSource === stringSource) {
return;
=======
let isSameSources: boolean = false,
layoutGroupTable: LayoutGroupTable;
@@ -74,7 +65,6 @@ export class Engine {
if (this.prevStringSource === stringSource) {
isSameSources = true;
>>>>>>> eac9d007bcc1b52fe573ddf6cb97030c9b2d3a6d
}
this.prevStringSource = stringSource;