Skip to content

Conversation

@Geliogabalus
Copy link
Contributor

@Geliogabalus Geliogabalus commented Mar 18, 2025

Description

Adds new functionality to the Graph and Paper which allows to use layers for the embedding. The behaviour controlled by useLayersForEmbedding graph option.

Motivation and Context

Make possible to use layers for embedding.

@Geliogabalus Geliogabalus marked this pull request as draft March 18, 2025 16:17

this.enableCellLayers = opt.enableCellLayers || false;

this.defaultLayerName = 'cells';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should move this outside as class property


opt = opt || {};

this.enableCellLayers = opt.enableCellLayers || false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not seem to be used anywhere

this._unregisterLayer(layerView);
this.addLayer(layerName, layerView, { insertBefore });
if (!layer) {
throw new Error('dia.Paper: The layer view is not an instance of dia.LayerView.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the error is not exactly what the check does

},

// @deprecated
getLastCell: function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should accept layerName now and not be deprecated

}
this.transformGroup = vGroup;
paper.getLayerView(layerName).insertSortedNode(vGroup.node, options.z);
paper.getLayer(layerName).insertSortedNode(vGroup.node, options.z);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paper.geLayer() should stay paper.getLayerView() (same analogy to graph.findCellsInArea() and paper.findCellViewsInArea()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants