GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — FixedPoints Story: the edge are connected on a rectangle perimeter instead on the connection constraints of the vertex · Issue #840 · maxGraph/maxGraph

FixedPoints Story: the edge are connected on a rectangle perimeter instead on the connection constraints of the vertex #840

New issue
Copy link
New issue
Copy link
Closed
Bug
#1026
Closed
FixedPoints Story: the edge are connected on a rectangle perimeter instead on the connection constraints of the vertex#840
Bug
#1026
Copy link
Assignees
LOUISNOYEZ
Milestone
0.24.0

Description

@tbouffard
tbouffard
opened on May 27, 2025
Issue body actions

Describe the bug

Here is what I see with maxGraph:

fixed_points_02_maxGraph.mp4

Expected behavior

The connection points should be on the perimeter of the vertex, as this was done in mxGraph

fixed_points_01_mxGraph_4.2.2.mp4

mxGraph resources:

  • source: https://github.com/jgraph/mxgraph/blob/v4.2.2/javascript/examples/fixedpoints.html
  • live example: https://jgraph.github.io/mxgraph/javascript/examples/fixedpoints.html

Environment

  • maxGraph version or commit: refactor: migrate the FixedPoints story to TypeScript #839
  • Desktop or mobile: desktop
  • OS and version: ubuntu 24.04
  • Browser and version: Firefox 138.0.4, Chrome 136.0.7103.113

Activity

  1. tbouffard
    added
    bugSomething isn't working
    triageIssue/PR under review for categorization
    on May 27, 2025
  2. tbouffard
    added a parent issue on May 27, 2025
    • Ensure that the stories work as the mxGraph examples #505
  3. tbouffard
    added the
    Bug
    issue type on May 27, 2025
  4. tbouffard
    removed
    bugSomething isn't working
    triageIssue/PR under review for categorization
    on May 27, 2025
  5. tbouffard
    changed the title [-][BUG] FixedPoints Story: the edge are connected on a rectangle perimeter instead on the connection constraints of the vertex[/-] [+]FixedPoints Story: the edge are connected on a rectangle perimeter instead on the connection constraints of the vertex[/+] on May 27, 2025
  6. LOUISNOYEZ commented on Mar 19, 2026

    @LOUISNOYEZ
    LOUISNOYEZ
    on Mar 19, 2026
    More actions

    I think I may have managed to fix the problem. Actually it's not related to the fixed point story specifically. The hand drawn connection is failing for all shapes with special perimeter. While investigating the issue, I came accross a mxGraph migration guide that talked about the "entryperimeter"/"exitperimeter" properties used when defining the style of edges when creating new ones via insertEdge for instance. It said that these properties had their type changed from 0 and 1 values (representing booleans) to actual booleans. Lo and behold what I found in the ConnectionMixin :

    maxGraph/packages/core/src/view/mixin/ConnectionsMixin.ts

    Lines 202 to 207 in 3848855

    // Only writes 0 since 1 is default
    if (!constraint.perimeter) {
    this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', '0', [edge]);
    } else {
    this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', null, [edge]);
    }

    The second argument of setCellStyles is supposed to be a boolean, but it's still attributed '0' or null. This is in the setConnectionContraint method of the mixin for the connection handler. I believe what's happening is that the connection handler silently drops the CellStateStyle linked to the projection of connection points on the perimeter.
    By replacing these lines with

     // Only writes 0 since 1 is default 
     if (!constraint.perimeter) { 
       this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', false, [edge]); 
     } else { 
       this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', true, [edge]); 
     } 

    Connection connect precisely to the point on the perimeter of edges which have either entry or exit perimeter set to true. The problem was only present on manual connections, since the Fixed Points story correctly declares them as boolean when programmatically creating new edges.
    I feel like type assertions are stiffled by the structure of setCellStyle.

  7. tbouffard commented on Mar 24, 2026

    @tbouffard
    tbouffard
    on Mar 24, 2026
    MemberAuthor
    More actions

    Nice catch, this is a great finding!

    When passing '0' to the properties which expect a boolean value, the properties are then always evaluated to true (because the string in not empty) whereas we would like the properties to be set to false.

  8. tbouffard
    assigned
    LOUISNOYEZ
    on Mar 24, 2026
  9. tbouffard
    added this to the 0.24.0 milestone on Mar 24, 2026
  10. redfish4ktc
    closed this as completedin #1026on Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @LOUISNOYEZ
    LOUISNOYEZ

Labels

No labels
No labels

Type

Bug

Projects

No projects

    Milestone

    • 0.24.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.