|
|
@@ -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) {
|