Load network with URL query builder
If you have a REST service that provides you with the network data, you can use the <rest-load>
directive to help you assemble appropriate url query. info-url
should provide information on the data available on the server. For example:
{"countries":[
{"id":12,"label":"Australia"},
{"id":66,"label":"Equatorial Guinea"},
{"id":214,"label":"United Kingdom"}],
"product":[
{"id":35,"label":"Vegetables and fruits"},
{"id":66,"label":"Medicinal and pharmaceutical products"},
{"id":106,"label":"Non-ferrous metals"}],
"year":[
{"id":"1995","label":"1995"},
{"id":"1996","label":"1996"},
{"id":"1997","label":"1997"}]}
This information will be queried immediately after the app loads. All further queries will be directed to the url defined in the url
attribute of the <rest-load>
directive.
<div ng-app="networkApp" ng-controller="networkCtrl">
<rest-load info-url="http://zel.irb.hr/matija/datainfo" url="http://zel.irb.hr/matija/data"></rest-load>
<aspect-selector></aspect-selector>
<force-layout></force-layout>
</div>