Graphviz4S
Graphviz4S copied to clipboard
you can add an api for dot
val inputStream = dot.getInputStream
so that it can be easily used for browser rendering in many scala web framework or lib
@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?
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...
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
Thanks for your detailed explaination. I will take a look into this.