clientIO / joint

A proven SVG-based JavaScript diagramming library powering exceptional UIs
https://jointjs.com
Mozilla Public License 2.0
4.45k stars 841 forks source link

fix(dia.Cell): remove setter from prototype in docs and types #2501

Closed MartinKanera closed 3 months ago

MartinKanera commented 3 months ago

Description

Remove the Cell.parent(id) setter from type definitions and documentation.

Motivation and Context

Cell.parent(id) method is not intended to be used as a way to embed cells. To eliminate the confusion it was decided to remove it from type definitions and documentation.

Related to #2107.

Migration guide

In case you were using the Cell.parent(cell) as a solution to embed cells, use the Cell.embed(cell) instead.

Example usage:

const parent = joint.shapes.standard.Rectangle();
const child = joint.shapes.standard.Rectangle();
parent.embed(child);
alexandernst commented 3 months ago

Isn't this missing https://github.com/clientIO/joint/blob/945b64b825e62d87b637f235df562aa841297831/src/dia/Cell.mjs#L317 ? I think that line (and the next one) should also be removed 🤔

MartinKanera commented 3 months ago

We still use Cell.parent setter internally, this PR only resolves the confusion with using it as a way to embed cells.