Last active
December 30, 2015 09:39
-
-
Save averygoodplanet/7810353 to your computer and use it in GitHub Desktop.
Editing Loaded Map Errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SETUP OF ERROR: | |
1. Login | |
2. Create a new map and save it. | |
3. From table screen click Load to load the map. | |
EVENTS THAT TRIGGER ERROR (from step 3 above): | |
-left-click once on node's title causes (a) nodes to swell large or to most of canvas size | |
-double-click (a) causes node shapes to disappear. | |
NOTICED change in data, i.e. fd.toJSON('graph')[0].data.$dim | |
In good situation (new map edit screen), the $dim is "7" | |
In error situation (load screen edit errors), the $dim goes "70", then "710" then "70-53-NaN" | |
HYPOTHESIS 1: The cause of the error is changes to $dim, probably through the feature that highlights neighbor-lines-and-current-node on node name click, e.g. in example2.js: | |
nameContainer.onclick = function(event) { | |
fd.graph.eachNode(function(n) { | |
if(n.id != node.id) delete n.selected; | |
n.setData('dim', 7, 'end'); | |
n.eachAdjacency(function(adj) { | |
adj.setDataset('end', { | |
lineWidth: 0.4, | |
color: '#23a4ff' | |
}); | |
}); | |
}); | |
if(!node.selected) { | |
node.selected = true; | |
node.setData('dim', 17, 'end'); | |
node.eachAdjacency(function(adj) { | |
adj.setDataset('end', { | |
lineWidth: 3, | |
color: '#36acfb' | |
}); | |
}); | |
} else { | |
delete node.selected; | |
} | |
//trigger animation to final styles | |
fd.fx.animate({ | |
modes: [ 'node-property:dim', | |
'edge-property:lineWidth:color'], | |
duration: 500 | |
}); | |
ATTEMPTS: | |
--Tried to comment out entire nameContainer.onclick where $dim is mentioned to see if stopping these changes would stop problem. Commenting out this resulted in canvas not displaying. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Additional Setup steps: