Explorar el Código

fixed graph width

Piotr Labudda hace 7 años
padre
commit
54db63b899
Se han modificado 2 ficheros con 4 adiciones y 3 borrados
  1. 1 2
      theme/assets/js/graph/sankey-init-widget.js
  2. 3 1
      tools/Bocian.php.view.js

+ 1 - 2
theme/assets/js/graph/sankey-init-widget.js

@@ -314,9 +314,8 @@ function seturl(){
 		if (!htmlNode) throw "Missing html node";
 		if (!data) throw "Missing data";
 
-		//svg = d3.select("#chart").append("svg")
 		htmlNode.append("rect").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("fill","white")
-		width = 1020
+		width = (opts.width) ? opts.width - margin.left - margin.right : 1020
 		height = 500
 		margin = {
 			top: 10,

+ 3 - 1
tools/Bocian.php.view.js

@@ -1941,7 +1941,9 @@ function graphRender(wrapNode, props) {
 
 	var graphData = { nodes: _nodes, links: _links };
 
-	var graf = renderGraph(svgNode, graphData)
+	var graf = renderGraph(svgNode, graphData, {
+		width: jQuery(wrapNode).width()
+	})
 	graf.on('click', (event) => {
 	  if(DBG)console.log('event', event)
 	  // event = {