diff --git a/packages/editor/cypress/snapshots/relationship.cy.ts/delete relationship.snap.png b/packages/editor/cypress/snapshots/relationship.cy.ts/delete relationship.snap.png
index bdbf37f9..7c0090bb 100644
Binary files a/packages/editor/cypress/snapshots/relationship.cy.ts/delete relationship.snap.png and b/packages/editor/cypress/snapshots/relationship.cy.ts/delete relationship.snap.png differ
diff --git a/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 0.snap.png b/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 0.snap.png
index 8e5e85bd..c6d678b5 100644
Binary files a/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 0.snap.png and b/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 0.snap.png differ
diff --git a/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 1.snap.png b/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 1.snap.png
index 0a0fb5ed..a81b741e 100644
Binary files a/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 1.snap.png and b/packages/editor/cypress/snapshots/relationship.cy.ts/move ctl pont 1.snap.png differ
diff --git a/packages/editor/cypress/snapshots/relationship.cy.ts/rel ctl undo.snap.png b/packages/editor/cypress/snapshots/relationship.cy.ts/rel ctl undo.snap.png
index a6b43a4b..301bf796 100644
Binary files a/packages/editor/cypress/snapshots/relationship.cy.ts/rel ctl undo.snap.png and b/packages/editor/cypress/snapshots/relationship.cy.ts/rel ctl undo.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-complex.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-complex.snap.png
index 38ebd698..00404224 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-complex.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-complex.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png
index c860e1ea..e3d510db 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-emptyNodes.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-emptyNodes.snap.png
index 824500a2..3d22c646 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-emptyNodes.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-emptyNodes.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png
index 74b25bd8..f7b32f43 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge.snap.png
index e3d48333..33fcc706 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge2.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge2.snap.png
index 133068a6..2e79d9b0 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge2.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-huge2.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png
index 80f19bb0..0671841c 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-img-support.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-img-support.snap.png
index f323e26f..4c944fcb 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-img-support.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-img-support.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png
index 2bf03248..a6f95bee 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample2.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample2.snap.png
index 1028e6e5..b8632516 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample2.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample2.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png
index 72aca2d3..29d86dc8 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample6.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample6.snap.png
index ca630a5f..9fce2dab 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample6.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample6.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample8.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample8.snap.png
index 70a97dfd..d79e5e6a 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample8.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample8.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome-prism.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome-prism.snap.png
index be4ea0d5..641654d7 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome-prism.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome-prism.snap.png differ
diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome.snap.png
index ffead67f..39e304d2 100644
Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-welcome.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveDefaultPosition.snap.png b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveDefaultPosition.snap.png
index 73487ccd..6636be96 100644
Binary files a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveDefaultPosition.snap.png and b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveDefaultPosition.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/movedownNode.snap.png b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/movedownNode.snap.png
index e7e492ad..cbf2bfd6 100644
Binary files a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/movedownNode.snap.png and b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/movedownNode.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveleftNode.snap.png b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveleftNode.snap.png
index 16a0a1ed..3d97d8a4 100644
Binary files a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveleftNode.snap.png and b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveleftNode.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveupNode.snap.png b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveupNode.snap.png
index 42641dba..cc5af749 100644
Binary files a/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveupNode.snap.png and b/packages/editor/cypress/snapshots/topicDragAndDrop.cy.ts/moveupNode.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontBold.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontBold.snap.png
index eccbb4cc..59650a74 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontBold.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontBold.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontColor.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontColor.snap.png
index 0549b409..3aa7bc98 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontColor.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontColor.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontItalic.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontItalic.snap.png
index b490f5fb..d0a3505b 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontItalic.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontItalic.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeHuge.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeHuge.snap.png
index dba8374d..e4c49f9b 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeHuge.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeHuge.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeLarge.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeLarge.snap.png
index 95adc131..53a5ef3d 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeLarge.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeLarge.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeNormal.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeNormal.snap.png
index f7a55cee..0865f4af 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeNormal.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeNormal.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeSmall.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeSmall.snap.png
index 7aaa38a3..4f53b61b 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeSmall.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeFontSizeSmall.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeMainTopicText.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeMainTopicText.snap.png
index fe857d6e..399770b2 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeMainTopicText.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/changeMainTopicText.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/fontShapePanel.snap.png b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/fontShapePanel.snap.png
index 3eace3bc..31578425 100644
Binary files a/packages/editor/cypress/snapshots/topicFontChange.cy.ts/fontShapePanel.snap.png and b/packages/editor/cypress/snapshots/topicFontChange.cy.ts/fontShapePanel.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicIcon.cy.ts/add-new-icon.snap.png b/packages/editor/cypress/snapshots/topicIcon.cy.ts/add-new-icon.snap.png
index 0a86c78b..b05d1fb9 100644
Binary files a/packages/editor/cypress/snapshots/topicIcon.cy.ts/add-new-icon.snap.png and b/packages/editor/cypress/snapshots/topicIcon.cy.ts/add-new-icon.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicIcon.cy.ts/icons-pannel.snap.png b/packages/editor/cypress/snapshots/topicIcon.cy.ts/icons-pannel.snap.png
index a818cc75..cfbd66f0 100644
Binary files a/packages/editor/cypress/snapshots/topicIcon.cy.ts/icons-pannel.snap.png and b/packages/editor/cypress/snapshots/topicIcon.cy.ts/icons-pannel.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/addChildNodeSortcut.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/addChildNodeSortcut.snap.png
index 6126cb05..f957300d 100644
Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/addChildNodeSortcut.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/addChildNodeSortcut.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png
index 7f56fc28..d48541fc 100644
Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/editor-shortcut-edit.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/editor-shortcut-edit.snap.png
index 29ad75d9..8810ee99 100644
Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/editor-shortcut-edit.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/editor-shortcut-edit.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png
index 29ad75d9..8810ee99 100644
Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/saveChagesShortcut.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/saveChagesShortcut.snap.png
index 8acdeb1c..9f3f6022 100644
Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/saveChagesShortcut.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/saveChagesShortcut.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/undoChange.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/undoChange.snap.png
index c95f7bdc..2ed68c41 100644
Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/undoChange.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/undoChange.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToEllipseShape.snap.png b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToEllipseShape.snap.png
index 830d241b..355bdb98 100644
Binary files a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToEllipseShape.snap.png and b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToEllipseShape.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToLine.snap.png b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToLine.snap.png
index 6c1d1022..f0fc13e5 100644
Binary files a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToLine.snap.png and b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToLine.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToRoundedRectangle.snap.png b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToRoundedRectangle.snap.png
index 5beaee71..64d53b72 100644
Binary files a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToRoundedRectangle.snap.png and b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToRoundedRectangle.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToSquareShape.snap.png b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToSquareShape.snap.png
index 3c28a3b2..410290ec 100644
Binary files a/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToSquareShape.snap.png and b/packages/editor/cypress/snapshots/topicShape.cy.ts/changeToSquareShape.snap.png differ
diff --git a/packages/editor/cypress/snapshots/topicShape.cy.ts/topicShapePanel.snap.png b/packages/editor/cypress/snapshots/topicShape.cy.ts/topicShapePanel.snap.png
index f659ee48..7fae5372 100644
Binary files a/packages/editor/cypress/snapshots/topicShape.cy.ts/topicShapePanel.snap.png and b/packages/editor/cypress/snapshots/topicShape.cy.ts/topicShapePanel.snap.png differ
diff --git a/packages/editor/src/components/action-widget/pane/theme-editor/index.tsx b/packages/editor/src/components/action-widget/pane/theme-editor/index.tsx
index 439c6f5b..ca290d6a 100644
--- a/packages/editor/src/components/action-widget/pane/theme-editor/index.tsx
+++ b/packages/editor/src/components/action-widget/pane/theme-editor/index.tsx
@@ -40,6 +40,7 @@ const ThemeEditor = (props: {
} label="Classic" />
} label="Summer" />
} label="Dark" />
+ } label="Robot" />
);
diff --git a/packages/mindplot/cypress/snapshots/connection.test.js/connection-classic.snap.png b/packages/mindplot/cypress/snapshots/connection.test.js/connection-classic.snap.png
index e1685fb9..f9c9e5f4 100644
Binary files a/packages/mindplot/cypress/snapshots/connection.test.js/connection-classic.snap.png and b/packages/mindplot/cypress/snapshots/connection.test.js/connection-classic.snap.png differ
diff --git a/packages/mindplot/cypress/snapshots/connection.test.js/connection-prism.snap.png b/packages/mindplot/cypress/snapshots/connection.test.js/connection-prism.snap.png
index ee3524fb..f622352c 100644
Binary files a/packages/mindplot/cypress/snapshots/connection.test.js/connection-prism.snap.png and b/packages/mindplot/cypress/snapshots/connection.test.js/connection-prism.snap.png differ
diff --git a/packages/mindplot/src/components/ActionDispatcher.ts b/packages/mindplot/src/components/ActionDispatcher.ts
index f7f50848..82c08079 100644
--- a/packages/mindplot/src/components/ActionDispatcher.ts
+++ b/packages/mindplot/src/components/ActionDispatcher.ts
@@ -26,9 +26,9 @@ import NodeModel from './model/NodeModel';
import RelationshipModel from './model/RelationshipModel';
import Topic from './Topic';
import PositionType from './PositionType';
-import EventBusType from './EventBusType';
+import LayoutEventBusType from './LayoutEventBusType';
-abstract class ActionDispatcher extends EventDispispatcher {
+abstract class ActionDispatcher extends EventDispispatcher {
private static _instance: ActionDispatcher;
private _commandContext: CommandContext;
diff --git a/packages/mindplot/src/components/CommandContext.ts b/packages/mindplot/src/components/CommandContext.ts
index d5e6b4aa..611f508a 100644
--- a/packages/mindplot/src/components/CommandContext.ts
+++ b/packages/mindplot/src/components/CommandContext.ts
@@ -17,7 +17,7 @@
*/
import { $assert, $defined } from '@wisemapping/core-js';
import { Designer } from '..';
-import EventBus from './layout/EventBus';
+import LayoutEventBus from './layout/LayoutEventBus';
import NodeModel from './model/NodeModel';
import RelationshipModel from './model/RelationshipModel';
import PositionType from './PositionType';
@@ -105,7 +105,7 @@ class CommandContext {
moveTopic(topic: Topic, position: PositionType): void {
$assert(topic, 'topic cannot be null');
$assert(position, 'position cannot be null');
- EventBus.instance.fireEvent('topicMoved', {
+ LayoutEventBus.fireEvent('topicMoved', {
node: topic.getModel(),
position,
});
diff --git a/packages/mindplot/src/components/Designer.ts b/packages/mindplot/src/components/Designer.ts
index c71c42ed..3b049b11 100644
--- a/packages/mindplot/src/components/Designer.ts
+++ b/packages/mindplot/src/components/Designer.ts
@@ -40,7 +40,7 @@ import Relationship from './Relationship';
import TopicEventDispatcher from './TopicEventDispatcher';
import TopicFactory from './TopicFactory';
-import EventBus from './layout/EventBus';
+import LayoutEventBus from './layout/LayoutEventBus';
import EventBusDispatcher from './layout/EventBusDispatcher';
import LayoutManager from './layout/LayoutManager';
@@ -654,7 +654,7 @@ class Designer extends EventDispispatcher {
this._canvas.registerEvents();
// Finally, sort the map ...
- EventBus.instance.fireEvent('forceLayout');
+ LayoutEventBus.fireEvent('forceLayout');
this.fireEvent('loadSuccess');
});
}
diff --git a/packages/mindplot/src/components/DesignerActionRunner.ts b/packages/mindplot/src/components/DesignerActionRunner.ts
index 5f5c2096..647f6b18 100644
--- a/packages/mindplot/src/components/DesignerActionRunner.ts
+++ b/packages/mindplot/src/components/DesignerActionRunner.ts
@@ -20,7 +20,7 @@ import ActionDispatcher from './ActionDispatcher';
import Command from './Command';
import CommandContext from './CommandContext';
import DesignerUndoManager from './DesignerUndoManager';
-import EventBus from './layout/EventBus';
+import LayoutEventBus from './layout/LayoutEventBus';
class DesignerActionRunner {
private _undoManager: DesignerUndoManager;
@@ -42,19 +42,19 @@ class DesignerActionRunner {
command.execute(this._context);
this._undoManager.enqueue(command);
this.fireChangeEvent();
- EventBus.instance.fireEvent('forceLayout');
+ LayoutEventBus.fireEvent('forceLayout');
}
undo(): void {
this._undoManager.execUndo(this._context);
this.fireChangeEvent();
- EventBus.instance.fireEvent('forceLayout');
+ LayoutEventBus.fireEvent('forceLayout');
}
redo(): void {
this._undoManager.execRedo(this._context);
this.fireChangeEvent();
- EventBus.instance.fireEvent('forceLayout');
+ LayoutEventBus.fireEvent('forceLayout');
}
fireChangeEvent(): void {
diff --git a/packages/mindplot/src/components/EventBusType.ts b/packages/mindplot/src/components/LayoutEventBusType.ts
similarity index 93%
rename from packages/mindplot/src/components/EventBusType.ts
rename to packages/mindplot/src/components/LayoutEventBusType.ts
index a99f9e7a..76186a7e 100644
--- a/packages/mindplot/src/components/EventBusType.ts
+++ b/packages/mindplot/src/components/LayoutEventBusType.ts
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-export type EventBusType =
+export type LayoutEventBusType =
| 'topicResize'
| 'topicMoved'
| 'forceLayout'
@@ -27,4 +27,4 @@ export type EventBusType =
| 'topicDisconect'
| 'modelUpdate';
-export default EventBusType;
+export default LayoutEventBusType;
diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts
index fcd32297..39e56fc0 100644
--- a/packages/mindplot/src/components/MultilineTextEditor.ts
+++ b/packages/mindplot/src/components/MultilineTextEditor.ts
@@ -21,7 +21,7 @@ import $ from 'jquery';
import ActionDispatcher from './ActionDispatcher';
import EventDispatcher from './EventDispatcher';
-import EventBus from './layout/EventBus';
+import LayoutEventBus from './layout/LayoutEventBus';
import Topic from './Topic';
type EditorEventType = 'input';
@@ -126,7 +126,7 @@ class EditorComponent extends EventDispatcher {
private resize(text?: string): void {
// Force relayout ...
- EventBus.instance.fireEvent('forceLayout');
+ LayoutEventBus.fireEvent('forceLayout');
// Adjust position ...
const textShape = this._topic.getOrBuildTextShape();
diff --git a/packages/mindplot/src/components/StandaloneActionDispatcher.ts b/packages/mindplot/src/components/StandaloneActionDispatcher.ts
index 0875a9e4..86eeb965 100644
--- a/packages/mindplot/src/components/StandaloneActionDispatcher.ts
+++ b/packages/mindplot/src/components/StandaloneActionDispatcher.ts
@@ -27,7 +27,7 @@ import DragTopicCommand from './commands/DragTopicCommand';
import GenericFunctionCommand from './commands/GenericFunctionCommand';
import MoveControlPointCommand from './commands/MoveControlPointCommand';
import ChangeFeatureToTopicCommand from './commands/ChangeFeatureToTopicCommand';
-import EventBus from './layout/EventBus';
+import LayoutEventBus from './layout/LayoutEventBus';
import CommandContext from './CommandContext';
import NodeModel from './model/NodeModel';
import RelationshipModel from './model/RelationshipModel';
@@ -84,7 +84,7 @@ class StandaloneActionDispatcher extends ActionDispatcher {
const commandFunc = (topic: Topic, pos: PositionType) => {
const result = topic.getPosition();
- EventBus.instance.fireEvent('topicMoved', {
+ LayoutEventBus.fireEvent('topicMoved', {
node: topic.getModel(),
position: pos,
});
diff --git a/packages/mindplot/src/components/Topic.ts b/packages/mindplot/src/components/Topic.ts
index a72105c0..fcdc4700 100644
--- a/packages/mindplot/src/components/Topic.ts
+++ b/packages/mindplot/src/components/Topic.ts
@@ -23,7 +23,7 @@ import NodeGraph, { NodeOption } from './NodeGraph';
import TopicFeatureFactory from './TopicFeature';
import ConnectionLine, { LineType } from './ConnectionLine';
import IconGroup from './IconGroup';
-import EventBus from './layout/EventBus';
+import LayoutEventBus from './layout/LayoutEventBus';
import ShirinkConnector from './ShrinkConnector';
import ActionDispatcher from './ActionDispatcher';
@@ -589,7 +589,7 @@ abstract class Topic extends NodeGraph {
elem.setVisibility(!value, 250);
});
- EventBus.instance.fireEvent('childShrinked', model);
+ LayoutEventBus.fireEvent('childShrinked', model);
}
getShrinkConnector(): ShirinkConnector | null {
@@ -618,10 +618,11 @@ abstract class Topic extends NodeGraph {
this._getTopicEventDispatcher().show(this, text);
}
- getNoteValue(): string {
+ getNoteValue(): string | null {
const model = this.getModel();
const notes = model.findFeatureByType('note');
- let result;
+
+ let result: string | null = null;
if (notes.length > 0) {
result = (notes[0] as NoteModel).getText();
}
@@ -694,10 +695,6 @@ abstract class Topic extends NodeGraph {
*/
setPosition(point: PositionType): void {
// allowed param reassign to avoid risks of existing code relying in this side-effect
- point.x = Math.ceil(point.x);
- point.y = Math.ceil(point.y);
-
- // Update model's position ...
const model = this.getModel();
model.setPosition(point.x, point.y);
@@ -900,7 +897,7 @@ abstract class Topic extends NodeGraph {
this.updatePositionOnChangeSize(oldSize, size);
if (hasSizeChanged) {
- EventBus.instance.fireEvent('topicResize', {
+ LayoutEventBus.fireEvent('topicResize', {
node: this.getModel(),
size,
});
@@ -936,7 +933,7 @@ abstract class Topic extends NodeGraph {
}
// Remove from workspace.
- EventBus.instance.fireEvent('topicDisconect', this.getModel());
+ LayoutEventBus.fireEvent('topicDisconect', this.getModel());
this.redraw(true);
}
@@ -983,7 +980,7 @@ abstract class Topic extends NodeGraph {
// Fire connection event ...
if (this._isInWorkspace) {
- EventBus.instance.fireEvent('topicConnected', {
+ LayoutEventBus.fireEvent('topicConnected', {
parentNode: targetTopic.getModel(),
childNode: this.getModel(),
});
@@ -1024,7 +1021,7 @@ abstract class Topic extends NodeGraph {
workspace.removeChild(line);
}
this._isInWorkspace = false;
- EventBus.instance.fireEvent('topicRemoved', this.getModel());
+ LayoutEventBus.fireEvent('topicRemoved', this.getModel());
}
addToWorkspace(workspace: Canvas): void {
@@ -1032,12 +1029,12 @@ abstract class Topic extends NodeGraph {
workspace.append(elem);
if (!this._isInWorkspace) {
if (!this.isCentralTopic()) {
- EventBus.instance.fireEvent('topicAdded', this.getModel());
+ LayoutEventBus.fireEvent('topicAdded', this.getModel());
}
const outgoingTopic = this.getOutgoingConnectedTopic();
if (this.getModel().isConnected() && outgoingTopic) {
- EventBus.instance.fireEvent('topicConnected', {
+ LayoutEventBus.fireEvent('topicConnected', {
parentNode: outgoingTopic.getModel(),
childNode: this.getModel(),
});
diff --git a/packages/mindplot/src/components/layout/EventBusDispatcher.ts b/packages/mindplot/src/components/layout/EventBusDispatcher.ts
index c9cd7fcd..c330f00e 100644
--- a/packages/mindplot/src/components/layout/EventBusDispatcher.ts
+++ b/packages/mindplot/src/components/layout/EventBusDispatcher.ts
@@ -18,7 +18,7 @@
import PositionType from '../PositionType';
import SizeType from '../SizeType';
import Topic from '../Topic';
-import EventBus from './EventBus';
+import LayoutEventBus from './LayoutEventBus';
import LayoutManager from './LayoutManager';
class EventBusDispatcher {
@@ -34,14 +34,14 @@ class EventBusDispatcher {
}
registerBusEvents() {
- EventBus.instance.addEvent('topicAdded', this._topicAdded.bind(this));
- EventBus.instance.addEvent('topicRemoved', this._topicRemoved.bind(this));
- EventBus.instance.addEvent('topicResize', this._topicResizeEvent.bind(this));
- EventBus.instance.addEvent('topicMoved', this._topicMoved.bind(this));
- EventBus.instance.addEvent('topicDisconect', this._topicDisconect.bind(this));
- EventBus.instance.addEvent('topicConnected', this._topicConnected.bind(this));
- EventBus.instance.addEvent('childShrinked', this._childShrinked.bind(this));
- EventBus.instance.addEvent('forceLayout', this._forceLayout.bind(this));
+ LayoutEventBus.addEvent('topicAdded', this._topicAdded.bind(this));
+ LayoutEventBus.addEvent('topicRemoved', this._topicRemoved.bind(this));
+ LayoutEventBus.addEvent('topicResize', this._topicResizeEvent.bind(this));
+ LayoutEventBus.addEvent('topicMoved', this._topicMoved.bind(this));
+ LayoutEventBus.addEvent('topicDisconect', this._topicDisconect.bind(this));
+ LayoutEventBus.addEvent('topicConnected', this._topicConnected.bind(this));
+ LayoutEventBus.addEvent('childShrinked', this._childShrinked.bind(this));
+ LayoutEventBus.addEvent('forceLayout', this._forceLayout.bind(this));
}
private _topicResizeEvent(args: { node: Topic; size: SizeType }) {
@@ -62,6 +62,9 @@ class EventBusDispatcher {
args.childNode.getId(),
args.childNode.getOrder()!, // @todo: This can be a issue ...
);
+
+ // Review this for of relayout, new node is not positioned properly with small gap. The problem seems to be related to some min
+ // this.getLayoutManager().layout(true);
}
getLayoutManager(): LayoutManager {
diff --git a/packages/mindplot/src/components/layout/EventBus.ts b/packages/mindplot/src/components/layout/LayoutEventBus.ts
similarity index 59%
rename from packages/mindplot/src/components/layout/EventBus.ts
rename to packages/mindplot/src/components/layout/LayoutEventBus.ts
index 16184510..383d35c5 100644
--- a/packages/mindplot/src/components/layout/EventBus.ts
+++ b/packages/mindplot/src/components/layout/LayoutEventBus.ts
@@ -16,24 +16,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import EventDispispatcher from '../EventDispatcher';
-import { EventBusType } from '../EventBusType';
+import EventDispatcher from '../EventDispatcher';
+import { LayoutEventBusType } from '../LayoutEventBusType';
-class EventBus extends EventDispispatcher {
- // eslint-disable-next-line no-use-before-define
- static _instance: EventBus = new EventBus();
+class LayoutEventBus {
+ private static _instance: EventDispatcher =
+ new EventDispatcher();
- static get instance(): EventBus {
- return this._instance;
+ static fireEvent(type: LayoutEventBusType, arg?: any): void {
+ return LayoutEventBus._instance.fireEvent(type, arg);
}
- fireEvent(type: EventBusType, arg?: any): void {
- return super.fireEvent(type, arg);
- }
-
- addEvent(type: EventBusType, fn: (arg?: any) => void, internal?: boolean): void {
- return super.addEvent(type, fn, internal);
+ static addEvent(type: LayoutEventBusType, fn: (arg?: any) => void, internal?: boolean): void {
+ return LayoutEventBus._instance.addEvent(type, fn, internal);
}
}
-export default EventBus;
+export default LayoutEventBus;
diff --git a/packages/mindplot/src/components/layout/LayoutEventType.ts b/packages/mindplot/src/components/layout/LayoutEventType.ts
index fa88ac77..70094a6a 100644
--- a/packages/mindplot/src/components/layout/LayoutEventType.ts
+++ b/packages/mindplot/src/components/layout/LayoutEventType.ts
@@ -15,6 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-type LayoutEventType = 'change' | 'forceLayout';
+type LayoutEventType = 'change';
export default LayoutEventType;
diff --git a/packages/mindplot/src/components/layout/LayoutManager.ts b/packages/mindplot/src/components/layout/LayoutManager.ts
index 5e048439..b2c06316 100644
--- a/packages/mindplot/src/components/layout/LayoutManager.ts
+++ b/packages/mindplot/src/components/layout/LayoutManager.ts
@@ -83,10 +83,6 @@ class LayoutManager extends EventDispispatcher {
}
connectNode(parentId: number, childId: number, order: number) {
- $assert($defined(parentId), 'parentId cannot be null');
- $assert($defined(childId), 'childId cannot be null');
- $assert($defined(order), 'order cannot be null');
-
this._layout.connectNode(parentId, childId, order);
return this;
diff --git a/packages/mindplot/src/components/model/ThemeType.ts b/packages/mindplot/src/components/model/ThemeType.ts
index 1878efc6..e4dba15a 100644
--- a/packages/mindplot/src/components/model/ThemeType.ts
+++ b/packages/mindplot/src/components/model/ThemeType.ts
@@ -15,6 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-type ThemeType = 'classic' | 'prism' | 'dark-prism';
+type ThemeType = 'classic' | 'prism' | 'dark-prism' | 'robot';
export default ThemeType;
diff --git a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts
index 1c650ab5..fa7e5264 100644
--- a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts
+++ b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts
@@ -95,7 +95,7 @@ class XMLSerializerTango implements XMLMindmapSerializer {
parentTopic.setAttribute('central', 'true');
} else {
const pos = topic.getPosition();
- parentTopic.setAttribute('position', `${pos.x},${pos.y}`);
+ parentTopic.setAttribute('position', `${Math.ceil(pos.x)},${Math.ceil(pos.y)}`);
const order = topic.getOrder();
if (typeof order === 'number' && Number.isFinite(order)) {
diff --git a/packages/mindplot/src/components/theme/RobotTheme.ts b/packages/mindplot/src/components/theme/RobotTheme.ts
new file mode 100644
index 00000000..33719c9f
--- /dev/null
+++ b/packages/mindplot/src/components/theme/RobotTheme.ts
@@ -0,0 +1,164 @@
+/*
+ * Copyright [2011] [wisemapping]
+ *
+ * Licensed under WiseMapping Public License, Version 1.0 (the "License").
+ * It is basically the Apache License, Version 2.0 (the "License") plus the
+ * "powered by wisemapping" text requirement on every single page;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the license at
+ *
+ * http://www.wisemapping.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { LineType } from '../ConnectionLine';
+import { FontStyleType } from '../FontStyleType';
+import { FontWeightType } from '../FontWeightType';
+import { TopicShapeType } from '../model/INodeModel';
+import Topic from '../Topic';
+import DefaultTheme, { TopicStyleType } from './DefaultTheme';
+import { TopicType } from './Theme';
+
+const defaultStyles = new Map([
+ [
+ 'CentralTopic',
+ {
+ msgKey: 'CENTRAL_TOPIC',
+ borderColor: '#363C56',
+ backgroundColor: '#363C56',
+ fontFamily: 'Brush Script MT',
+ fontSize: 10,
+ fontStyle: 'normal' as FontStyleType,
+ fontWeight: 'bold' as FontWeightType,
+ fontColor: '#ffffff',
+ connectionStyle: LineType.POLYLINE_MIDDLE,
+ connectionColor: '#345780',
+ shapeType: 'rectangle' as TopicShapeType,
+ outerBackgroundColor: '#F4B82D',
+ outerBorderColor: '#F4B82D',
+ },
+ ],
+ [
+ 'MainTopic',
+ {
+ msgKey: 'MAIN_TOPIC',
+ borderColor: ['#698396'],
+ backgroundColor: ['#698396'],
+ connectionColor: ['#698396'],
+ fontFamily: 'Brush Script MT',
+ fontSize: 9,
+ fontStyle: 'normal' as FontStyleType,
+ fontWeight: 'normal' as FontWeightType,
+ fontColor: '#FFFFFF',
+ connectionStyle: LineType.POLYLINE_MIDDLE,
+ shapeType: 'rectangle' as TopicShapeType,
+ outerBackgroundColor: '#F4B82D',
+ outerBorderColor: '#F4B82D',
+ },
+ ],
+ [
+ 'SubTopic',
+ {
+ msgKey: 'SUB_TOPIC',
+ borderColor: '#698396',
+ backgroundColor: '#698396',
+ fontFamily: 'Brush Script MT',
+ fontSize: 8,
+ fontStyle: 'normal' as FontStyleType,
+ fontWeight: 'normal' as FontWeightType,
+ fontColor: '#FFFFFF',
+ connectionStyle: LineType.POLYLINE_MIDDLE,
+ connectionColor: '#345780',
+ shapeType: 'rectangle' as TopicShapeType,
+ outerBackgroundColor: '#F4B82D',
+ outerBorderColor: '#F4B82D',
+ },
+ ],
+ [
+ 'IsolatedTopic',
+ {
+ msgKey: 'ISOLATED_TOPIC',
+ borderColor: '#023BB9',
+ backgroundColor: '#96e3ff',
+ fontFamily: 'Brush Script MT',
+ fontSize: 8,
+ fontStyle: 'normal' as FontStyleType,
+ fontWeight: 'normal' as FontWeightType,
+ fontColor: '#000000',
+ connectionStyle: LineType.POLYLINE_MIDDLE,
+ connectionColor: '#345780',
+ shapeType: 'line' as TopicShapeType,
+ outerBackgroundColor: '#F4B82D',
+ outerBorderColor: '#F4B82D',
+ },
+ ],
+]);
+
+class DarkPrismTheme extends DefaultTheme {
+ constructor() {
+ super(defaultStyles);
+ }
+
+ getCanvasCssStyle(): string {
+ return `position: relative;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ border: 0;
+ overflow: hidden;
+ opacity: 1;
+ background-color: #FFFFFF;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;`;
+ }
+
+ getConnectionColor(topic: Topic): string {
+ let result: string | null = null;
+
+ // Color of the node is the connection is the color of the parent ...
+ const parent = topic.getParent();
+ if (parent && !parent.isCentralTopic()) {
+ result = this.resolve('connectionColor', parent, false) as string;
+ }
+
+ if (!result) {
+ let colors: string[] = [];
+ colors = colors.concat(this.resolve('connectionColor', topic) as string[] | string);
+
+ // if the element is an array, use topic order to decide color ..
+ let order = topic.getOrder();
+ order = order || 0;
+
+ const index = order % colors.length;
+ result = colors[index];
+ }
+ return result!;
+ }
+
+ getBorderColor(topic: Topic): string {
+ const model = topic.getModel();
+ let result = model.getBorderColor();
+
+ // If border color has not been defined, use the connection color for the border ...
+ if (!result) {
+ let colors: string[] = [];
+ colors = colors.concat(this.resolve('borderColor', topic) as string[] | string);
+
+ // if the element is an array, use topic order to decide color ..
+ let order = topic.getOrder();
+ order = order || 0;
+
+ const index = order % colors.length;
+ result = colors[index];
+ }
+ return result;
+ }
+}
+
+export default DarkPrismTheme;
diff --git a/packages/mindplot/src/components/theme/ThemeFactory.ts b/packages/mindplot/src/components/theme/ThemeFactory.ts
index 8f842bd7..21272a85 100644
--- a/packages/mindplot/src/components/theme/ThemeFactory.ts
+++ b/packages/mindplot/src/components/theme/ThemeFactory.ts
@@ -3,6 +3,7 @@ import ThemeType from '../model/ThemeType';
import ClassicTheme from './ClassicTheme';
import DarkPrismTheme from './DarkPrismTheme';
import PrismTheme from './PrismTheme';
+import RobotTheme from './RobotTheme';
import Theme from './Theme';
class ThemeFactory {
@@ -12,6 +13,8 @@ class ThemeFactory {
private static classicTheme = new ClassicTheme();
+ private static robotTheme = new RobotTheme();
+
static createById(id: ThemeType): Theme {
let result: Theme;
switch (id) {
@@ -24,6 +27,9 @@ class ThemeFactory {
case 'prism':
result = ThemeFactory.prismTheme;
break;
+ case 'robot':
+ result = ThemeFactory.robotTheme;
+ break;
default: {
const exhaustiveCheck: never = id;
throw new Error(exhaustiveCheck);
diff --git a/packages/mindplot/storybook/src/stories/Connection.stories.ts b/packages/mindplot/storybook/src/stories/Connection.stories.ts
index fabeef54..d76c3702 100644
--- a/packages/mindplot/storybook/src/stories/Connection.stories.ts
+++ b/packages/mindplot/storybook/src/stories/Connection.stories.ts
@@ -28,3 +28,8 @@ export const DarkPrism = Template.bind({});
DarkPrism.args = {
theme: 'dark-prism',
};
+
+export const robot = Template.bind({});
+DarkPrism.args = {
+ theme: 'robot',
+};
diff --git a/packages/mindplot/storybook/src/stories/Connection.ts b/packages/mindplot/storybook/src/stories/Connection.ts
index dd8c6f23..ef659794 100644
--- a/packages/mindplot/storybook/src/stories/Connection.ts
+++ b/packages/mindplot/storybook/src/stories/Connection.ts
@@ -11,7 +11,8 @@ import MainTopic from '../../../src/components/MainTopic';
import EventBusDispatcher from '../../../src/components/layout/EventBusDispatcher';
import LayoutManager from '../../../src/components/layout/LayoutManager';
import ChangeEvent from '../../../src/components/layout/ChangeEvent';
-import EventBus from '../../../src/components/layout/EventBus';
+import LayoutEventBus from '../../../src/components/layout/LayoutEventBus';
+import { $assert } from '@wisemapping/core-js';
const registerRefreshHook = (topics: Topic[]) => {
// Trigger a redraw after the node is added ...
@@ -22,7 +23,7 @@ const registerRefreshHook = (topics: Topic[]) => {
globalThis.observer = new MutationObserver(() => {
// Relayout...
topics.forEach((t) => t.redraw());
- EventBus.instance.fireEvent('forceLayout');
+ LayoutEventBus.fireEvent('forceLayout');
});
globalThis.observer.observe(document.getElementById('root')!, { childList: true });
};
@@ -56,20 +57,23 @@ const createConnection = ({ theme = undefined, readOnly = true }: TopicArgs) =>
// Add Children ...
const child1 = new NodeModel('MainTopic', mindmap);
child1.setOrder(0);
- child1.setText('This is child one !\nwith other line');
+ child1.setText('Child1: This is child one !\nwith other line');
child1.setPosition(100, 100);
const child2 = new NodeModel('MainTopic', mindmap);
child2.setOrder(1);
child2.setPosition(100, -100);
+ child2.setText('Child2');
const child3 = new NodeModel('MainTopic', mindmap);
- child3.setOrder(0);
+ child3.setOrder(2);
child3.setPosition(-100, 100);
+ child3.setText('Child3');
const child4 = new NodeModel('MainTopic', mindmap);
- child4.setOrder(1);
+ child4.setOrder(3);
child4.setPosition(-100, -100);
+ child3.setText('Child4');
const subchild1 = new NodeModel('MainTopic', mindmap);
subchild1.setOrder(0);
@@ -93,6 +97,7 @@ const createConnection = ({ theme = undefined, readOnly = true }: TopicArgs) =>
const child4Topic = new MainTopic(child4, { readOnly });
const subchild1Topic = new MainTopic(subchild1, { readOnly });
const subchild2Topic = new MainTopic(subchild2, { readOnly });
+
const topics = [
child1Topic,
child2Topic,
@@ -108,24 +113,37 @@ const createConnection = ({ theme = undefined, readOnly = true }: TopicArgs) =>
const size = { width: 25, height: 25 };
const layoutManager = new LayoutManager(mindmap.getCentralTopic().getId(), size);
dispatcher.setLayoutManager(layoutManager);
+
layoutManager.addEvent('change', (event: ChangeEvent) => {
const id = event.getId();
- const topic = topics.filter((t) => t.getModel().getId() === id)[0];
+ const ids = topics.filter((t) => t.getModel().getId() === id);
+ $assert(ids.length === 1, `Unexpeted number of elements ${String(ids)} - ${id}`);
+ const topic = ids[0];
topic.setPosition(event.getPosition());
topic.setOrder(event.getOrder());
});
- // Add to canvas ...
- topics.forEach((t) => canvas.append(t));
-
// Connect nodes ...
+ canvas.append(centralTopic);
+
child1Topic.connectTo(centralTopic, canvas);
+ canvas.append(child1Topic);
+
child2Topic.connectTo(centralTopic, canvas);
+ canvas.append(child2Topic);
+
child3Topic.connectTo(centralTopic, canvas);
+ canvas.append(child3Topic);
+
child4Topic.connectTo(centralTopic, canvas);
+ canvas.append(child4Topic);
+
subchild1Topic.connectTo(child1Topic, canvas);
+ canvas.append(subchild1Topic);
+
subchild2Topic.connectTo(child1Topic, canvas);
+ canvas.append(subchild2Topic);
// Register refresh hook ..
registerRefreshHook(topics);
diff --git a/packages/webapp/cypress/snapshots/editor.cy.ts/editor-page.snap.png b/packages/webapp/cypress/snapshots/editor.cy.ts/editor-page.snap.png
index b1b5486b..c5825f44 100644
Binary files a/packages/webapp/cypress/snapshots/editor.cy.ts/editor-page.snap.png and b/packages/webapp/cypress/snapshots/editor.cy.ts/editor-page.snap.png differ
diff --git a/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png b/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png
index 10ff623e..68dd6f6d 100644
Binary files a/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png and b/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png differ