Giter Site home page Giter Site logo

Comments (2)

regexident avatar regexident commented on July 23, 2024

Ho Cameron,

do you have a sort of sketch of how you would envision such uses to be visualized via the structure sub-command?

from cargo-modules.

duckki avatar duckki commented on July 23, 2024

This is something I want as well. My use case is when I start to read an existing codebase and want to identify the "leaves" of dependency forest. "owns" relationship is already reflected by the directory structure of the code.

But, I don't think such an output can be a tree form like structure command. One way to achieve something like this is by topologically sorting the "use"-dependency graph. That'd be just a list.

A more elaborate presentation would be a layered graph. The leaf nodes are on the top layer. Then, nodes that are directly dependent on them are on the next layer. And so forth. Towards the bottom, modules are increasingly more dependent on other modules. That will be similar to the "tech tree" presentation on video games. We may need to deal with cycles by breaking cycles favoring certain edges or by treating cycles as groups (aka Tarjan's strongly-connected component).

tech tree

from cargo-modules.

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.