Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically load color scheme data as needed #20

Open
GoogleCodeExporter opened this issue Jun 30, 2015 · 2 comments
Open

Dynamically load color scheme data as needed #20

GoogleCodeExporter opened this issue Jun 30, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Currently if you want to use named colors in a graph, you have to know this 
ahead of time and 
include x11colors.js and/or brewercolors.js. It would be nicer if Canviz would 
dynamically load the 
appropriate color scheme file if necessary for the graph being rendered.

A method for dynamically loading scripts is described here:

http://www.codehouse.com/javascript/articles/external/


Original issue reported on code.google.com by ryandesi...@gmail.com on 16 Oct 2008 at 5:08

@GoogleCodeExporter
Copy link
Author

I knew it couldn't be that easy. :)

The method described above shows how to create a new script element and append 
it to the head element. This 
is a fine strategy, but does not tell us when the script file has *fininshed* 
loading, which we need to know so we 
can draw (or maybe redraw) the graph.

The method described here is more complete:

http://www.magichatdevelopment.com/content/blog/article.php?id=4

It creates the script element to load the JavaScript file. The file ends by 
firing a custom event, which we listen for 
to know when the file is done loading. Firing a custom event is new in 
Prototype 1.6, so we need to update our 
Prototype. I filed issue #21 to do that.

Original comment by ryandesi...@gmail.com on 16 Oct 2008 at 8:03

@GoogleCodeExporter
Copy link
Author

Some time between 2.21.20081029.0445 and 2.21.20081115.1321 Graphviz started
automatically translating color names to their hex values in xdot output. I had
requested this here:
https://mailman.research.att.com/pipermail/graphviz-devel/2008/000792.html

Thanks to this change, the color scheme files aren't needed anymore for current
Graphviz. But I still want to implement dynamic loading to best support older 
Graphviz.

Original comment by ryandesi...@gmail.com on 26 Dec 2008 at 9:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant