Skip to content
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

Element API Overhaul #88

Merged
merged 40 commits into from
Apr 21, 2021
Merged

Element API Overhaul #88

merged 40 commits into from
Apr 21, 2021

Conversation

dfreeman06
Copy link
Contributor

Work In Progress
Goal is to try and streamline some of the api and schema for building diagrams.

Dane Freeman added 30 commits January 20, 2021 12:59
@sanbales
Copy link

Very much looking forward to this next release!

Copy link

@sanbales sanbales left a comment

Choose a reason for hiding this comment

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

Some small pedantic suggestions...

py_src/ipyelk/app.py Show resolved Hide resolved
py_src/ipyelk/diagram/elk_model.py Show resolved Hide resolved
py_src/ipyelk/elements/elements.py Outdated Show resolved Hide resolved
# TODO need ability to resize the min width based on label/child max width
for child in self.children:
child.layoutOptions = merge(
opt.OptionsWidget(
options=[
opt.NodeSizeConstraints(),
opt.NodeSizeMinimum(width=self.width, height=20),
opt.NodeSizeMinimum(width=int(self.width), height=20),

Choose a reason for hiding this comment

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

wonder if it would be worth it to add height as an attribute above...

Choose a reason for hiding this comment

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

Maybe width should be min_width and height added as an attribute called min_height?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a min_height but i think width is still cleaner. The intention is that this is width shared by all of the compartments. We might be able to set the width directly but then there is less feedback if the user "guessed" the wrong width (marks get rendered on top of each other instead of the compartment borders looking odd). There might be better ways to solve this in the future either with a dedicated "node:compartment" type (which has issues to being out of sync with how elkjs positioned the marks) or with multiple passes of layout calls to elkjs.


@classmethod
def make_defs(cls, symbols: List["Symbol"]) -> Dict[str, "Symbol"]:
"""Take a list of symbols and return the def dictionary

Choose a reason for hiding this comment

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

"""Take a list of symbols and return a dictionary with the symbol's identifier as the key ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworked into a separate SymbolSpec class

py_src/ipyelk/elements/symbol.py Outdated Show resolved Hide resolved
py_src/ipyelk/elements/symbol.py Outdated Show resolved Hide resolved
py_src/ipyelk/elements/symbol.py Outdated Show resolved Hide resolved
py_src/ipyelk/layouting/elkjs.py Outdated Show resolved Hide resolved
@dfreeman06 dfreeman06 linked an issue Apr 20, 2021 that may be closed by this pull request
7 tasks
@dfreeman06 dfreeman06 merged commit 688f7c1 into master Apr 21, 2021
@dfreeman06 dfreeman06 changed the title WIP Api overhaul Element API Overhaul Apr 21, 2021
This was linked to issues May 24, 2021
This was referenced May 24, 2021
@dfreeman06 dfreeman06 linked an issue May 24, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants