Skip to content
Snippets Groups Projects
Commit ee911b88 authored by Maximilian Giller's avatar Maximilian Giller
Browse files

Fixed missing color when adding new node and link

parent 26128525
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,7 @@ export class Graph extends ManagedData { ...@@ -75,7 +75,7 @@ export class Graph extends ManagedData {
// Deactivate physics after a short delay // Deactivate physics after a short delay
this.physicsStopTimeoutId = setTimeout(() => { this.physicsStopTimeoutId = setTimeout(() => {
this.stopPhysics(); this.stopPhysics();
this.storeCurrentData("Physics stopped"); this.storeCurrentData("Physics stopped", false);
this.physicsStopTimeoutId = undefined; this.physicsStopTimeoutId = undefined;
}, this.physicsDelay); }, this.physicsDelay);
} }
...@@ -116,6 +116,10 @@ export class Graph extends ManagedData { ...@@ -116,6 +116,10 @@ export class Graph extends ManagedData {
getTypeColor(typeClass) { getTypeColor(typeClass) {
var classIndex = this.nodeTypes.indexOf(typeClass); var classIndex = this.nodeTypes.indexOf(typeClass);
if (classIndex <= -1) {
return 'black';
}
return COLOR_PALETTE[classIndex % COLOR_PALETTE.length]; return COLOR_PALETTE[classIndex % COLOR_PALETTE.length];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment