Closed kumilingus closed 5 months ago
to fix layout-directed-graph tests do the following changes in joint-layout-directed-graph/test/index.js
:
graph = new joint.dia.Graph({}, { cellNamespace: joint.shapes });
- line 34joint.dia.Link
to joint.shapes.standard.Link
- line 69, 70, 112, 113, 163, 164, 203, 204
Description
Throws an exception when a new cell is to be created from JSON if a
type
does not refer to a constructor.This is to solve the recurring issue with
dia.ElementView: markup required
.dia.ElementView: markup required
error is thrown when a cell constructor is found, but the model defines nomarkup
.dia.Graph: Could not find cell constructor for type: 'MyElement'. Make sure to add the constructor to 'cellNamespace'.
is thrown when the graph can not find a constructor for given cell type (e.g. when callinggraph.fromJSON()
).Migration guide
The PR also removes the default
link
type from the abstract classdia.Link
to be aligned withdia.Element
class model.Before:
Now:
If you only work with models and don't intend to draw links or use a custom link view, you can add a type to the link.
In other scenarios, please create a custom link (
dia.Link.define('MyLink', /* ... */)
) or use built-in links such asstandard.Link
.