Coder Social home page Coder Social logo

Comments (10)

sfcheung avatar sfcheung commented on August 25, 2024

I will draft a function in the branch match_node_names to address this issue.

from semptools.

sfcheung avatar sfcheung commented on August 25, 2024

I will draft a function in the branch match_node_names to address this issue.

We decided not addressing this issue by matching node names. Instead, another function for changing node names will be written.

from semptools.

sfcheung avatar sfcheung commented on August 25, 2024

I will draft a function in the branch match_node_names to address this issue.

We decided not addressing this issue by matching node names. Instead, another function for changing node names will be written.

I will draft the function in this branch:
change_node_labels

from semptools.

marklhc avatar marklhc commented on August 25, 2024

I added an experimental function change_node_label2(), which takes a named list as input, but then I found out your suggestion in #53. The function is not currently exported.

from semptools.

marklhc avatar marklhc commented on August 25, 2024

A bug has now been identified as set_curve() and set_edge_label_position() give an error when applying to objects returned by change_node_label(). Still need more investigation, but most likely due to these functions not using the names of the named vector returned. @sfcheung do you think we should change all functions to allow them use the names of the named vector/list for the labels if they could not find a match?

from semptools.

sfcheung avatar sfcheung commented on August 25, 2024

I added an experimental function change_node_label2(), which takes a named list as input, but then I found out your suggestion in #53. The function is not currently exported.

I drafted this function to_list_of_lists in the branch change_node_labels to make it easier to specify the elements to be changed by supplying a named vector, rather a list of lists. We could have used this approach for all relevant functions but it is too late to rewrite them now. There may also be situations in which named vector will not work. Therefore, we can revise relevant functions such that, if they detected the input is a named vector rather than a list of lists, they will be converted to a list of lists internally. Then all previous examples will still work while users have two options to specify the nodes or paths to be changed.

P.S.: I forgot which branch is the active branch that we should work on. Given that change_node_labels involves an urgent issue to handle, I drafted that function there.

from semptools.

sfcheung avatar sfcheung commented on August 25, 2024

A bug has now been identified as set_curve() and set_edge_label_position() give an error when applying to objects returned by change_node_label(). Still need more investigation, but most likely due to these functions not using the names of the named vector returned. @sfcheung do you think we should change all functions to allow them use the names of the named vector/list for the labels if they could not find a match?

Agree, @marklhc . I will revise related functions in the branch change_node_labels.

from semptools.

sfcheung avatar sfcheung commented on August 25, 2024

A bug has now been identified as set_curve() and set_edge_label_position() give an error when applying to objects returned by change_node_label(). Still need more investigation, but most likely due to these functions not using the names of the named vector returned. @sfcheung do you think we should change all functions to allow them use the names of the named vector/list for the labels if they could not find a match?

@marklhc, I revised edge_index(), which is used by set_curve() and set_edge_label_position(), following your advice on using the names of the named vector (...$graphAttributes$Nodes$names) if no match was found. This should solve the bug you found (the tests in test-change-node have been passed). I will check which other functions need to be revised similarly (I created #58 to keep track of this task).

from semptools.

sfcheung avatar sfcheung commented on August 25, 2024

I added an experimental function change_node_label2(), which takes a named list as input, but then I found out your suggestion in #53. The function is not currently exported.

I revised change_node_label() based on change_node_label2(), adopted your approach in finding a match and allowing for using a named list (rather than a list of lists).

from semptools.

sfcheung avatar sfcheung commented on August 25, 2024

I am closing this issue because it should be been fixed when addressing other issues. The brnach https://github.com/sfcheung/semptools/tree/change_node_labels up to 2fb1d0b passed all tests. The remaining tasks are addressed in #58. If necessary, we can reopen this issue later.

from semptools.

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.