-
Notifications
You must be signed in to change notification settings - Fork 872
feat(layers): Graph and Paper embedding layers implementation #2908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -70,6 +71,17 @@ export const Graph = Model.extend({ | |||
|
|||
opt = opt || {}; | |||
|
|||
this.enableCellLayers = opt.enableCellLayers || false; | |||
|
|||
this.defaultLayerName = 'cells'; |
There was a problem hiding this comment.
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
@@ -70,6 +71,17 @@ export const Graph = Model.extend({ | |||
|
|||
opt = opt || {}; | |||
|
|||
this.enableCellLayers = opt.enableCellLayers || false; |
There was a problem hiding this comment.
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.'); |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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
@@ -117,7 +117,7 @@ export const HighlighterView = mvc.View.extend({ | |||
vGroup = V('g').addClass('highlight-transform').append(el); | |||
} | |||
this.transformGroup = vGroup; | |||
paper.getLayerView(layerName).insertSortedNode(vGroup.node, options.z); | |||
paper.getLayer(layerName).insertSortedNode(vGroup.node, options.z); |
There was a problem hiding this comment.
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()
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.