Was reading through the documentation and didnt see this really mentioned.
Can jarchi create a collection of elements based on currently active view ?
I can filter based on $(selection) , but didnt see anything for activeview.
For what its worth, is $(selection) documented in the jarchi API ... I looked but couldnt find anything.
thinking something like $("view").this
Yes, the current selection will contain the current View. So:
(reopening on the same subject)
Context: My goal is to develop a script for impact analysis. Ideally I'd like to select 1 element in a view, and then the script will add the elements in the same view according to the model defined (relation & co) down to a level depth.
Testing with $(selection):
* if I select the current view tab and nothing else inside: the selection contains only the archimate-diagram-model as expected
* if I select one element in the model tree: the selection contains only the selected element as expected
* if I select one element inside the current view: the selection contains only the selected element. selection.first() returns this element
How do get a reference to the current view containing it? My understanding would be to use
selection.parents.filter("archimate-diagram-model"), and if it is not empty, it will be the current view.
using .parents() and not .parent() to go thru any container in the graph in case of the element being incorporated visually (eg: Grouping)
Is that right? Any caveat? Other (simpler) way to do it ? Thanks in advance
Indeed, missed it. Thanks