tckz / redmine-wiki_graphviz_plugin

Wiki macro for redmine. The macro render graph-image from wiki contents as dot.
https://passing.breeze.cc/mt/
Other
58 stars 13 forks source link

SVG format compatibility #11

Closed virus-warnning closed 10 years ago

virus-warnning commented 10 years ago

I'd like to render graphviz in svg format. Could you do me a favor?

ghost commented 10 years ago

Sure, what can i help you?

On Tue, May 13, 2014 at 11:58 AM, Raymond Wu (小璋丸) <notifications@github.com

wrote:

I'd like to render graphviz in svg format. Could you do me a favor?

— Reply to this email directly or view it on GitHubhttps://github.com/tckz/redmine-wiki_graphviz_plugin/issues/11 .

virus-warnning commented 10 years ago

I hope your plugin render the following syntax in SVG format. So that I can use "link" attribute.

{{graphviz_link(format="svg")
digraph G2 {
   // defaults of graphs
   graph [
      rankdir = LR
   ];

   // defaults of nodes
   node [
      shape = box,
      style = "filled,rounded",
      fontsize = 10,
      height = 0.3,
      fontcolor = "#000000",
      color = "#c07000",
      fillcolor = "white:#ffffc0",
      gradientangle = 285
   ];

   // default of edges
   edge [
      color="#444444",
      fontcolor="#444444",
      fontsize=10
   ];

   // nodes
   A [label="Any Question?"];
   B [label="Google",URL="http://www.google.com",fontcolor="#0000ff"];

   // edges
   A -> B;
}
}}
ghost commented 10 years ago

My repository is only a fork of tckz https://github.com/tckz 's plugin, he's the master of this plugin. My fork is only about to upgrade the plugin a bit to make it work on newer redmines.

Only the png and jpg formats allowed: app/helpers/wiki_graphviz_helper.rb:20https://github.com/tckz/redmine-wiki_graphviz_plugin/blob/master/app/helpers/wiki_graphviz_helper.rb#L20 I think the original reason was that tckz thought that only raster image formats can be embedded to the image tag, or much simpler: he didn't need it :) Anyway, it's possiblehttp://depth-first.com/articles/2011/10/19/display-inline-svg-using-the-img-tag/, I think you can add 'svg' to the mentioned line and it will be done. (Despite the comment in the link, it's looks great in my chrome (linux))

On Wed, May 14, 2014 at 7:36 AM, Raymond Wu (小璋丸) notifications@github.comwrote:

I hope your plugin render the following syntax in SVG format. So that I can use "link" attribute.

{{graphviz_link(format="svg") digraph G2 { // defaults of graphs graph [ rankdir = LR ];

// defaults of nodes node [ shape = box, style = "filled,rounded", fontsize = 10, height = 0.3, fontcolor = "#000000", color = "#c07000", fillcolor = "white:#ffffc0", gradientangle = 285 ];

// default of edges edge [ color="#444444", fontcolor="#444444", fontsize=10 ];

// nodes A [label="Any Question?"]; B [label="Google",URL="http://www.google.com",fontcolor="#0000ff"];

// edges A -> B; } }}

— Reply to this email directly or view it on GitHubhttps://github.com/tckz/redmine-wiki_graphviz_plugin/issues/11#issuecomment-43044049 .

virus-warnning commented 10 years ago

Thanks, I'll try it later.

tckz commented 10 years ago

Hello everyone.

To: virus-warnning

Did you get a image which is rendered in svg? You can get it using jani9876's suggestion.(Add one entry to ALLOWED_FORMAT)

If you want to embed SVG as inline XML(some reason), I think you might be good to try new plugin source.