Number: 1259
Title: Gradient fill style
Submitter: Pander
Date: Sun Dec 30 17:07:26 2007
Subsys: Dot
Version: 2.17
System: *-*-
Severity: minor
Provide gradient fill of nodes and clusters. This would be simple to implement for SVG output to start with. Current work around is to edit the resulting SVG in another application like inkscape to set the gradients. Much nicer would be if graphviz can handle this.

The following code

digraph test {
  a [style="gradient" fillcolor="red" gradientcolor="blue" gradientorientation="TB" ]

would result in a node which is filled with a gradient running from red to blue from top to bottom.

Alternatives and examples for the syntax could be:


fillcolor="red" (this one is preferred because of reuse of variable names) gradientstartcolor="red"

gradientendcolor="blue" gradientcolor="blue" (this one is preferred because of short variable names, default would be black when this style is active since fillcolor is by default white)

gradientorientation="TB" (0 degrees = default) gradientorientation="LR" gradientorientation="TLBR" (135 degrees = top left -> bottom right) gradientorientation="38" (38 degrees)

This is an interesting idea. Obviously SVG can do a tremendous number of things that we can't expect to support in most of the code gens. (What about gaussian blur? Drop shadows? Oil painting effects? etc.)

Rather than postprocess interactively with inkscape, what about generic SVG stream filters? I wonder if any good tools exist.

Of course, we can appreciate the increased complexity of having to maintain separate specifications for Graphviz and the postprocessor (though you can also imagine burying all this under a shell script that calls gpr to get the SVG-modifying arguments, thereby shielding the end user from all this).

[pander] I would like to ask that this feature request is implemented inside graphviz. In the end, it will be more elaborate to maintain different post processes that work only SVG but not on other formats. It will also increase the work the user has to do, platform dependencies etc.

Starting with supporting this for SVG output is pretty straightforward and later on implementations for other formats can come alongside. Once graphviz maintainers agree on how to extend the syntax with one of the proposed examples, I am willing to help implement this for SVG.

[ellson] Since cairo can do gradients, and even these other features, they could reasonably be considered nearly generic across multiple output formats.

I know it would be hard to justify this as core development, but perhaps if we just decide on an attribute syntax, we could let Pander and/or others develop this?
Owner: *
Status: Request