-
Notifications
You must be signed in to change notification settings - Fork 420
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
feat(canvas): allow creating planes from descriptors #599
Conversation
As discussed, we will change the API like this:
Potentially Breaking Changes
Other potential improvements |
- add rootElement on createPlane - remove rootElement on removePlane, but keep rootElement as part of planeDescriptor
db76a1e
to
f4aa05b
Compare
Ready for review. I only adjusted with non-breaking changes and kept the general API for now. An example of how it is used is implemented here: https://github.com/bpmn-io/bpmn-js/pull/1538/files#diff-72a5e1f4e48dd45f7e30a07fb4234e5978d62f9ac15fb2d716b1348d0503e758R37-R58 |
children: [], | ||
isImplicit: true | ||
}; | ||
} | ||
|
||
var svgLayer = this.getLayer(name, PLANE_LAYER_INDEX); | ||
svgAttr(svgLayer, 'display', 'none'); | ||
this._addRoot(plane.rootElement, plane); |
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.
I like this very much, as if we're already transitioning to #600. 😉 ❤️
} | ||
|
||
if (typeof plane === 'string') { | ||
plane = { name: plane }; |
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.
Could simplify this to:
if (typeof plane === 'string') {
plane = { name: plane, rootElement: rootElement };
}
rootElement = { | ||
id: '__implicitroot' + name, | ||
if (!plane.rootElement) { | ||
plane.rootElement = rootElement || { |
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.
Could simplfy this to:
plane.rootElement = { ... }
If we do ⬆️
supersedes #598