From f4ca205f19be7fc5ffe52fb5ad1f3f8ca3a6a7d6 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 15 Dec 2016 15:18:42 +0000 Subject: [PATCH] enhanced the project user relation graph view to show graph stabilization progress --- codepot/src/codepot/views/project_map.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/codepot/src/codepot/views/project_map.php b/codepot/src/codepot/views/project_map.php index 90c37cc9..1e7d2c58 100644 --- a/codepot/src/codepot/views/project_map.php +++ b/codepot/src/codepot/views/project_map.php @@ -37,6 +37,7 @@ function show_alert (outputMsg, titleMsg) var revision_network = null; var revision_network_data = null; +var revision_rendering_progress = null; function resize_window() { @@ -122,8 +123,9 @@ function show_project_user_relation_graph (response) if (revision_network === null) { - revision_network = new vis.Network(document.getElementById('project_user_relation_graph'), data, options); + revision_network_progress = $('#project_map_progress'); revision_network_data = data; + revision_network = new vis.Network(document.getElementById('project_user_relation_graph'), data, options); revision_network.on ('doubleClick', function (props) { if (props.nodes.length > 0) @@ -144,6 +146,18 @@ function show_project_user_relation_graph (response) } } }); + + revision_network.on ('startStabilizing', function (params) { + $("#project_map_refresh_button").button("disable"); + }); + revision_network.on ('stabilizationProgress', function (params) { + var prog = params.iterations/params.total; + revision_network_progress.text (Math.round(prog*100)+'%'); + }); + revision_network.on ('stabilizationIterationsDone', function (params) { + revision_network_progress.text (''); + $("#project_map_refresh_button").button("enable"); + }); } else { @@ -228,6 +242,7 @@ $this->load->view (
lang->line('Graph');?>
+ lang->line('Refresh')?>