mewspring / dot Goto Github PK
View Code? Open in Web Editor NEWMerged with and superceded by gonum/gonum.
Merged with and superceded by gonum/gonum.
Hi Robin,
I can tell that you are a big fan of gocc. Would you share your opinion on BNF based parsing vs Ragel, from which the blogger claimed that, "It seems that there is a fair variety of tools designed to make writing Lexers, Scanners and Tokenizers easier, but Ragel has a reputation for being simple and consistently producing the fastest final code"
PS. you can find out more about Ragel here if you want to.
To stress test the lexer and parser generated from the DOT grammar, the test cases from the official Graphviz project will be downloaded and parsed.
The intention is to implement a script which downloads these test cases from the graphviz repository, and converts them to UTF-8 encoding. To verify the read and write capabilities of the library, these test files will be parsed and the resulting graphs will be pretty-printed in DOT format and compared against the original test files, ignoring separating whitespaces.
Future ambition.
The DOT parser has been merged with the gonum graph project.
See https://github.com/gonum/graph/issues/9#issuecomment-287614432 for background discussion, and gonum/graph#198 for the PR tracking its inclusion.
The graphism/dot repository will remain for the time being. Primarily to give current users a time to update their import paths.
For active development, the new home of graphism/dot is the gonum/graph repository, under the import path formats/dot
.
-import "github.com/graphism/dot"
+import "github.com/gonum/graph/formats/dot"
The PR gonum/graph#198 has now been merged, and graphism/dot has found its new home at gonum/graph/formats/dot. The code is dual licensed, both in public domain (CC0) and BSD, and users are free to choose whichever is better suited for them.
My understanding is that the Gocc compiler kit is used to generate lexers and parsers from the BNF grammar of the DOT file format.
If so, would you think it is a good idea not to enforce this Gocc dependency to dot users by separating the building process into a different package, while dot only makes use of the generated code? It's like there are two level of dependencies as well for Debian packages -- the dependencies to build it and the dependencies to run it, which has far less dependencies than that of building it, most of the time.
This is a meta issue to discuss various design decisions related to the DOT package.
NOTE: This section is under construction, and will be revised based on continuous discussions, so feel free to join.
The aim of this project is to create a general purpose package for accessing Graphviz DOT files, including both read and write support. To achieve this aim, a set of objectives have been identified.
An explicit non-goal of this project is to implement a specific graph data structure. Rather, it is intended to allow support for translating into and out of various graph data structures. We should make sure to investigate the feasibility of utilizing the gonum/graph package as the generic graph data structure. Where ever the graph data structure is defined, it should be as part of another repository, not the DOT repository. It is possible that a graphism/graph
repo will be created for this purpose.
The source code and any original content of this repository is intended to be released into the public domain. Anyone wishing to join the project are kindly asked to consider releasing their contributions into the public domain.
The contents of bar.go is hosted on play.golang.org.
Contents of a.dot
:
digraph {
A -> A
}
$ go run bar.go a.dot
panic: simple: adding self edge
Hi Robin ,
Hope that when you are achieving your Aim and Objectives, you will also bear in mind how the package can be used.
One thing specific comes into my mind is the ability to break big graphs apart into smaller ones, as nowadays, any (automatically generated) chart can be super big, which makes viewing such graphs impractical. Take this automatically generated chart for e.g., it is just too big to be comprehensible.
Just keep a record here so that you can refer back later on when time allows. If you want to tackle it yourself, here is a sample soure and how it looks. Else, I'll build one myself on top of your dot
package.
BTW, breaking big graphs apart into smaller clusters is a hard problem. I don't have the sufficient graph theory knowledge to do it the "proper way", but I do have thought of some easy tricks that will/would make it work.
Happy hacking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.