Graphviz4S icon indicating copy to clipboard operation
Graphviz4S copied to clipboard

you can add an api for dot

Open epiphyllum opened this issue 8 years ago • 4 comments

val inputStream = dot.getInputStream

so that it can be easily used for browser rendering in many scala web framework or lib

epiphyllum avatar Jan 19 '17 08:01 epiphyllum

@epiphyllum thanks for your advise, but I am not sure what you mean. Could you provide a more specific details of how will you use this api?

Ldpe2G avatar Jan 19 '17 14:01 Ldpe2G

for example:

when browser initiate a request GET /give/me/graph/of/:flow_id.png to my webserver, webserver will first load data from database using :flow_id, then webserver should create a Digraph class provided by you, and render an image to the browser

val flowConfig = loadConfigFromDB(flowId)
val flowDot = new Digraph(comment = "The Flow Graph")
val inputStream = flowDot.getInputStream

val httpResponse = new HTTPResponse(inputStream, `Content-Type:image/png`)

blah blah...

epiphyllum avatar Jan 20 '17 01:01 epiphyllum

this project provide an DSL wrapper for graphviz command. it is a good start. I think it is also can be used in the web for image rendering where performance is not some critical

epiphyllum avatar Jan 20 '17 01:01 epiphyllum

Thanks for your detailed explaination. I will take a look into this.

Ldpe2G avatar Jan 20 '17 05:01 Ldpe2G