clientIO / clientIO/joint

gridSize option should accept function

Open
#1,425 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
5.4k
Forks
893
Avg merge
3d 3h
Merged PRs (30d)
26

Description

The constructor of joint.dia.Paper receives gridSize as one of it's parameters. If set, the paper will behave grid-like, letting me place elements only at the intersections of each vertical and horizontal line of the grid (instead of letting me freely position elements wherever I want).

This is exactly what I want for my elements, but not for my links. If I set the grid size option and then start dragging the end of a link around the paper, it will "jump" from "point" to "point" on the paper.

This is a cross-post from https://groups.google.com/g/jointjs/c/391JoaUh01Q

/cc @kumilingus

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the joint.dia.Paper constructor and trace how the gridSize option affects element placement and link-end dragging. Reproduce the reported behavior with a gridSize configured, then verify that elements still snap while link endpoints can be positioned independently. Done means the requested option accepts a function as described by the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.