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

Gh 28 force sim tuning #35

Merged
merged 80 commits into from
Feb 16, 2023
Merged

Gh 28 force sim tuning #35

merged 80 commits into from
Feb 16, 2023

Conversation

dfreeman06
Copy link
Collaborator

@dfreeman06 dfreeman06 commented Feb 6, 2023

References

Code changes

  • add GraphForcesBehavior
    • Adding d3 forces into forcegraph simulation.
      • center
      • collision
      • link
      • manybody
      • radial
      • x
      • y
      • z
      • clustering
    • add top-level simulation parameters
      • alpha_min
      • alpha_decay
      • velocity_decay
      • cooldown_ticks
      • warmup_ticks
  • fix extra rerenders
    • rename update to redraw to avoid Widget default convenience behavior
    • only trigger post-render with behavior changes
  • fix iframe CSS for widget dragging behavior
  • do much less work, per graph tick, when behaviors are not defined
  • update tests
  • update demos
    • add dataset picker with 10x-larger blocks example
    • forces
    • simplify index

User-facing changes

  • see Force.ipynb for examples.

Backwards-incompatible changes

  • no python-level regressions
  • typescript behaviors changed a fair amount (see redraw vs update)

@dfreeman06 dfreeman06 changed the title Gh 28 force sim tuning WIP Gh 28 force sim tuning Feb 6, 2023
@dfreeman06 dfreeman06 changed the title WIP Gh 28 force sim tuning Gh 28 force sim tuning Feb 16, 2023
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.

:shipit:

Copy link
Contributor

@sanbales sanbales left a comment

Choose a reason for hiding this comment

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

Just a pedantic code review, didn't find anything major, feel free to disregard.

src/ipyforcegraph/forces.py Outdated Show resolved Hide resolved
@W.register
class CenterForce(BaseD3Force):
"""The centering force translates nodes uniformly so that the mean position
of all nodes (center of mass if all nodes have equal weight) is at the given
Copy link
Contributor

Choose a reason for hiding this comment

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

How does the force know which parameter is the node weight?

If it's configurable, should we have a TODO to add that as a trait of the behavior?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the centering doesn't actually have mass/weight for the points as far as i know. the doc string is more of an aside to help understand what the force does.

src/ipyforcegraph/forces.py Outdated Show resolved Hide resolved
src/ipyforcegraph/sources/widget.py Outdated Show resolved Hide resolved
src/ipyforcegraph/forces.py Outdated Show resolved Hide resolved
@nrbgt nrbgt marked this pull request as ready for review February 16, 2023 18:12
@nrbgt
Copy link
Contributor

nrbgt commented Feb 16, 2023

@dfreeman06 have a look at the changes in 8cfa0c1... if that looks fine, let's :shipit:

Copy link
Contributor

@sanbales sanbales left a comment

Choose a reason for hiding this comment

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

Probably not worth doing another commit, just some minor inconsistencies and missing DOCSTRINGs.

src/ipyforcegraph/behaviors/_base.py Outdated Show resolved Hide resolved
src/ipyforcegraph/behaviors/forces.py Show resolved Hide resolved
src/ipyforcegraph/_base.py Outdated Show resolved Hide resolved
src/ipyforcegraph/graphs.py Show resolved Hide resolved
@dfreeman06 dfreeman06 merged commit e1419c8 into main Feb 16, 2023
@dfreeman06 dfreeman06 deleted the gh-28-force-sim-tuning branch February 24, 2023 21:23
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.

When NodeSelection.multiple is False, Deselecting a node is not possible Tunable d3 forceLayout
3 participants