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

Add layout render #107

Open
wants to merge 54 commits into
base: develop
Choose a base branch
from
Open

Add layout render #107

wants to merge 54 commits into from

Conversation

luciansmith
Copy link
Contributor

No description provided.

(Most of it isn't used yet, but at least it's stored.)
Uncomment now-implemented functions; allow general 'layout' setting.
Drop 'locked' option for autolayout (handle this automatically)
Allow general layout 'style'.
Add font setting
Alignments can (eventually) only have a single fixed node in them, and after they're run, those nodes then count as 'fixed'.
Needs more defaults, but works with SBMLNetwork's base defaults.
Also, update to SBMLNetwork's latest API.
Also also, don't worry about individual lines, with their start/end/midpoints.
@luciansmith luciansmith reopened this Aug 16, 2024
(We need it for SBMLNetwork)
Sprintf has been getting warnings for years; replace with stringstreams.
The "{" and "}" characters are actually already unique; I don't need to also check for the preceeding "\".
signed/unsigned issues; double/int issues.  Fixing the latter now acutally allows defining algebraic rules with doubles, not just ints.
* It's now 'layout' that's on/off, not 'autolayout'.
* X and Y are now set properly instead of to NaN.
* More often export size if height or width is different.
* Check valid color values.
* Allow different capitalizations of layout keywords.
* Better handling of NaNs (ignore them more often)
* Convert colors back to HTML names if necessary.
* Check unset elements better.
Mostly better handling of group defaults.
Use new 'autorender' so we don't call autolayout twice.
Both have memory leak updates, and SBMLNetwork has efficiency updates.
The default is now changed in SBMLNetwork, so we need to set it explicitly here so we don't re-call the autolayout algorithm all the time.

Also, clear out some unused comments.
The functions now allow you to deal with alias nodes.  This is a first pass at that, that doesn't actually deal with alias nodes in the slightest, but at least continues to compile with the new version of the library.
* Parse strings with less copy/paste of bison code.
* Fix error typo.
* Disallow negative sizes.
* Turn on layout with fewer cues.
* Add layout/render tests.
(Still need to be able to set non-0 indexes.)
Most updates focused on getting control points working.  Now a typical round-tripped layout Antimony file might look like:

J0.S1.rxn = {58.75, 90}
J0.S1.position = {64.2, 38.8}
J0.S1.b1 = {54.96, 65.29}
J0.S1.b2 = {46.91, 83.67}
J0.S1.arc2.rxn = {58.75, 90}
J0.S1.arc2.position = {83.97, 43.81}
J0.S1.arc2.b1 = {54.96, 65.29}
J0.S1.arc2.b2 = {77.76, 91.5}
J0.S2.rxn = {58.75, 90}
J0.S2.position = {61.75, 119.15}
J0.S2.b1 = {62.54, 114.71}
J0.S2.b2 = {64.37, 76.12}

Also, fixed functions like 'setSpeciesReferenceCurveSegmentEndPointX', since many of the old versions didn't work.  It's now also much simpler to get the speciesIndex in the first place.
With fixes to those libraries, things seem to...work?
* Uncomment tests that now work.
* Add new tests for control points.
* Don't set reaction side of reaction arcs when species side isn't set.
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.

1 participant