hide circles when transitioning from topic view to map view

fixes #389
This commit is contained in:
Devin Howard 2016-09-25 20:10:18 +08:00
parent 43fafb8e6f
commit 7734272737
2 changed files with 9 additions and 8 deletions

View file

@ -6,7 +6,6 @@ import Backbone from 'backbone'
import Active from './Active' import Active from './Active'
import GlobalUI from './GlobalUI' import GlobalUI from './GlobalUI'
import JIT from './JIT'
import Map from './Map' import Map from './Map'
import Topic from './Topic' import Topic from './Topic'
import Views from './Views' import Views from './Views'
@ -170,9 +169,7 @@ const _Router = Backbone.Router.extend({
// clear the visualization, if there was one, before showing its div again // clear the visualization, if there was one, before showing its div again
if (Visualize.mGraph) { if (Visualize.mGraph) {
Visualize.mGraph.graph.empty() Visualize.clearVisualization()
Visualize.mGraph.plot()
JIT.centerMap(Visualize.mGraph.canvas)
} }
GlobalUI.showDiv('#infovis') GlobalUI.showDiv('#infovis')
Topic.end() Topic.end()
@ -198,9 +195,7 @@ const _Router = Backbone.Router.extend({
// clear the visualization, if there was one, before showing its div again // clear the visualization, if there was one, before showing its div again
if (Visualize.mGraph) { if (Visualize.mGraph) {
Visualize.mGraph.graph.empty() Visualize.clearVisualization()
Visualize.mGraph.plot()
JIT.centerMap(Visualize.mGraph.canvas)
} }
GlobalUI.showDiv('#infovis') GlobalUI.showDiv('#infovis')
Map.end() Map.end()

View file

@ -220,7 +220,13 @@ const Visualize = {
Router.navigate('/topics/' + t.id) Router.navigate('/topics/' + t.id)
} }
}, 800) }, 800)
} },
clearVisualization: function() {
Visualize.mGraph.graph.empty()
Visualize.mGraph.plot()
JIT.centerMap(Visualize.mGraph.canvas)
$('#infovis').empty()
},
} }
export default Visualize export default Visualize