Code Monkey home page Code Monkey logo

visualize_packs's Introduction

visualize_packs

Visualize_packs helps you visualize the structure, intended and actual, of your package-based Ruby application.

This gem takes a minimal approach in that it only outputs a graph in the format of graphviz' dot language. Install graphviz and use one of the chains of commands from below to generate full or partial images of the graphs of your application.

Visualize your entire application

bundle exec visualize_packs > packs.dot && dot packs.dot -Tpng -o packs.png && open packs.png

packs.png for every package in your app

This will generate a local dependency diagram for every pack in your app

find . -iname 'package.yml' | sed 's/\/package.yml//g' | sed 's/\.\///' | xargs -I % sh -c "bundle exec visualize_packs --focus-pack=% > %/packs.dot && dot %/packs.dot -Tpng -o %/packs.png"

If your app is large and has many packages and todos, the above graphs will likely be too big. Try this version to get only the edges to and from the focus package for each diagram:

find . -iname 'package.yml' | sed 's/\/package.yml//g' | sed 's/\.\///' | xargs -I % sh -c "bundle exec visualize_packs --focus-pack=% --focus-pack-edge-mode=inout > %/packs.dot && dot %/packs.dot -Tpng -o %/packs.png"

Get help

bundle exec visualize_packs --help

What outputs look like

Sample diagrams produced

Contributing

To contribute, install graphviz (and the dot command) and imagemagick. You must also have Ruby 3.2.2 and bundler installed. Then

./spec/test.sh

At the end of the test run, a new window will open up showing you a comparison of the old graphs (on the left) and the new graphs (on the right). Compare the visuals to make sure you're getting the changes you were expecting.

Once you are ready, run the following and commit the new diagram_examples.png and the new dot files with your changes:

./spec/update_cassettes.sh

Please check in a new diagram_examples.png only if there are actual visual changes.

visualize_packs's People

Contributors

shageman avatar oboxodo avatar adam-e-trepanier avatar blnoonan avatar schoblaska avatar imactia avatar

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.