JSON Canvas Spec

JSON Canvas is an open file format for infinite canvas data, structured using nodes and edges to ensure interoperability between different visual tools.
Version 1.0 — 2024-03-11
The top level of JSON Canvas contains two arrays:
nodes (optional, array of nodes)
edges (optional, array of edges)
Nodes are objects within the canvas. Nodes may be text, files, links, or groups. Nodes are placed in the array in ascending order by z-index. The first node in the array should be displayed below all other nodes, and the last node in the array should be displayed on top of all other nodes.
All nodes include the following attributes:
id(required, string) is a unique ID for the node.type(required, string) is the node type (text, file, link, group).x,y(required, integer) is the position of the node in pixels.width,height(required, integer) is the size of the node in pixels.color(optional, canvasColor) is the color of the node.
Text type nodes store text in plain text with Markdown syntax. File type nodes reference other files or attachments. Link type nodes reference a URL. Group type nodes are used as a visual container for nodes within it, supporting labels and background images.
Edges are lines that connect one node to another. They require an id, fromNode, and toNode. Optional attributes include fromSide, toSide, fromEnd, toEnd, color, and label to define the connection's appearance and direction.
The canvasColor type is used to encode color data. Colors can be specified in hex format or using one of the six preset colors (1-6). Specific values for preset colors are intentionally not defined so that applications can tailor them to their specific brand colors.
Source: Hacker News












