Nodes of more than one color

Hi there,

We would like to use Dot (and then the subsequent xDot)
to render Glycans in our Pathway Logic tool.

I attach a key for one such variant.

I'd like to know if there is any way to produce
the two color nodes, and stars.

Any suggestions would be great!

Cheers Ian.

AttachmentSize
glycanRepresentation-fig1.5.pdf276.33 KB

As of 29 June, two color

As of 29 June, two color nodes are available in Graphviz as a special case of linear gradient fill. For the fillcolor, use a colorList with two colors and a weight of a half, e.g.,

  fillcolor="blue;.5:yellow"

set the node's shape and set gradientangle appropriate for the shape and set style=filled.

Stars may take a bit longer.

My mileage seems to vary.

So I'm doing something wrong again (stars look great by the way).

 

iam% dot -V
dot - graphviz version 2.31.20130710.0445 (20130710.0445)

 

and straight from the gallery page:

 

iam% more gradient.dot
digraph G { bgcolor="purple:pink" label="agraph" fontcolor="white"
  subgraph cluster1 {fillcolor="blue:cyan" label="acluster" fontcolor="white" style="filled" gradientangle="270"
                node [shape=box fillcolor="red:yellow" style="filled" gradientangle=90]
                anode;
        }

}

 

followed by :

 

iam% dot -Tpng gradient.dot -o gradient.png

 

and  I get this:

http://www.jlambda.com/~iam/gradient.png

 

Needless to say, my two tone nodes are still monochrome :-(

 

 

 

Two things: First, gradient

Two things:

First, gradient fills are only available via the cairo renderer or with -Tsvg. If cairo is available, -Tpng will choose it by default, so I'm guessing your version of graphviz is built without cairo. To check, run dot -Tpng: and see what you get. You'd like to see something like:

Format: "png:" not recognized. Use one of: png:cairo:cairo png:cairo:cairo png:cairo:quartz png:cairo:quartz png:quartz:quartz png:quartz:quartz png:cairo:gd png:cairo:gd png:cairo:gdk_pixbuf png:cairo:gdk_pixbuf png:gd:gd png:gd:gd

You will need to either get a cairo-enabled version or render using svg.

Second, if you just supply a color list of two colors, you get a real gradient fill:

To get two-toned fill, add a fraction to at least one of the colors. The numbers specify what percentage of the whole each color uses. For example, you could say fillcolor="red;0.5:yellow". Your output would then look like:

Yep

 

No cairo :-(

OK  build from source ...  Thanks.

Out of curiosity, where did

Out of curiosity, where did you get your binary package? I thought most of these were set up to use cairo.

From the graphviz site (i.e. here)

http://www.graphviz.org/Download_macos.php

where is says it doesn't include the pangocairo plugin.

 

 

Ah, yes, we are actually

Ah, yes, we are actually working on this, as we realized that not having cairo is a significant loss. The problem is all in the packaging. Fortunately, as noted, the source and macports versions are available. You just don't get the snazzy Graphviz.app.

Graphviz.app in MacPorts

You certainly can have the snazzy Graphviz.app in MacPorts if you want it. It's in the separate graphviz-gui (or, if you're using graphviz-devel, the graphviz-gui-devel) port.

Sorry, I forgot. In any case,

Sorry, I forgot. In any case, we are still trying to get our own mac package built with cairo. Personally, I just use macports.

As of 2 July, Graphviz has a

As of 2 July, Graphviz has a star node shape.

That is great news.

 

I shall try these out asap!

 

Thanks.

Recent comments