Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

96
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda