Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path is created but highlighted color is not showing #6

Open
suvracn opened this issue Apr 11, 2018 · 3 comments
Open

Path is created but highlighted color is not showing #6

suvracn opened this issue Apr 11, 2018 · 3 comments
Labels

Comments

@suvracn
Copy link

suvracn commented Apr 11, 2018

Sample JSON:
{
"nodes": [
{
"name": "AMP FINANCIAL PLANNING PTY LIMITED",
"color": "#e65472",
"fill": "main_node"
},
{
"name": "to Other",
"color": "#e65472",
"fill": "linearGradientRed"
},
{
"name": "from Other",
"color": "#3db1a7",
"fill": "linearGradientGreen"
}
],
"links": [
{
"source": 0,
"target": 1,
"value": 2
},
{
"source": 2,
"target": 0,
"value": 3
}
]
}

This my sample json file. When I used this then LHS graph is not showing. only rectangle is created .
Please help me for urgent basis.

@fabric-io-rodrigues
Copy link
Owner

Hi @suvracn, Could you create an example page (jsfiddle) to better describe the problem? It also includes the configuration of the graphic used.

@suvracn
Copy link
Author

suvracn commented Apr 11, 2018

Hello,
Please find below jsfiddle link https://jsfiddle.net/z69tt285/

Code Snippet:

<div id="chart"></div>
  <style type="text/css">
    #chart {
		height: 500px;
		width: 960px;
	}
  </style>
<script type="text/javascript">
window.onload=function(){
    var configData= {
          margin: { top: 2, left: 2, right: 2, bottom: 2 },
          nodes: {
            dynamicSizeFontNode: {
              enabled: true,
              minSize: 14,
              maxSize: 16
            },
            draggableX: false, // default [ false ]
            draggableY: false, // default [ true ]
            colors: d3.scaleOrdinal(d3.schemeCategory20)
          },
          links: {
            formatValue: function (val) {
              return d3.format(',.0f')(val) + ' Advisers'
            }
          },
          tooltip: {
            infoDiv: true,
            labelSource: 'From:',
            labelTarget: 'To:'
          }
        };
        
        var datajson={
                "nodes": [
                {
                "name": "ABC PTY LIMITED",
                "color": "#e65472",
                "fill": "main_node"
                },
                {
                "name": "to Other",
                "color": "#e65472",
                "fill": "linearGradientRed"
                },
                {
                "name": "from Other",
                "color": "#3db1a7",
                "fill": "linearGradientGreen"
                }
                ],
                "links": [
                {
                "source": 0,
                "target": 1,
                "value": 2
                },
                {
                "source": 2,
                "target": 0,
                "value": 3
                }
                ]
                }

    

var objSankey = sk.createSankey('#chart', configData, datajson);

}
</script>





@fabric-io-rodrigues
Copy link
Owner

You were using a modified version of lib skd3.js, I modified it to release version and it is working.
https://jsfiddle.net/z69tt285/8/

<script src="//rawgit.com/FabricioRHS/skd3/master/build/sk.d3.min.js"></script>
<link  href="//rawgit.com/FabricioRHS/skd3/master/build/sk.d3.min.css" rel="stylesheet" type="text/css" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants