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

135
Views
Detect if a node when dropped/moved intersects another node - mxgraph

I am trying to detect if any part of cell node intersects with another cell when u move a cell and some of its body intersects with another node. I tried to write my own custom mouseUp function such that if the there's some intersection, I'll display an error saying that its allowed. Below is the code i wrote. It doesn't work perfectly. one time when it works well is if I put a node on the center on another node but other times when I put a node on the far edge of another node it doesn't work.

const mouseUp = graph.graphHandler.mouseUp;
graph.graphHandler.mouseUp = function(...args) {
      const target = graph.getCellAt(args[1].graphX, args[1].graphY);
      if (target) {
        alert('not allowed');
        graph.graphHandler.reset();
      } else {
        mouseUp.apply(this, args);
      }
    };
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!