tiimeout not needed
This commit is contained in:
parent
fe8d2c1ff9
commit
3daf5a0b2c
1 changed files with 15 additions and 18 deletions
|
@ -114,26 +114,23 @@ const JIT = {
|
||||||
prepareVizData: function() {
|
prepareVizData: function() {
|
||||||
const self = JIT
|
const self = JIT
|
||||||
let mapping
|
let mapping
|
||||||
|
|
||||||
self.vizData = []
|
self.vizData = []
|
||||||
Visualize.loadLater = false
|
Visualize.loadLater = false
|
||||||
setTimeout(() => {
|
const results = self.convertModelsToJIT(DataModel.Topics, DataModel.Synapses)
|
||||||
const results = self.convertModelsToJIT(DataModel.Topics, DataModel.Synapses)
|
self.vizData = results[0]
|
||||||
self.vizData = results[0]
|
// clean up the synapses array in case of any faulty data
|
||||||
// clean up the synapses array in case of any faulty data
|
_.each(results[1], function(synapse) {
|
||||||
_.each(results[1], function(synapse) {
|
mapping = synapse.getMapping()
|
||||||
mapping = synapse.getMapping()
|
DataModel.Synapses.remove(synapse)
|
||||||
DataModel.Synapses.remove(synapse)
|
if (DataModel.Mappings) DataModel.Mappings.remove(mapping)
|
||||||
if (DataModel.Mappings) DataModel.Mappings.remove(mapping)
|
})
|
||||||
})
|
if (self.vizData.length === 0) {
|
||||||
if (self.vizData.length === 0) {
|
Map.setHasLearnedTopicCreation(false)
|
||||||
Map.setHasLearnedTopicCreation(false)
|
Visualize.loadLater = true
|
||||||
Visualize.loadLater = true
|
} else {
|
||||||
} else {
|
Map.setHasLearnedTopicCreation(true)
|
||||||
Map.setHasLearnedTopicCreation(true)
|
}
|
||||||
}
|
Visualize.render()
|
||||||
Visualize.render()
|
|
||||||
}, 1)
|
|
||||||
}, // prepareVizData
|
}, // prepareVizData
|
||||||
edgeRender: function(adj, canvas) {
|
edgeRender: function(adj, canvas) {
|
||||||
// get nodes cartesian coordinates
|
// get nodes cartesian coordinates
|
||||||
|
|
Loading…
Add table
Reference in a new issue