cytoscape / cytoscape.js-compound-drag-and-drop

Compound node drag-and-drop UI for adding and removing children
MIT License
33 stars 16 forks source link

[Question] Can we combine two compound nodes as a wrapper provided to them #24

Closed Abhishek-kumar09 closed 2 years ago

Abhishek-kumar09 commented 2 years ago

The compound nodes are the nodes that contains multiple cy-nodes under one box. Although we can do this with this library/extension, can we combine two compound nodes under one parent-coumpund node. The cytoscape js for that may look like: (p is a compund node containing other two compund nodes) image json:

  elements: {
    nodes: [
      { data: { id: 'a', parent: 'b' }, position: { x: 233, y: 85 } },
      { data: { id: 'c', parent: 'b' }, position: { x: 300, y: 85 } },
      { data: { id: 'd', parent: 'e' }, position: { x: 215, y: 175 } },
      { data: { id: 'f', parent: 'e' }, position: { x: 300, y: 175 } },
      { data: { id: 'b', parent: 'p' }},
      { data: { id: 'e', parent: 'p' } },
      { data: { id: 'p' } },
    ],
  },

Although we can do this thing when we have a cytoscape-json and rendering it on canvas. Can we acquire the same behaviour from the dragging the node on canvas, like we can do for two nodes now.

Abhishek-kumar09 commented 2 years ago

// @maxkfranz

stale[bot] commented 2 years ago

This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.

Abhishek-kumar09 commented 2 years ago

Answer hidden in caveats:

Compound nodes are supported by this extension only to depth 1.

leecalcote commented 2 years ago

@maxkfranz we could certainly put this type of functionality to use. I wonder if you might offer insight as to why this plugin explicitly doesn't support hierarchical compound nodes. Is this based on lack of time and expressed need or this is a technical hurdle that just isn't feasible within this plugin? If it's the former, do you welcome a PR with such an enhancement? Thanks much for your guidance.

maxkfranz commented 2 years ago

@maxkfranz we could certainly put this type of functionality to use. I wonder if you might offer insight as to why this plugin explicitly doesn't support hierarchical compound nodes. Is this based on lack of time and expressed need or this is a technical hurdle that just isn't feasible within this plugin? If it's the former, do you welcome a PR with such an enhancement? Thanks much for your guidance.

One level of depth is Pareto optimal. The UX for more levels of depth is more subtle, with more edge cases and overall complexity -- and applicable to fewer apps.

If you can make an intuitive UX for arbitrary levels of depth, you're welcome to make a PR.