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

Small Tweaks #69

Merged
merged 199 commits into from
Mar 27, 2023
Merged

Small Tweaks #69

merged 199 commits into from
Mar 27, 2023

Conversation

sanbales
Copy link
Contributor

@sanbales sanbales commented Mar 21, 2023

References

Small miscellaneous tweaks, trying to address some of the issues in #63.

Code changes

  • Add hyperbolic functions (cosh, sinh, tanh) and an n-dimensional hypothenuse (hypot) to the templating engine.
  • Add tables and explanations to the Behaviors.ipynb for the jsMath functions available when using the Nunjucks template.
  • Add a check for Selection behaviors to show up before others, throws a warning if they are not first.
    • Add test
  • Preserve LinkShape.curvature and LinkShape.line_dash between selected and unselected links by default, e.g., set LinkSelection.selected_curvature = None and update the ts to behave appropriately.
  • Fix label for link arrows and link particles controls in Behaviors.ipynb (part of Documentation items for 0.3.2 #63)
  • Improve Shapes.ipynb
  • Adding --fix flag to ruff to fix python code, e.g., auto-sort imports as isort used to do

User-facing changes

  • adds more mathematical functions available when using the Nunjucks template (cosh, sinh, tanh, and hypot)
    • adds better explanation for the functions and constants in the Behaviors notebook
  • adds a warning if node or link behaviors are included in an order that can cause unexpected issues
  • adds automatic UI controls for NodeShapes in the Shapes and Behaviors notebooks
    image

Backwards-incompatible changes

No backwards incompatible changes.

Santiago Balestrini and others added 30 commits February 21, 2023 15:03
…es, and added a general DynamicWidgetTrait
@sanbales
Copy link
Contributor Author

Adding some hacky controls for NodeShapes, but still needs more work

image

@sanbales
Copy link
Contributor Author

Adding some hacky controls for NodeShapes, but still needs more work

Fixed in eec4fb2

@sanbales sanbales added this to the 0.3.2 milestone Mar 25, 2023
@sanbales sanbales linked an issue Mar 25, 2023 that may be closed by this pull request
18 tasks
@sanbales sanbales mentioned this pull request Mar 27, 2023
18 tasks
@nrbgt
Copy link
Contributor

nrbgt commented Mar 27, 2023

The extended templating content is good, but long, and buried.

Maybe we move it to one of:

  • a dedicated notebook, with in-links from various places
    • and/or include this content in the docs
    • potentially with a more full demo, not attached to a renderer
  • a dedicated .md, so that it is searchable within the docs
  • in-line in the docstring of the python Nunjucks class itself
  • in-line in the text of the TypeScript class and start building typescript

Each of the above have various drawbacks from a maintenance perspective, of course.

"""Ensure behaviors are not unwittingly being put in the wrong order."""
behaviors: Tuple[Behavior, ...] = proposal.value

# TODO: Investigate making ordering a Behavior class variable
Copy link
Contributor

Choose a reason for hiding this comment

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

yerp, rather than adding this business, would see adding a rank to the behaviors, which get sorted (ha) out on the frontend, with some sensible defaults... warnings and complex validation methods can still get swallowed when things are done "live,"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made an issue #76, unless we want to fix it in this PR

@nrbgt
Copy link
Contributor

nrbgt commented Mar 27, 2023

Local tests and docs look fine: leave it up to @sanbales if we want to handle the template docs "debt" and/or complexity debt of the behavior order on this PR or on a follow-up... as this doesn't map to something directly shippable, no reason not to do it here, would be my feeling.

Copy link
Contributor

@nrbgt nrbgt left a comment

Choose a reason for hiding this comment

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

Looks fine, aside from the called-out docs and rank choices.

@sanbales sanbales mentioned this pull request Mar 27, 2023
@sanbales
Copy link
Contributor Author

The extended templating content is good, but long, and buried.

Maybe we move it to one of:

* a dedicated notebook, with in-links from various places
  
  * and/or include this content in the docs
  * potentially with a more full demo, _not_ attached to a renderer

* a dedicated `.md`, so that it is searchable within the docs

* in-line in the docstring of the python `Nunjucks` class itself

* in-line in the text of the TypeScript class and start building typescript

Each of the above have various drawbacks from a maintenance perspective, of course.

I can see all of these being useful, if I had to chose one, I'd say we have a dedicated notebook with good explanations, and have it rendered in the docs as a reference html in case (for whatever reason) folks don't/can't run lite, effectively producing that .md. Not sure if nbsphinx is a good idea or not, so I'd defer to y'all on this.

I did add more docs to the Nunjucks class, but those super long (e.g., numpy DOCSTRINGs) can be a bit of a pain if they are just a bunch of different long examples... It's great to have 2 or 3 pithy examples in the DOCSTRING that span the range of possibilities.

@sanbales
Copy link
Contributor Author

The extended templating content is good, but long, and buried.

Maybe we move it to one of:

* a dedicated notebook, with in-links from various places
  
  * and/or include this content in the docs
  * potentially with a more full demo, _not_ attached to a renderer

* a dedicated `.md`, so that it is searchable within the docs

* in-line in the docstring of the python `Nunjucks` class itself

* in-line in the text of the TypeScript class and start building typescript

Each of the above have various drawbacks from a maintenance perspective, of course.

Created an issue to track this.

nrbgt pushed a commit to nrbgt/ipyforcegraph that referenced this pull request May 11, 2023
Small miscellaneous tweaks, trying to address some of the issues in jupyrdf#63.

- Adds hyperbolic functions (`cosh`, `sinh`, `tanh`) and an n-dimensional hypothenuse (`hypot`) to the templating engine.
- Adds tables and explanations to the `Behaviors.ipynb` for the `jsMath` functions available when using the `Nunjucks` template.
- Adds a check for `Selection` behaviors to show up before others, throws a warning if they are not first, includes test for it.
- Preserves `LinkShape.curvature` and `LinkShape.line_dash` between `selected` and `unselected` `links` by default, e.g., set `LinkSelection.selected_curvature = None` and update the `ts` to behave appropriately.
- Fixes label for `link arrows` and `link particles` controls in `Behaviors.ipynb` (part of  jupyrdf#63)
- Improves `Shapes.ipynb` by adding color scales and finishing the demo controls (part of jupyrdf#63)
- Adds `--fix` flag to `ruff` to fix `python` code, e.g., auto-sort imports as `isort` used to do

- adds more mathematical functions available when using the `Nunjucks` template (`cosh`, `sinh`, `tanh`, and `hypot`)
  - adds better explanation for the functions and constants in the `Behaviors` notebook
- adds a warning if `node` or `link` behaviors are included in an order that can cause unexpected issues
- adds automatic UI controls for `NodeShapes` in the `Shapes` and `Behaviors` notebooks

No backwards incompatible changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Documentation items for 0.3.2
2 participants