Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.2 KB

index.md

File metadata and controls

43 lines (35 loc) · 1.2 KB
layout title
main
Panama
<script src="{{ site.baseurl }}/js/lib/d3.min.js"></script> <script src="{{ site.baseurl }}/src/pty.js"></script>
<script> d3.json('{{ site.baseurl }}/data/A.json', function(error, data) { if (error) { return error; } var width = parseInt(d3.select('#demo').style('width'), 10), height = 400; var legend = [ {name: 'Persona', type: 'persona'}, {name: 'Candidato', type: 'candidato'}, {name: 'Institución', type: 'institucion'} ]; var chart01 = pty.chart.network() .width(width) .height(height) .nodeRadius(15) .nodeLabel(function(d) { return d.name; }) .nodeClass(function(d) { return d.type; }) .nodeBaseURL(function(d) { return '{{site.baseurl}}/data/' + d.id + '.json'; }) .nodeURL(function(d) { return '{{site.baseurl}}/pages/' + d.id; }) .legendItems(legend); d3.select('div#demo').data([data]).call(chart01); }); </script>