title: Cytoscape-cxtmenu.js : Displaying Menu commands based on condition
body: <p>I have an app using cytoscape version 3.15.2 and cxtmenu library version 3.1.1. I have a case where I want to add conditions on some edges based on a condition. I have a command called 'info', which I am applying on the menu's on all edges in the graph:</p>
  <pre><code>let edges = {
              menuRadius: 100, 
              selector: 'edge', 
              commands: [ ...
                  { // info command
                      .........              
                  }
              ]
          }
  </code></pre>
  <p>I have another command called &quot;expand&quot;, which I want to apply on edges which have a value true for the expand attribute on the edge. So for the edges that satisfy this condition, I want to have both the info and the expand command available. For this, I created another menu variable as follows</p>
  <pre><code>let expandEdges = {
              menuRadius: 100, 
              selector: 'edge[expand=true]', 
              commands: [ ...
                  { // info command
                      .........              
                  },
                  { // expand command
                      .........              
                  }
              ]
          }
  </code></pre>
  <p>When I use this implementation where I apply both the menu variables to the graph, I see the following on my graph.</p>
  <p><a href="https://i.stack.imgur.com/YfOCl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YfOCl.png" alt="enter image description here" /></a></p>
  <p>If you observe, the info and expand commands are overlapped by the info command I applied on all edges. Im not sure how to use selector conditions to apply commands to all edges and some commands based on conditions.</p>
  <p>I also wanted to know if I can use something like selector: 'edge[type.contains'expand']' (substring check) as a selector condition.</p>
  <p>Also, I've not been able to create a reproducible example as this is part of a very huge app. Sorry for that.</p>