1. Products
  2.   Diagram
  3.   Java
  4.   Kroki

Kroki

 
 

Open Source Java API to Create Block Diagram & Export It

Free Java Visio Diagraming Library that enables Software Developers to Create Block Diagram & Export Diagram to SVG or PDF, Access, Read & Extract Textual Content from Microsoft Visio VSD via Java API.

What is Kroki Library?

Imagine having a powerful tool at your disposal as a software developer. Kroki, an open-source MIT licensed Java API, allows you to effortlessly generate diagrams from plain text within your Java applications. This user-friendly API provides a stable solution for various diagram libraries, giving you the flexibility to use it across different platforms. With its modular architecture, Kroki offers a range of modules, including a Java web server acting as a gateway, Umlet Java API for diagram creation, and a Node.js CLI, making it a versatile and convenient option for developers like you. 

The library supports various essential diagram types including BlockDiag, BPMN, Bytefield, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag, C4 (with PlantUML), Ditaa, Erd, GraphViz, Mermaid, Nomnoml, PlantUML, SvgBob, UMLet, Vega, Vega-Lite, and WaveDrom. You can export the library into formats like PNG, SVG, JPEG, PDF, Base64, and more. It provides excellent performance and speed. You can conveniently engage with the library using any HTTP client. You can use its HTTP API to turn text into diagrams. This tool works with both GET and POST requests. Plus, it lets you encode diagrams and employ the deflate + base64 algorithm with a GET request. 

Previous Next

Getting Started with Kroki

The recommended way to install Kroki is using Docker. Please use the following command for a smooth installation.

Install Kroki using Docker

docker run yuzutech/kroki 

Clone Kroki git Repository

git clone https://github.com/yuzutech/kroki.git 

Block Diagram Creation via Java API

A block diagram represents a very specialized, high-level flowchart used in engineering, which shows the principal parts or functions represented by blocks and interconnected by lines shows the relationship of the blocks. The open source Kroki library allows software developers to create block diagram inside their own applications using Java commands. You can also easily modify the existing diagram with ease.

How to Create New Block Diagram via Java API?

blockdiag {
  blockdiag -> generates -> "block-diagrams";
  blockdiag -> is -> "very easy!";

  blockdiag [color = "greenyellow"];
  "block-diagrams" [color = "pink"];
  "very easy!" [color = "orange"];
}

Sequence Diagram Creation

The open source Java library Kroki allows software developers to create and manage sequence diagrams inside their own applications. The library allows to easily add new elements in a diagram and automatically arranging the created elements. The library easily controls the flow of activities and gives users the capability to easily insert or update titles for activities, delete an activity, rearrange actives and more 

How to Create New Sequence Diagram via Java API?

seqdiag {
  browser  -> webserver [label = "GET /index.html"];
  browser <-- webserver;
  browser  -> webserver [label = "POST /blog/comment"];
  webserver  -> database [label = "INSERT comment"];
  webserver <-- database;
  browser <-- webserver;
}

Export Diagram to SVG or PDF via Java

The Kroki library gives software developers the capability to create various kinds of diagrams inside their Java applications. The library offers great performance and speed while creating diagrams. Once created you can export it to several supported file formats, such as PNG, SVG, PDF, JPEG and many more. You can specify the output format using the Accept header or can define the output format in the URL as well. 

 English