Coder Social home page Coder Social logo

fast_tree's People

Contributors

chase0213 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

fast_tree's Issues

fr: Implement BFS

Bug, feature request, or proposal:

feature request

What is the expected behavior?

subtree can be treated by block, providing nodes in breadth first search (bfs) order.

root = MODEL.find_root
root.subtree.bfs.each do |node|
  # do something
end

fr: Implement DFS

Bug, feature request, or proposal:

feature request

What is the expected behavior?

subtree can be treated by block, providing nodes in depth first search (dfs) order.

root = MODEL.find_root
root.subtree.dfs.each do |node|
  # do something
end

bug: parent created by add/create_parent method should only have appropriate children

Bug, feature request, or proposal:

bug

What is the expected behavior?

add_parent and create_parent should create a parent, and the parent include only given children.

What is the current behavior?

A parent created by this method includes nodes which are not given as an argument:
so far, the area is calculated by the following codes:

left  = children.max {|c| c.l_ptr}.l_ptr
right = children.min {|c| c.r_ptr}.r_ptr

What is the use-case or motivation for changing an existing behavior?

A has B, C and D as children (,and they are stored in this order in DB).
When B and D will have a new parent E, E can't help including C due to the current implementation.

Which versions of gem, ruby, rails or middlewares are affected?

any

Is there anything else we should know?

no

fr: implement several boolean methods

Bug, feature request, or proposal:

feature request

What is the expected behavior?

The following boolean methods are available:

  • root?
  • leaf?
  • has_children?

fr: parent/children methods

Bug, feature request, or proposal:

feature request

What is the expected behavior?

To get direct parent and children by:

@node.parent
# => parent node of @node

@node.children
# => child nodes of @node as ActiveRelation

bug: copy/move methods may destroy tree

Bug, feature request, or proposal:

bug

What is the expected behavior?

after copy/move, the tree should have correct structure as tree, that is,
all the left and right pointers have unique values each.

What is the current behavior?

after copy/move multi-layered subtree, the tree seems to be destroyed

What are the steps to reproduce?

FILL ME LATER

Which versions of gem, ruby, rails or middlewares are affected?

fast_tree v0.2.0

Is there anything else we should know?

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.