almende / chap-links-library

a web based visualization library for displaying graphs, networks, and timelines
http://almende.github.com/chap-links-library
Apache License 2.0
599 stars 167 forks source link

Add ng-hide or ng-show to DIV #343

Open eudennis opened 9 years ago

eudennis commented 9 years ago

How could I add AngularJS directives to DIV? I want to make a filter for all those divs inside timeline.

josdejong commented 9 years ago

You can put arbitrary HTML in the contents of an item. I don't think that putting angular directives inside items will work nicely (if it works at all).

Note that the successor of chap-links-library, vis.js, supports templates, maybe these address your use case? See this example: http://visjs.org/examples/timeline/27_templates.html

eudennis commented 9 years ago

I will take a look. My objective is to make filters to show/hide specific categories.

josdejong commented 9 years ago

My objective is to make filters to show/hide specific categories.

In that case you may find the DataSet and DataView of vis.js interesting: with a DataView you can put a filter on a DataSet. You can specify a filter function like function (item) {return item.category === selectedCategory}. Every time the selectedCategory is changed, you can just call dataView.refresh() and the connected Timeline will automatically update the view.

Docs: http://visjs.org/docs/dataset.html http://visjs.org/docs/dataview.html