thomasp85 / particles

A particle simulation engine based on a port of d3-force
Other
119 stars 9 forks source link

Error in layout_fun(graph, circular = circular, ...) : unused argument (node.position = as_tibble(gr)) #6

Closed matthewhirschey closed 2 years ago

matthewhirschey commented 4 years ago

Tried running the code on your readme page verbatim, and received the following error:

Error in layout_fun(graph, circular = circular, ...) : unused argument (node.position = as_tibble(gr))

Am I missing something?

R version 3.6.1 (2019-07-05) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] forcats_0.4.0 stringr_1.4.0 dplyr_0.8.3 purrr_0.3.2 readr_1.3.1 tidyr_1.0.0
[7] tibble_2.1.3 tidyverse_1.2.1 particles_0.2.2 tidygraph_1.1.2 ggraph_2.0.0 ggplot2_3.2.1

matthewhirschey commented 4 years ago

First 4 lines of final code snippet appear to run OK; output:

A particle simulation:

Something with the evolve() function?

thomasp85 commented 4 years ago

This is due to changes in ggraph - I'll try to update the example soon

acpguedes commented 4 years ago

I got the same error with the example.

I'd like to know how to fix this example.

> graph %>% simulate(velocity_decay = 0.7, setup = predefined_genesis(x, y)) %>% 
+   wield(collision_force, radius = radius, n_iter = 2) %>% 
+   wield(x_force, x = 0, strength = 0.002) %>% 
+   wield(y_force, y = 0, strength = 0.002) %>% 
+   evolve(on_generation = graph_plot)
Error in layout_fun(graph, circular = circular, ...) : 
  unused argument (node.position = as_tibble(gr))
geotheory commented 3 years ago

Not sure if related but current example fails for me at:

> # Simulation
> graph %>% simulate(velocity_decay = 0.7, setup = predefined_genesis(x, y)) %>% 
+   wield(collision_force, radius = radius, n_iter = 2) %>% 
+   wield(x_force, x = 0, strength = 0.002) %>% 
+   wield(y_force, y = 0, strength = 0.002) %>% 
+   evolve(on_generation = graph_plot)
Error in layout_fun(graph, circular = circular, ...) : 
  unused argument (node.position = list(c(-0.140244286198749, -0.333972291435804, -0.47272740571134, -0.38480765751644, 0.00892731450307476, -0.193631196501553, 0.00818842005268861, 0.401139845859188, 0.206757433926555, -0.117478096792761, 0.139375453241808, 0.104019234130303, -0.102362960908636, 0.185048733375692, -0.339000154127099, 0.436239277570203, 0.0149661314021651, -0.424159291616628, -0.462826350459047, -0.274484931230934, 0.0194704084698602, -0.290297966959888, -0.0603208793384318, 0.515813095366633, 
0.0289659927971853, -0.426283012265832, 0.170689695443546, -0.253475720366854, -0.557491592643684, 0.0191565541133999, -0.147464907484379, 0.353437405243735, -0.261520322404505, -0.29914034534995, -0.539636129166233, -0.201806293550186, -0.665661886610058, 0.270118147609173, -0.0144815312574424, 0.277709475202646, 0.204767869236453, 0.535577758114605, -0.594849181423575, -0.609695134640073, -0.139322749843414, 0.23669299336305, -0.0653531650518167, 0.196605134993573, 0.4

I'm running particles version 0.2.2 on R freaky bunnies, macOS 11.0.1.