Coder Social home page Coder Social logo

seamia / protodot Goto Github PK

View Code? Open in Web Editor NEW
386.0 386.0 39.0 48.33 MB

transforming your .proto files into .dot files (and .svg, .png if you happen to have graphviz installed)

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%
cli dependency-graph dot go golang graph graphviz graphviz-dot-language grpc png portable-network-graphics proto3 protobuf protoc protocol-buffers scalable-vector-graphics svg visualization

protodot's People

Contributors

nontechno avatar seamia avatar xqbumu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protodot's Issues

Specify output directory from command line

Great tool, I really like it.
The only thing missing I think is to overwrite the output directory from command line.
I am a developer myself, but I have zero experience with GO, or else I would simply put in a pull request.
Regards, Reinhard.

consistent output

Is there a way to get consistent (or nearly consistent) comparable output?

My specific use case is that we have protobufs, and expect to have the graph files checked into the repo as part of the commit. The simplest way to do this (we do it for generated language bindings) is to run protodot, and check if the file is different from what is checked in.

Except the output isn't consistent.

From my checks, I found several things:

  • date for generated by comment at the end; we can ignore that
  • subgraph cluster_<id>: the ID appears to be generated using some data about the content. As far as I can tell, this is consistent
  • node names, e.g. Node_Ja_<number>: the numbers appear to be consistent with the content in them
  • subgraph sort order: this appears to be one major source of discontinuity
  • node sort order within a subgraph: this appears to be another major source of discontinuity

I don't know the internals of protodot well enough, but it looks like consistent sorting of the subgraphs and nodes within subgraph might go a long way?

How to change colors?

This project is really awesome, but I'd like to change the colors to something a bit easier to read. In config.json there are a bunch of colors listed, but I have no idea where the listed colors come from or how to specify new colors by hex value. I tried "#8888ff" and "8888ff", but neither way worked. Any documentation or advice would be appreciated. Thanks!

Adding annotations to the dot/svg files

Hi, many thanks for this superb project.
I feel that people might benefit from having the option to also include proto annotations in generated dot/svg files.
I would like to work on that and contribute back, but I am not a Go programmer and finding it a challenge to unravel where to start inspecting the code to add the same functionality.

Is it possible for you to point me to where the functionality for adding name/datatype of the field lives in the code base, so I can start experimenting?

So much better if a feature like this is already in the works.

Thanks!

Misleading error about includes

In a run I found this which was fixed once I downloaded the google apis and stored then in the includes list then it started working:

*** failed to find file [ google/api/annotations.proto ] with root [ /Users/...REMOVED... ]
*** failed to find file [ google/protobuf/struct.proto ] with root [ /Users/...REMOVED... ]
*** failed to find file [ google/protobuf/any.proto ] with root [ /Users/...REMOVED... ]
ASSERT: Unresolved type:  google.protobuf.Any ; source:  our.own.Dependency

The default config.json includes does not work, the folder "${HOME}/protodot/protoc-3.6.0/include" was not in that location, even not after running protodot -install. The README.md should be updated to give some instructions to put the base proto files there.

Built the executable from code on MacOS.

Feature Request: Exclude missing nodes

I have a repository of protobuf files that use some basic types from another repo which is not available at the time when I am generating graphs. StringUtf8Value, BoolValue, ResourceName, that kind of thing. I really don't need them graphed.

I would like to exclude the diagramming of missing nodes as it clutters the output just pointing to a Node that says "this type is missing"

Thanks for your consideration, I love this tool it really helps to map things out in my mind.

Failed to load template file(s)

After the last change/commit, we get an error message that it cannot find the template files.

Error msg for proto file 1:
failed to load templates file [templates/oneof_entry_suffix.tmpl] not found

Error msg for proto file 2:
failed to load templates file [templates/enum_suffix.tmpl] not found


Command used:
protodot -config ../protodot.json -inc /usr/include -src *.proto -select AnyService -output AnyService

Assert: *** Failed to process file json data, error: invalid character '}' looking for beginning of object key string

I just downloaded the program and created a basic config file. I also installed Graphviz. Following are the details:

Command:
protodot.exe -src protoFileName.proto

config.json:

{
	"locations": {
		"graphviz": "C:\\Program Files\\Graphviz 2.44.1\\bin"
	},
	"options": {
		"generate .png file": true,
		"generate .svg file": false,
	}
}

Error message:

Assert: *** Failed to process file json data, error: invalid character '}' looking for beginning of object key string
Error: failed to load config file

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.