<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 08/28/2015 02:04 PM, Bastian Bittorf
wrote:<br>
</div>
<blockquote cite="mid:20150828120401.GF12602@medion.lan" type="cite">
<pre wrap="">* Nemesis <a class="moz-txt-link-rfc2396E" href="mailto:nemesis@ninux.org"><nemesis@ninux.org></a> [28.08.2015 13:49]:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">this will not work, because one node can have different interfaces with
different types - how can i add that to properties?
</pre>
</blockquote>
<pre wrap="">
Link objects can have properties too!
</pre>
</blockquote>
<pre wrap="">
oh - soooo easy?! thank you:
<a class="moz-txt-link-freetext" href="http://intercity-vpn.de/networks/giancarlo/meshrdf/netjson.html">http://intercity-vpn.de/networks/giancarlo/meshrdf/netjson.html</a>
(mixed wireless+ethernet)
next week i will implement the subtypes. (frequency + channelwidth)
</pre>
</blockquote>
<br>
<br>
Well I found out a few things to change in networkgraph to allow
customizing colors more easily.<br>
<br>
For the moment try this crappy hack:<br>
<br>
add style in your <head>:<br>
<br>
<style><br>
.ethernet,.ethernet:hover,.ethernet.njg-open { stroke:
rgb(230, 85, 13) !important }<br>
.ethernet{ stroke-opacity: 0.5 }<br>
</style><br>
<br>
and in <script>:<br>
<br>
<script><br>
d3.netJsonGraph("map.json");<br>
setTimeout(function(){<br>
d3.selectAll('.njg-link').attr('class', function(l){<br>
if (l.properties && l.properties.type) {<br>
return 'njg-link ' + l.properties.type;<br>
}<br>
return 'njg-link';<br>
});<br>
}, 500);<br>
</script><br>
<br>
<br>
We need 2 things in netjsongraph.js:<br>
<ul>
<li>a parameter that accepts a function to be executed when the
graph has finished loading data<br>
</li>
<li>when clicking on a node or a link right now the library
hardcodes "njg-link njg-ethernet", deleting any custom added
class .. so if you click on the ethernet links you will lose the
color!<br>
</li>
</ul>
</body>
</html>