Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
Append canvas elements to a group

I want to group elements and when these elements are dragged over the rectangle(group) element, they move with each other How to implement such a feature? Is there a way to know whether an element is on top of that element and append it to it as a child or any other solution

const elements = [
  { // this is the rectangle which I want to append elements to it
    id: '1',
    type: 'group',
    data: {
      label: 'node 1',
    },
    position: { x: 250, y: 0 },
  },
  {
    id: '2',
    type: 'ec2',
    data: {
      label: 'node 2',
    },
    position: { x: 100, y: 100 },
  },
  {
    id: '3',
    type: 's3',
    data: {
      label: 'node 3',
    },
    position: { x: 80, y: 120 },
  }
];

enter image description here

Getting positions of elements enter image description here

P.S: I am using React.js & react-flow-library (If that could help)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!