フィルターのクリア

how to add new option to context menu of biograph viewer

1 回表示 (過去 30 日間)
Sadegh Salesi Mousaabadi
Sadegh Salesi Mousaabadi 2017 年 1 月 21 日
回答済み: Saurabh Gupta 2017 年 1 月 30 日
hello everybody,
I am going to draw a network using graphmaxflow function. A simple code could be:
cm = sparse([1 1 2 2 3 3 4 5],[2 3 4 5 4 5 6 6],... [2 3 3 1 1 1 2 3],6,6); bg2 = graphmaxflow(cm,1,6); h = biograph(cm); a=view(h)
if you run this code in Matlab a network will be drawn properly. what I am going to do next is to add an option to context menu of the viewer (i.e node type) that if the user does right-click on each node, this option appears and the user can set value for the same property (node type) in the node properties.
I tried to use addprop function but the matlab says "Undefined function 'addprop' for input arguments of type 'biograph.node'."
can anyone help?
thanks

回答 (1 件)

Saurabh Gupta
Saurabh Gupta 2017 年 1 月 30 日
The right-click context menu options for the Biograph Nodes is generated based on the methods defined for the node object. It seems unlikely that you will be able to add a custom option there.
You may be able to implement the option using NodeCallbackValue callback function for Biograph Nodes.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by