소스 검색

turned off RefGrapf sankey view

Piotr Labudda 8 년 전
부모
커밋
43862cf4a3
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      SE/se-lib/Route/RefGraph.php
  2. 5 3
      SE/se-lib/Route/RefGraph.php.view.js

+ 1 - 1
SE/se-lib/Route/RefGraph.php

@@ -12,7 +12,7 @@ class Route_RefGraph extends RouteBase {
 		if (!$namespace) throw new Exception("Missing namespace");
 		$primaryKey = V::get('primaryKey', '', $_GET);
 		if (!$primaryKey) throw new Exception("Missing primaryKey");
-		$show_flow_diagram = 1; // (V::get('FLOW', 0, $_GET, 'int') > 0);
+		$show_flow_diagram = (V::get('FLOW', 0, $_GET, 'int') > 0); // TODO: BUG dla pracownika 9
 		echo UI::h('div', [ 'id' => "ref_graph_node", 'style' => "width:98%; height:500px; border:1px solid silver; margin:8px auto; padding:0" ], [
 			"Pobieranie danych..."
 		]);

+ 5 - 3
SE/se-lib/Route/RefGraph.php.view.js

@@ -7,7 +7,6 @@ if ('undefined' === typeof PRIMARY_KEY) throw "Missing PRIMARY_KEY";
 // if ('undefined' === typeof JS_CHANNEL_UPDATE_NAME) throw "Missing JS_CHANNEL_UPDATE_NAME";
 var DBG = DBG || 0;
 var DBG_SANKEY = DBG_SANKEY || 0;
-DBG_SANKEY = 1
 var SHOW_FLOW_DIAGRAM = SHOW_FLOW_DIAGRAM || 0;
 
 var _isFullScreen = true; // TODO: get from arg
@@ -149,7 +148,7 @@ function dataMakeFetchMoreEdge(parentNodeId, fetchMoreNode) {
 		if(DBG)console.log('features', features)
 		updateWfsResponse(features, featureTypeName)
 
-		updateSankeyDiagram()
+		if (SHOW_FLOW_DIAGRAM) updateSankeyDiagram()
 
 	}).catch(function (e) {
 		if(DBG)console.warn(e)
@@ -583,7 +582,7 @@ function renderSelectedNode(node) {
 }
 
 function updateSankeyDiagram() {
-	if(DBG||DBG_SANKEY)console.log('updateSankeyDiagram..');
+	if(DBG||DBG_SANKEY)console.log('DBG:sankey: updateSankeyDiagram..');
 	if (!SHOW_FLOW_DIAGRAM || !sankey) return;
 	// var sankeyData = { // example
 	// 	nodes: [
@@ -637,11 +636,13 @@ function updateSankeyDiagram() {
 	}));
 	var sankeyInstance = sankey({
 		nodes: _nodes.map(function (node) {
+			if(DBG||DBG_SANKEY)console.log('DBG:sankey: loop nodes');
 			return {
 				name: node.label
 			}
 		}),
 		links: _edges.map(function (edge) {
+			if(DBG||DBG_SANKEY)console.log('DBG:sankey: loop links');
 			if (!mapVisNodeIdToIdx.hasOwnProperty(edge.from)) throw "Missing from in mapVisNodeIdToIdx["+edge.from+"]"
 			if (!mapVisNodeIdToIdx.hasOwnProperty(edge.to)) throw "Missing to in mapVisNodeIdToIdx["+edge.to+"]"
 			var idxTarget = mapVisNodeIdToIdx[edge.to]
@@ -652,6 +653,7 @@ function updateSankeyDiagram() {
 			}
 		}),
 	});
+	if(DBG||DBG_SANKEY)console.log('DBG:sankey: sankeyInstance created');
 	// var sankeyInstance = sankey()
 	// .nodes(
 	// 	_nodes.map(function (node) {