Git Product home page Git Product logo

Comments (1)

davidskalinder avatar davidskalinder commented on August 9, 2024

I just ran into this. It looks like the bug was introduced at d88b167 by this line, which calls unfocus() at the top of the function in an attempt to make sure that the new focus() functionality doesn't mess things up; but unfocus can't handle bare lists, so it throws an error.

I assume the fix is to put the unfocus() call inside the if conditions that immediately follow the current call and that handle the bare list functionality. But I don't understand focus() very well yet, so I'll hold back on submitting a PR that might cause some new problem.

In the meantime, I think the bug can be worked around fairly painlessly by using do.call() (or rlang::exec()) to pass the list to bind_graphs() elementwise.

Here's a reprex showing the workaround using the example from the docs and above:

library(tidygraph)
#> 
#> Attaching package: 'tidygraph'
#> The following object is masked from 'package:stats':
#> 
#>     filter
graph <- create_notable('bull')
new_graph <- create_notable('housex')
graphs <- list(graph, new_graph)
 
example_from_docs <- graph %>% tidygraph::bind_graphs(new_graph)
workaround <- do.call(bind_graphs, graphs)
igraph::identical_graphs(example_from_docs, workaround)
#> [1] TRUE

Created on 2024-05-20 with reprex v2.1.0

from tidygraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.