Awesome Nested Set
mudderjs
Awesome Nested Set | mudderjs | |
---|---|---|
2 | 1 | |
2,379 | 111 | |
0.2% | - | |
5.5 | 0.0 | |
about 2 months ago | over 1 year ago | |
Ruby | JavaScript | |
MIT License | The Unlicense |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Awesome Nested Set
-
Active record: how to recursively load children of children of children in one query?
Another option is to use something like AwesomeNestedSet which does basically the same thing as the previous suggestion but with a whole lot more flexibility (and likely more reliably performant).
-
The surprisingly difficult problem of user-defined order in SQL
Ex https://github.com/collectiveidea/awesome_nested_set
mudderjs
-
The surprisingly difficult problem of user-defined order in SQL
I have solved this problem for my own purposes — no claims of grand scalability or high efficiency — by storing indices or "ranks" of items as strings (Postgres TEXT) using a library called mudderjs[0] and a thin wrapper around it[1]. Sorted lexicographically (in dictionary order) arbitrary-length strings have arbitrary precision. You can always find a string between any two strings; for instance, between "a" and "b" is "am" and between "a" and "ab" is "aam". You do have to have the entire ordered collection in scope to generate a new rank for an item, but reordering an item only requires updating one row and isn't subject to floating point precision.
[0] https://github.com/fasiha/mudderjs
[1] https://github.com/pubpub/pubpub/blob/master/utils/rank.ts
What are some alternatives?
Ancestry - Organise ActiveRecord model into a tree structure
StringDistances.jl - String Distances in Julia
Closure Tree - Easily and efficiently make your ActiveRecord models support hierarchies
radbag-wallet - Radbag Wallet Github Repository
ActsAsTree - ActsAsTree -- Extends ActiveRecord to add simple support for organizing items into parent–children relationships.
raddish-wallet - Radbag Wallet Github Repository [Moved to: https://github.com/ZeroPointThree17/radbag-wallet]
Mongoid Tree - A tree structure for Mongoid documents using the materialized path pattern
query-string - Parse and stringify URL query strings
rails_or - Cleaner syntax for writing OR Query in Rails 5, 6. And also add #or support to Rails 3 and 4.
EsoMath.js - Esoteric Mathematic Library for Javascript (past names: more-math-for-JS, mostly_math, NTML.js)
LeftJoins - Backport left_joins method from Rails 5 for Rails 3 and 4
radix-component-library - Sample component library built with Radix UI