zz85 / kafka-streams-viz

Kafka Streams Topology Sketch Diagram Visualization
https://zz85.github.io/kafka-streams-viz
412 stars 84 forks source link

How to use this tool programmatically? #6

Open guozhangwang opened 5 years ago

guozhangwang commented 5 years ago

Hey @zz85 thanks for this great tool! I've been using it for quite some time and it is definitely a big saver.

A qq for you: what should I do if I want to use this tool programmatically? Say if I want to dump a file (pdf, jpeg, whatever) from my Java code that contains the drawings of my Topology.describe() string?

focusaurus commented 4 years ago

I'm also interested in toolchain ideas here. Here's what I'm planning to do to quickly be able to build png images.

  1. I have some clojure code that can spit out the topology description text syntax
  2. Using the javascript from here, I wrote a small node wrapper that reads topology description on stdin and spits out dot syntax
  3. I'm then using graphviz (via a docker container I found on docker hub) to convert the .dot graphviz text files to .png images. These aren't as nice as the rough.js ones the web app builds, but they look OK.