afiore / arboreal Goto Github PK
View Code? Open in Web Editor NEWJavascript tree-traversal and manipulation microlibrary
License: MIT License
Javascript tree-traversal and manipulation microlibrary
License: MIT License
I like to use arboreal within my code. Could I assume it is MIT license.
Thanks for the wonderful library.
Hi all,
It seems to me that the removing a node from the tree does not adjust the IDs of the nodes. This would be okay, if only adding a child to a node did not use length as a value for the ID of a new node being created.
E.G.
root with 3 children, (A,B,C)
ID A: 0/0
ID B: 0/1
ID C: 0/2
length:3
Calling B.remove() will leave the tree in this state
root with 2 children, (A,C)
ID A: 0/0
ID C: 0/2
length:2
Adding a new node D:
root with 3 children, (A,C,D)
ID A: 0/0
ID C: 0/2
ID D: 0/2
length:3
This results in element D disappearing from iterations over the tree.
Hello,
Arboreal crashes at loading at line 239 with IE 9.
It seems defineGetter isn't standard and shouldn't be used at all. I'll try to submit a pull request later, it doesn't seem hard to fix.
EDIT : done, I'll submit it later tonight (CET timezone).
Hi,
I am not sure it's really an issue with arboreal, as I am rather a noob in javascript. If this is the case, please tell me.
Anyway, I would like to play with arboreal on the console on node.js.
I installed the package as described by cloning this repo and then running nmp install.
However, when I want to load that from the console, I get:
var tmp = require("./lib/arboreal")
undefined
tmp
{ [Function: Arboreal] parse: [Function] }
var tree = new Arboreal();
ReferenceError: Arboreal is not defined
at repl:1:16
at REPLServer.self.eval (repl.js:111:21)
at rli.on.e (repl.js:260:20)
at REPLServer.self.eval (repl.js:118:5)
at Interface. (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:88:17)
at Interface._onLine (readline.js:199:10)
at Interface._line (readline.js:517:8)
at Interface._ttyWrite (readline.js:735:14)
at ReadStream.onkeypress (readline.js:98:10)
var tree = new tmp.Arboreal();
TypeError: undefined is not a function
at repl:1:12
at REPLServer.self.eval (repl.js:111:21)
at rli.on.e (repl.js:260:20)
at REPLServer.self.eval (repl.js:118:5)
at Interface. (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:88:17)
at Interface._onLine (readline.js:199:10)
at Interface._line (readline.js:517:8)
at Interface._ttyWrite (readline.js:735:14)
at ReadStream.onkeypress (readline.js:98:10)
And I can't reproduce the example.
Any pointer would be really appreciated!
Sam
please explain how in the world jasmine is supposed to work for this?
should it be running on node.js? i've wasted at least 5 hours trying to figure it out
In the last line o USAGE, in README.md, there is an error:
var tree = Arborel.parse(wikipediaJsCategory, 'subcategories');
Arborel misses an 'a'!
I have an error when loading arboreal.js (same error with built file, too):
I'm on a Mac with Chrome.
Uncaught TypeError: Cannot set property 'Arboreal' of undefined
Error is on line 247 of arboreal.js #fee6ba821 , with an anonymous function stacktrace going from 247 to 250 (and that's it).
Via Chrome's inspector:
if (typeof module !== 'undefined' && module.exports) {
module.exports = Arboreal;
} else {
this.Arboreal = Arboreal;
Uncaught TypeError: Cannot set property 'Arboreal' of undefined
}
Thanks.
Thanks for a nice tree library!
For our project, I've enhanced it with the following method that permits user code to specify a beginning node for a traverseDown operation. Only that node and its descendants are traversed.
Arboreal.prototype.traverseDownFrom = function (node,iterator) {
_traverse(node, iterator, _traverseDown);
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.