GithubHelp home page GithubHelp logo

Odd behavior about avy HOT 3 CLOSED

abo-abo avatar abo-abo commented on July 22, 2024
Odd behavior

from avy.

Comments (3)

abo-abo avatar abo-abo commented on July 22, 2024

The algorithm works in the following way:

  • priority 1: minimize the max tree height.
  • priority 2: maximize the amount of leafs at lower height.

In your case, the max tree height is 2. And the amount of leafs on the lower height is 1 (a). If (s) were also on height 1, then there would be to space to fit the rest of the candidates => the resulting max tree height would be 3. So the algorithm works correctly here (unless it just cuts off at fa like in screenshot).

You can play around with avy-subdiv to see how it works:

(avy-subdiv 100 6)
;; =>
;; (6 6 6 10 36 36)

In this case, there are 100 candidates, and 6 decision keys. The first three branches contain 6 candidates, which means their leafs are on level 2. The next three branches have their leafs on level 3, with the fourth branch left with some free space.

from avy.

bbatsov avatar bbatsov commented on July 22, 2024

I see. Not sure many people would understand the behaviour, but it makes sense. Maybe you should document it with more examples in the README?

from avy.

abo-abo avatar abo-abo commented on July 22, 2024

Added a wiki page for this.

from avy.

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.