Giter Site home page Giter Site logo

remove waypoint function about matrx HOT 3 CLOSED

BirgitvdS avatar BirgitvdS commented on August 14, 2024
remove waypoint function

from matrx.

Comments (3)

thaije avatar thaije commented on August 14, 2024

@BirgitvdS thanks for letting it now that this is a feature you would like to see. I don't doubt that other users would also like an easy manner to remove waypoints, but I'm not sure on the details of how it should work such that that it works for everyone as intended.

The method I would think of would be something like:

self.navigator.remove_waypoint(location=(3,4)) # removes waypoint (3,4) from the waypoints list and restarts the navigator

However, if the waypoint you want to remove is present multiple times in the waypoints list, should they all be removed, or only the first or last?

from matrx.

BirgitvdS avatar BirgitvdS commented on August 14, 2024

My suggestion would be something like this:
self.navigator.remove_waypoint(location=(3,4), n= all)
in which "location" is the location of the waypoint and "n" is which waypoints you want to remove
Options could be:
n = all --> remove all waypoints with that location from the list
n = first --> remove first waypoints with that location from the list (if location is not specified, just remove first waypoint in the list)
n = last --> remove last waypoints with that location from the list (if location is not specified, just remove last waypoint in the list)
n = int --> in which int is an interger that specified which waypoint should be removed. For example if n= 5 than either "remove 5th waypoint which location X" or "remove 5th waypoint of the list" (in case no location in specified)
This way the user can use the remove function and specify what to remove.
Would this be possible?

from matrx.

thaije avatar thaije commented on August 14, 2024

Hey Birgit, although the solution you described would be useful, it is also quiet complicated with a lot of options, with minimal improvement over the two methods you described yourself. Instead of making a generic function with a lot of options which users most likely will not able to find anyway, it is better to make it easy to change the waypoints and reset the navigator. This is already the case, and the two alternatives you described seem sufficiently easy to use (possibly wrapped in your own remove_waypoint(navigator, waypoint) function) and easy to customize to suit a users' needs, such that an additional function is not necessary in my opinion.

from matrx.

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.