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
Reporterryandesign 
Assigned Toerg 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
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:

https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient [^]

https://developer.mozilla.org/en-US/docs/Web/CSS/radial-gradient [^]

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 -b1b2...bn]
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 -b1b2...bn]
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.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION2.31.20130726.0447
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
http://www.graphviz.org/content/output-formats#dxdot [^]

- 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