Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive setting for radial layout #250

Open
alexkoxsecurity opened this issue Nov 27, 2023 · 5 comments
Open

Interactive setting for radial layout #250

alexkoxsecurity opened this issue Nov 27, 2023 · 5 comments

Comments

@alexkoxsecurity
Copy link

I am aiming to achieve the desired layout while minimizing changes to nodes that have a defined position. I've applied all settings that appear to be related to fixed positions, using various combinations, but the layout still does not correspond to the position field. In this example, I used random positions just to observe any changes, but the layout remains unchanged.

const graph = {
    id: 'root',
    layoutOptions: {
      'elk.algorithm': 'radial',
   
    
      'elk.interactive': 'true',
      'elk.interactiveLayout': 'true',
      'cycleBreaking.strategy': 'INTERACTIVE',
      'layering.strategy': 'INTERACTIVE',
      'elk.layered.layering.strategy': 'INTERACTIVE',
      'elk.alg.layered.options.LayeringStrategy': 'INTERACTIVE',
      'elk.layered.crossingMinimization.strategy': 'INTERACTIVE',
      'elk.layered.crossingMinimization.semiInteractive': 'true',
     
     
    },
    children: nodes.map(n => ({
      id: n.id,
      width: 60,
      height: 60,

      layoutOptions: {
        'elk.position': `(${Math.ceil(Math.random() * 1000)},${Math.ceil(
          Math.random() * 1000,
        )})`,
      },
    })),
    edges: edges.map(e => ({
      id: e.id,
      sources: [e.source],
      targets: [e.target],
    })),
  }; 
@soerendomroes
Copy link
Member

Interactive layout does not work for the radial algorithm. Similarly the following options:

      'elk.interactive': 'true',
      'elk.interactiveLayout': 'true',
      'cycleBreaking.strategy': 'INTERACTIVE',
      'layering.strategy': 'INTERACTIVE',
      'elk.layered.layering.strategy': 'INTERACTIVE',
      'elk.alg.layered.options.LayeringStrategy': 'INTERACTIVE',
      'elk.layered.crossingMinimization.strategy': 'INTERACTIVE',
      'elk.layered.crossingMinimization.semiInteractive': 'true',

only work for the layered algorithm. You can find all radial options here.

@alexkoxsecurity
Copy link
Author

@soerendomroes Thanks. As I understood there is no way to define desired place for specific node on the circle?

@soerendomroes
Copy link
Member

@Eddykasp do you know whether this works? To my understanding the order is determined by the order in the model.

@alexkoxsecurity
Copy link
Author

I can change the order by using sorter and orderId fields, but I would like also to have some of the nodes always above / under / on the right or left sides of the root node

@Eddykasp
Copy link
Collaborator

I don't think that's currently possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants