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

UI for Behaviors #61

Open
sanbales opened this issue Mar 10, 2023 · 0 comments
Open

UI for Behaviors #61

sanbales opened this issue Mar 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@sanbales
Copy link
Contributor

Elevator Pitch

  • Look into having a basic UI generator for controlling behaviors.

Motivation

Design Ideas

  • Give it a graph and let it make the UI controls from there by inspecting the behaviors associated with the ForceGraph.
@sanbales sanbales added the enhancement New feature or request label Mar 10, 2023
sanbales pushed a commit that referenced this issue Mar 10, 2023
sanbales added a commit that referenced this issue Mar 14, 2023
## References

- Implements gh-57 (by completing the implementation from gh-43)

## Code changes

- [x] combine behaviors based on their functionality
- [x] refactor behaviors to use the new `Column` and `Nunjucks` dynamic features, this includes:
  - [x] base `Behavior` model (or make new intermediary `Behavior` that accepts dynamic features)
  - [x] `node` shape (`color` and `size`)
  - [x] `link` shape (`color`, `width`, and 
    - [x] separately `arrows`
  - [x] `particles`
  - [x] `tooltips` for both `node` and `link` (formerly known as `labels`)
  - [x] all `forces`
    - [x] x
    - [x] y
    - [x] z
    - [x] link
    - [x] collision
    - [x] manybody
    - [x] center
    - [x] cluster
    - [x] dag  
- [x] `selection` 
  - [x] `node`  
    - [x] use row index instead of `id`
  - [x] `link`
  - [x] add optional `column_name`
- [x] recorders
  - [x] `image`
  - [x] `data`  
    - > this cannot reliably capture custom `*Selection.column_name` data, but can be combined with `.selected` indices
- [x] update notebooks
  - [x] `Behavior.ipynb`
  - [x] `Forces.ipynb`
  - [x] `Test_Forces.ipynb`
  - [x] `WidgetSource.ipynb`
- [x] update docs
- [x] update tests
- [x] fix line ending issues in `Windows` 🪟 to avoid inadvertently committing CRLF files to the repo
  - added a `fix-windows-line-endings` task to avoid inadvertently committing `CRLF` files, uses `dos2unix`
  - ~~also added `newline="\n"` to the `.write_text` calls but it does not seem to be sufficient~~
    - > not compatible with our oldest supported python
- [x] use a simpler and more consistent UI for the `DynamicModel` fields
  - e.g., added an auto-generated UI for traits created with `_make_trait` in `Utils.ipynb`, a better implementation for this is being explored in [gh-61-ui-for-behaviors](https://github.com/jupyrdf/ipyforcegraph/tree/gh-61-ui-for-behaviors)
- [x] add check for stderr outputs in notebook smoke test
  - [x] add `lxml` to utest env
- [x] move more widgets/hastraits that are never instantiated directly to `base`
  - [x] `Has*` for shapes, etc.

## User-facing changes

- Users now have a more compact and consistent API for the `behaviors`, the controls for these may also be more intuitive as we could use a single `Combobox` to specify a `Nunjucks` template, a `Column` name, or a literal value
- It is easier for users to integrate `ipyforcegraph` with other widgets as the interactions between behaviors is more predictable and tractable

<!-- For visual changes, include before and after screenshots here. -->

## Backwards-incompatible changes

- Following classes are no longer available:
  - ``behaviors.node.NodeSizes``
  - ``behaviors.node.NodeColors``
  - ``behaviors.link.LinkColors``
  - ``behaviors.link.LinkWidths``
  - ``behaviors.link.LinkColors``
  - ``behaviors.link.LinkDirectionalArrowColor``
  - ``behaviors.link.LinkDirectionalArrowLength``
  - ``behaviors.link.LinkDirectionalArrowRelPos``
  - ``behaviors.link.LinkDirectionalParticleColor``
  - ``behaviors.link.LinkDirectionalParticleWidth``
  - ``behaviors.link.LinkDirectionalParticleSpeed``
  - ``behaviors.link.LinkDirectionalParticles``

- Behaviors are grouped by functionality, not what they operate on, e.g., `NodeSelection` is no longer under ``behaviors.node`` but under ``behaviors.selection``.

---------

Co-authored-by: Santiago Balestrini <santiago.balestrini@gtri.gatech.edu>
Co-authored-by: Nicholas Bollweg <nicholas.bollweg@gtri.gatech.edu>
This was referenced Mar 27, 2023
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
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant