Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002315graphvizOutput Generationpublic2013-07-29 01:392013-08-01 14:16
Assigned Toerg 
PlatformOSOS Version
Summary0002315: Support gradients in xdot output
DescriptionCurrently, gradients are not reflected in xdot output, but I'd like them to be. I need to know the start and end points (and for radial gradients, the start and end radii) and for each color stop, the percentage along the line and the color value at that point.

Two possible implementations occur to me:

1. The gradient information could be encoded in the existing "C" and "c" fill and pen color commands, for example using the CSS gradient specifications: [^] [^]

The advantage of method (1) would be not needing to add new commands to XDOT. The disadvantage is that existing renderers are unlikely to be able to use those colors without needing to parse them.

2. Alternately, new commands could be invented (e.g. "G" (linear gradient fill), "g" (linear gradient pen), "R" (radial gradient fill), "r" (radial gradient pen)) and you could invent a syntax for communicating the positions and color stops. For example:

G x1 y1 x2 y2 n [p m]
Set fill linear gradient, along a line from x1,y1 to x2,y2, with n color stops. For each color stop at position p, the color value consists of the m bytes following '-'. (The values in square brackets repeat n times.)

R x1 y1 r1 x2 y2 r2 n [p m]
Set fill radial gradient, starting from a circle centered at x1,y1 with radius r1, ending at a circle centered at x2,y2 with radius r2, with n color stops. For each color stop at position p, the color value consists of the m bytes following '-'. (The values in square brackets repeat n times.)

The advantage of method (2) would be that you could provide a solid color fallback for renderers that can't do gradients, and any renderer that wants to do gradients can easily acquire all the required parameters without needing to do any further parsing of a color string other than the already-required parsing of the XDOT draw commands.

If new commands are added to XDOT, I would recommend increasing the xdotversion to 1.3, as was done previously when the "I" command was added in xdotversion 1.2.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
User avatar (0000419)
erg (administrator)
2013-08-01 14:16

xdot now reports gradient colors. Suggestion 1 seemed more appropriate, but with an xdot-style encoding of linear and radial gradients. The format of the two forms is given in the on-line documentation [^]

- Issue History
Date Modified Username Field Change
2013-07-29 01:39 ryandesign New Issue
2013-08-01 14:16 erg Note Added: 0000419
2013-08-01 14:16 erg Assigned To => erg
2013-08-01 14:16 erg Status new => resolved
2013-08-01 14:16 erg Resolution open => fixed

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker