Skip to content

Node Images ​

NodePit draws the icon of every node, and you can get it as an image to use in your own documentation, wiki, or blog post. This page shows how to ask for one and what you can change about it.

Getting an image ​

Add /image and a format to the address of a node:

https://nodepit.com/api/nodes/io.qrocodile.api.designer.node.QrDesignerNodeFactory/image?imageType=svg

The API needs to know which format you want. Say so with the imageType parameter, or with an Accept header of image/svg+xml or image/png; a request with neither gets the status 406. In an address that you put into a page, use imageType: it takes precedence over the header, which a browser sets on its own.

Changing how it looks ​

These parameters change what the image looks like:

  • width and height — the size of the node in pixels. These only apply to PNG images.
  • addNodeName — draws the name of the node below it, as KNIME does on the workflow canvas.
  • executionState — draws the traffic light below the node in green, yellow, or red.
  • canvasWidth and canvasHeight — the size of the whole image. If the name does not fit, make the canvas larger.
  • backgroundColor — a color name such as white, or a hex code. The background is transparent by default.

Sizes can be up to 2,048 pixels.

TIP

The icons are dark, so on a transparent background they disappear on a dark page, such as this one in dark mode. If you cannot be sure about the color of the page you embed an image in, set a backgroundColor.

Embedding an image ​

The address below embeds a labeled node with a green traffic light in a Markdown page, on a white background:

markdown
![QR Code Designer](https://nodepit.com/api/nodes/io.qrocodile.api.designer.node.QrDesignerNodeFactory/image?imageType=png&addNodeName=true&executionState=green&canvasWidth=200&canvasHeight=120&backgroundColor=white)

Rendered, it looks like this:

The QR Code Designer node, with its name and a green traffic light

The same address works in an <img> tag, so you can use the image without saving it first. To keep a copy, download it once and serve it yourself.

Was this page helpful?