Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
- add gopher <3
- center the title
- move images folder
- add link to goexplorer
- link to images directly
- minor formatting changes
  • Loading branch information
ondrajz committed Jan 22, 2017
1 parent 45bc115 commit 64feb51
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 31 deletions.
70 changes: 46 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
go-callvis [![GitHub release](https://img.shields.io/github/release/truefurby/go-callvis.svg)](https://github.com/TrueFurby/go-callvis/releases) [![Build Status](https://travis-ci.org/TrueFurby/go-callvis.svg?branch=master)](https://travis-ci.org/TrueFurby/go-callvis) [![Slack](https://img.shields.io/badge/gophers%20slack-%23go--callvis-ff69b4.svg)](https://gophersinvite.herokuapp.com)
==========
<p align="center">
<img src="images/gopher.png" alt="gopher"></br>
<a href="https://github.com/TrueFurby/go-callvis/releases"><img src="https://img.shields.io/github/release/truefurby/go-callvis.svg" alt="Github release"></a> <a href="https://travis-ci.org/TrueFurby/go-callvis"><img src="https://travis-ci.org/TrueFurby/go-callvis.svg?branch=master" alt="Build status"></a> <a href="https://gophers.slack.com/archives/go-callvis"><img src="https://img.shields.io/badge/gophers%20slack-%23go--callvis-ff69b4.svg" alt="Slack channel"></a>
</p>

# <div align="center">go-callvis</div>

**go-callvis** is a development tool to help visualize call graph of your Go program using Graphviz's dot format.

![main](examples/images/main.png)
[![main](images/main.png)](https://raw.githubusercontent.com/TrueFurby/go-callvis/master/images/main.png)

## Introduction

Intended purpose of this tool is to provide a visual overview of function calls of your program by using call graph, package and type relations. This is especially useful in larger projects where the complexity of the code rises or when you are trying to understand someone else's code.

Expand All @@ -14,11 +20,11 @@ Intended purpose of this tool is to provide a visual overview of function calls
- limit packages to custom prefix path
- ignore packages containing custom prefix

### How it works
#### How it works

It runs [pointer analysis](https://godoc.org/golang.org/x/tools/go/pointer) to construct the call graph of the program and uses the data to generate output in [dot format](http://www.graphviz.org/content/dot-language), which can be rendered with Graphviz tools.

## Installation
## Get started

### Requirements

Expand Down Expand Up @@ -61,20 +67,25 @@ Options:

### Packages & Types

> Presented as subgraphs (clusters).
###### Presented as subgraphs (clusters).

- **packages** have _normal corners_ and _label on the top_
- **types** have _rounded corners_ with _label on the bottom_
##### Packages
- *normal corners*
- *label on the top*

##### Types
- *rounded corners*
- *label on the bottom*

Represents | Style
----------: | :-------------
`focused` | _blue color_
`stdlib` | _green color_ :collision: **NEW!**
`stdlib` | _green color_
`other` | _yellow color_

### Functions

> Presented as nodes.
###### Presented as nodes.

Represents | Style
-----------: | :--------------
Expand All @@ -84,7 +95,7 @@ Represents | Style

### Calls

> Presented as edges.
###### Presented as edges.

Represents | Style
-----------: | :-------------
Expand All @@ -93,32 +104,43 @@ Represents | Style
`static` | _solid line_
`dynamic` | _dashed line_
`regular` | _simple arrow_
`concurrent` | ~~_empty arrow_~~ _arrow with empty circle_ :warning:
`deferred` | ~~_empty circle_~~ _arrow with empty diamond_ :warning:
`concurrent` | _arrow with empty circle_
`deferred` | _arrow with empty diamond_

## Examples

Here is example for project [syncthing](https://github.com/syncthing/syncthing).
Here is an example for the project [syncthing](https://github.com/syncthing/syncthing).

![syncthing example](examples/images/syncthing.png)
[![syncthing example](images/syncthing.png)](https://raw.githubusercontent.com/TrueFurby/go-callvis/master/images/syncthing.png)

```
go-callvis -focus upgrade -group pkg,type -limit github.com/syncthing/syncthing -ignore github.com/syncthing/syncthing/lib/logger github.com/syncthing/syncthing/cmd/syncthing | dot -Tpng -o syncthing.png
```

You can find more examples in the folder [examples](examples).
###### You can find more examples in the folder [examples](examples).

### Community

Join the channel [#go-callvis](https://gophers.slack.com/archives/go-callvis) at [gophers.slack.com](http://gophers.slack.com).

> *Are you not a member yet?* [Get invitation](https://gophersinvite.herokuapp.com).
#### How to contribute

###### *Did you find any bugs or have some suggestions?*

## Roadmap
Feel free to open [new issue](https://github.com/TrueFurby/go-callvis/issues/new) or start discussion in the slack channel.

Ideal goal of this project is to make web app that would locally store the call graph data and then provide quick access of the call graphs for any package of your dependency tree. At first it would show an interactive map of overall dependencies between packages and then by selecting particular package it would show the call graph and provide various options to alter the output dynamically.
#### Known Issues

## Known Issues
+ **each execution takes a lot of time, because currently:**
- the call graph is always generated for the entire program
- there is yet no caching of call graph data

**execution takes a lot of time, because currently:**
---

- the call graph is always generated for the entire program
- there is yet no caching of call graph data
#### Roadmap

## Community
###### :boom: The *interactive tool* described below has been published as a *separate project* called [goexplorer](https://github.com/TrueFurby/goexplorer).

Join the [#go-callvis](https://gophers.slack.com/archives/go-callvis) channel at [gophers.slack.com](http://gophers.slack.com)
> Ideal goal of this project is to make web app that would locally store the call graph data and then provide quick access of the call graphs for any package of your dependency tree. At first it would show an interactive map of overall dependencies between packages and then by selecting particular package it would show the call graph and provide various options to alter the output dynamically.
16 changes: 9 additions & 7 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
# Examples

## Syncthing - [github.com/syncthing/syncthing](https://github.com/syncthing/syncthing)
## Projects

### Focusing package _upgrade_
### [Syncthing](https://github.com/syncthing/syncthing)

![syncthing example output](images/syncthing_focus.png)
#### Focusing package _upgrade_

[![syncthing example output](../images/syncthing_focus.png)](https://raw.githubusercontent.com/TrueFurby/go-callvis/master/images/syncthing_focus.png)

```
go-callvis -focus upgrade -limit github.com/syncthing/syncthing github.com/syncthing/syncthing/cmd/syncthing | dot -Tpng -o syncthing_focus.png
```

--------------------------------------------------------------------------------

### Grouping by _packages_
#### Grouping by _packages_

![syncthing example output pkg](images/syncthing_group.png)
[![syncthing example output pkg](../images/syncthing_group.png)](https://raw.githubusercontent.com/TrueFurby/go-callvis/master/images/syncthing_group.png)

```
go-callvis -focus upgrade -group pkg -limit github.com/syncthing/syncthing github.com/syncthing/syncthing/cmd/syncthing | dot -Tpng -o syncthing_group.png
```

--------------------------------------------------------------------------------

### Ignoring package _logger_
#### Ignoring package _logger_

![syncthing example output ignore](images/syncthing_ignore.png)
[![syncthing example output ignore](../images/syncthing_ignore.png)](https://raw.githubusercontent.com/TrueFurby/go-callvis/master/images/syncthing_ignore.png)

```
go-callvis -focus upgrade -group pkg -ignore github.com/syncthing/syncthing/lib/logger -limit github.com/syncthing/syncthing github.com/syncthing/syncthing/cmd/syncthing | dot -Tpng -o syncthing_ignore.png
Expand Down
Binary file added images/gopher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 64feb51

Please sign in to comment.