Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001357graphvizDotpublic2008-07-18 18:522011-04-28 04:03
ReporterStas Fomin 
Assigned Toellson 
PrioritynormalSeveritycosmeticReproducibilityalways
StatusclosedResolutionfixed 
PlatformOS*-*-OS Version
Summary0001357: Request: Random color from a color scheme for filling nodes
Description



This is a feature request.



Please, add color value "random" for attributes like "fillcolor",
which means that fillcolor will be randomly selected
from current colorscheme.



For example, for
<CD>
digraph G{
  node [style=filled, colorscheme="brbg9"];



   A->B->C;
   D->C;
   D->S;
}
</CD>



all nodes will be randomly colored from colorscheme "brbg9".
Additional Information
[ellson]
I don't think this belongs in the graphviz tools.

There is no guarantee that any colorspace contains all contrasting colors with the background.


I think this sort of feature should be done by preprocessing the graph file, using an application-defined
set of colors (typically not an entire colorspace), and an application's own concept of "random".

[north] Right. It would not be hard to program this in the "gvpr" language.
It has a random number function. This would be a good exercise
for someone that wanted to learn how to use gvpr.

[erg] For example:
<CD>
BEGIN {
  void quit (graph_t G) {
        fwriteG(G, 1);
        exit(0);
  }
}
BEG_G {
    int n, lim;
    char* base;
    char* sch;

    if (!hasAttr($,"colorscheme")) quit($);
    sch = aget($,"colorscheme");
    n = match (sch, "+([0-9])");
    if (n < 0) quit($);
    sscanf (substr (sch,n), "%d", &lim);
    base = substr(sch, 0, n);
    srand();
}
N {
    n = rand()*lim;
    $.color = sprintf ("%s%d", base, n);
}
</CD>
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID1391
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENTFixed
VERSION     
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => user695


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