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

Refactor logic for scaling nodes #32

Open
d2fong opened this issue Mar 1, 2017 · 1 comment
Open

Refactor logic for scaling nodes #32

d2fong opened this issue Mar 1, 2017 · 1 comment
Milestone

Comments

@d2fong
Copy link
Member

d2fong commented Mar 1, 2017

Nodes are scaled based on whether they are a multimer, or have state/infos. Ideally these should act as functional transforms on the shape arguments instead of a sequence of if statements.

Cases that also need to be handled:

  • scale size based on the number of state/infos
@d2fong
Copy link
Member Author

d2fong commented Jun 14, 2017

Determine node width deterministically without using / reading / setting node.width()

Create a function in element.js:dimensions, that does the following:
w0 = Compute sum total width of all state vars based on length of each label
w1 = Computer sum total width of all units of information based on length of each label
wN = width of node = max(w0, w1)

This function will be used to deterministically compute how wide the node needs to be to accommodate each state var / unit of information and will set the node width before drawing any aux items.

Once width is set, draw each aux item without worrying about width overflow

@d2fong d2fong added this to the 2.1 milestone Jun 14, 2017
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

No branches or pull requests

1 participant