-
Notifications
You must be signed in to change notification settings - Fork 3
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 Behaviors #57
Labels
Milestone
Comments
I think the NodeShapes(size=10, color="red") These would be ignored entirely in the presence of NodeShapes(Circle(size=10, color="red")) |
Yep, completely agree. |
sanbales
pushed a commit
that referenced
this issue
Mar 10, 2023
…egraph into gh-57-refactor-behaviors
Open
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>
sanbales
pushed a commit
that referenced
this issue
Mar 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Elevator Pitch
Refactor
Behaviors
to use the newColumn
andNunjuck
widgets, as developed in #54.Motivation
Design Ideas
Behavior.(column_name|template)
, favoring dedicated widget subclassesColumn
andNunjuck
.Nunjuck
templates, this will help makefalsey
python types evaluate tofalse
injs
NodeStyle
combinesNodeColors
andNodeSizes
LinkStyle
combinesLinkColors
andLinkWidths
LinkArrow
combinesLinkDirectionalArrowColor
,LinkDirectionalArrowLength
, andLinkDirectionalArrowRelPos
LinkParticles
combinesLinkDirectionalParticleColor
,LinkDirectionalParticleSpeed
,LinkDirectionalParticleWidth
, amdLinkDirectionalParticles
Forces
? It does not seem to be immediately relevant, but maybe there is a common way to think about them?python
API and put thestyle
related behaviors in their own submodule, e.g.,ipyforcegraph/behaviors/style/
where we would havenode.py
,link.py
, andshape.py
?The text was updated successfully, but these errors were encountered: