• Stars
    star
    198
  • Rank 195,731 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸŽ† Include graph visualization for C++

πŸŽ† ig



ig is a tool to interactively visualize include graphs for C++ projects

license

Overview

Point ig at any directory containing C++ source or header files and it will construct a full graph of all includes, serve you a local website and visualize the graph interactively with sigma.js, for you to admire.

Usage is very easy:

$ ig -o include

will inspect the folder include, serve a website on localhost:8080 and even open your browser for you. The full set of options currently include:

usage: ig [-h] [--pattern PATTERNS] [-i PREFIXES] [-v] [-p PORT] [-o] [-j]
          [-d DIRECTORY] [--relation {includes,included-by}]
          [--min-degree MIN_DEGREE] [--group-granularity GROUP_GRANULARITY]
          [--full-path] [--colors COLORS] [--color-variation COLOR_VARIATION]
          [--color-alpha-min COLOR_ALPHA_MIN]
          directories [directories ...]

Visualize C++ include graphs

positional arguments:
  directories           The directories to inspect

optional arguments:
  -h, --help            show this help message and exit
  --pattern PATTERNS    The file (glob) patterns to look for
  -i PREFIXES, -I PREFIXES, --prefix PREFIXES
                        An include path for headers to recognize
  -v, --verbose         Turn on verbose output
  -p PORT, --port PORT  The port to serve the visualization on
  -o, --open            Open the webpage immediately
  -j, --json            Print the graph JSON and instead of serving it
  -d DIRECTORY, --dir DIRECTORY
                        The directory to store the served files in. If not
                        supplied, a temporary directory is created.
  --relation {includes,included-by}
                        The relation of edges in the graph
  --min-degree MIN_DEGREE
                        The initial minimum degree nodes should have to be
                        displayed
  --group-granularity GROUP_GRANULARITY
                        How coarse to group nodes (by folder)
  --full-path           If set, shows the full path for nodes
  --colors COLORS       The base RGB colors separated by commas
  --color-variation COLOR_VARIATION
                        The variation in RGB around the base colors
  --color-alpha-min COLOR_ALPHA_MIN
                        The minimum alpha value for colors

But does it scale? It scales quite well. The graph you see above is the include graph for the entire LLVM and clang codebase, which spans more than 5,000 files and 1.5M LOC. Note that the visualization also includes sliders to group nodes by folder and filter out low-degree nodes.

Installation

Get it with pip:

$ pip install ig-cpp

Works with Python 2 and 3.

Examples

Who ever said C++ was an ugly language?



LLVM/ADT



TensorFlow



libc++ (the standard library)

Authors

Peter Goldsborough + cat ❀️

More Repositories

1

ipc-bench

🐎 Benchmarks for Inter-Process-Communication Techniques
C
676
star
2

clang-expand

πŸ‰ A clang tool for happy refactoring without source-code gymnastics
C++
247
star
3

lru-cache

πŸ’« A feature complete LRU cache implementation in C++
C++
234
star
4

Writer-Tutorial

PyQt text editor tutorial repository
Python
185
star
5

vector

A pure C vector implementation
C
138
star
6

latexpp

A C++ LaTeX generator
C++
137
star
7

microservice-rs

Tutorial codebase for writing a microservice in Rust
Rust
129
star
8

markdownpp

A C++ Markdown solution.
CSS
83
star
9

tssx

Transparently replace domain sockets with a fast shared memory channel
C
68
star
10

k-means

Code accompanying my blog post on k-means in Python, C++ and CUDA
Cuda
58
star
11

hashtable

A pure C hashtable implementation.
C
45
star
12

Writer

PyQt Text Editor
Python
41
star
13

AVR-DHT11

πŸͺ² AVR code to interface with the DHT11 temperature and relative humidity sensors
C
27
star
14

psag.cc

A URL shortener for my blog, written in Rust
Rust
24
star
15

bitset

A pure C Bitset implementation.
C
17
star
16

pytorch-cpp-extension

PyTorch C++ Extension Example
Python
15
star
17

generate-shapes

⬛ πŸ”΄ Generate shapes for object detection algorithms
Python
14
star
18

bloom-cpp

πŸ” A header-only bloom filter implementation in C++14.
C++
13
star
19

cytogan

Repository for my research on generative modelling of cell images
Python
13
star
20

progress

A pluggable command line progress bar
Shell
12
star
21

algs4

Notes and Implementations for Princeton Algs4 course.
Java
12
star
22

dispy

A tiny Python bytecode disassembler
Python
10
star
23

router-trie

A Hash Array Mapped Trie for fast Routing Table lookups.
C
10
star
24

GoogleCloudVisionOCRExample

Using the Google Cloud Vision API for OCR in Swift
Swift
9
star
25

Mavrchester

Atmel AVR C code for Manchester Encoding.
C
8
star
26

atom-clang-expand

πŸ‰ A clang tool for happy refactoring without source-code gymnastics (atom package)
JavaScript
6
star
27

your_app

Tutorial repository for "Creating and Distributing a Python Project".
Python
6
star
28

li

A license fetcher
Python
6
star
29

data-structures

Data structure implementations.
C++
5
star
30

algorithms

Algorithm implementations.
C++
5
star
31

Anthem

The to-be go-to open-source, community-driven synthesizer
C++
5
star
32

Parsley

C++ XML Parser
C++
4
star
33

real-fake

Tiny app for GAN image "turing tests"
HTML
3
star
34

lnk

Command-line URL shortening client.
Python
3
star
35

ecstasy

A command-line-tool beautifier
Python
2
star
36

euler

Project Euler Solutions.
Python
1
star
37

enum-class.js

Strongly typed enums in JavaScript
JavaScript
1
star