Giter Club home page Giter Club logo

graph's Introduction

The graph package is a java/osgi layout package using graphviz as a rendering engine.
The package contains an abstraction of Graph, Vertex and Edge and has a Graph Cascading Style Sheet (GCSS)
implementation that makes it easy to separate graph structure from styling information.

The package requires graphviz to be installed on the host where the package is running in order to
produce PNG, JPG, SVG, (and more formats) output, but can be used to produce .dot output without graphviz
binary being present. 

Configuration is done using google guice.

graph's People

Contributors

hlindberg avatar thallgren avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

graph's Issues

output (unwanted) otherwise inherited attributes last

graphviz makes to distinction between attributes that are useful to inherit and those that are not. As an example, if a label is set on a graph, all subgraphs inherit the same title. The reason for this is that an attribute is effective from the point it is declared in the .dot source until redefined.

The way to solve this is to output such attributes just before the element is being closed - i.e. do this:

graph {
    subgraph { }
    label="my title";
    }

... and not

    graph {
    label="my title";
    subgraph { }
    }

Suggested fix is that the styles that should be output at the close should have a marker interface and that the dot renderer should treat these styles differently.

Add support for clipping edges at subgraph border

To draw an edge between two graphs an edge is required between nodes in the respective graphs with clipping set to the graph edge. In dot notation this is:

compound=true;
subgraph cluster_A {
    a;
}
subgraph cluster_B {
    b;
}
a -> b [lhead=cluster_B, ltail=cluster_A];

Support for this should be added by introducing the two styles "clipHead" and "clipTail" applicable to Edge. They require a Graph as value.

turn on graphstyle compound by default

There seems to be no harm in always having "compound = true" set as a style. If not turned out, clipping at subgraph edge (see #3) has no effect. This is simple to add to the default style configuration.

enhance default style rendering by use of prototypes

Currently default style information is only output for the root graph and this is done by collecting styles from a default GCSS (defined and passed around in the API for this sole purpose). When producing the output, prototype instance of graph, edge and vertex are created and then styled using the GCSS package - the result is output as the default style.

If the GCSS rules instead were written to only apply to identified instances "org.cloudsmith.graph.prototype.edge" etc. then the style rules could be defined in the same package and it would be possible to use a different set of prototypes for different graphs by using an additional containment rule.

The result is that the generated dot output could be much more compact for certain types of graphs where they currently have to have style information per instance.

change hierarchy - IGraph should not be IVertex

Currently a graph is a specialization of vertex. This is based on a misunderstanding that it is possible to have edges between graphs. The result of the following dot code is however not all that useful:

subgraph { a; b; c; } -> subgraph { x; y; z; }

as this produces a cartesian product of edges a->x, a->y, a->z, b->x...

Also not that it is not possible to reference a graph, the graph has to be defined in the edge itself.

Therefor support for adding an edge between graphs should be deprecated.

Also see #3

backgroundColor and fillColor should not be the same

currently, the style "backgroundColor" results in "fillColor" style being rendered. There needs to be a distinction between the two:

bgColor can be applied to Root graph and Clusters, and fillColor can be applied to Clusters, Nodes, Tables and Cell.

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.