Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alderg authored Jan 9, 2024
1 parent 7a6882f commit 71b8b1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

## Library File Format

Libraries consist of an enclosing <mxlibrary> node containing a JSON array, which in turn contains entries with either an `xml` property with a compressed or uncompressed mxGraphModel or a `data` property with an image data URI (in PNG, JPG or SVG). All entries must have a `w` and `h` property for the width and height of the cell(s) or image in the entry and an optional `title` property for the title in the sidebar and preview. For entries with a `data` property, an optional `"aspect": "fixed"` may be specified to add `aspect=fixed` to the style of the image cell, and an optional `style` attribute can be specified to be added the default style of the image cell. Eg. for `"data": "data:image/png,[...]", "aspect": "fixed", "style": "resizable=0;rotatable=0;"` the resulting cell style will be `shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image=data:image/png,[...];resizable=0;rotatable=0;`
Libraries consist of an enclosing `<mxlibrary>` node containing a JSON array, which in turn contains entries with either an `xml` property with a compressed or uncompressed mxGraphModel or a `data` property with an image data URI (in PNG, JPG or SVG). All entries must have a `w` and `h` property for the width and height of the cell(s) or image in the entry and an optional `title` property for the title in the sidebar and preview. For entries with a `data` property, an optional `"aspect": "fixed"` may be specified to add `aspect=fixed` to the style of the image cell, and an optional `style` attribute can be specified to be added the default style of the image cell. Eg. for `"data": "data:image/png,[...]", "aspect": "fixed", "style": "resizable=0;rotatable=0;"` the resulting cell style will be `shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image=data:image/png,[...];resizable=0;rotatable=0;`

For uncompressed `xml` properties, `<` must be writter as `&lt;`, `>` must be written as `&gt;` and `"` must written as `\"` (escaped), eg. `"xml": "&lt;mxGraphModel&gt;&lt;root&gt;&lt;mxCell id=\"0\"/&gt;&lt;mxCell id=\"1\" parent=\"0\"/&gt;&lt;mxCell id=\"2\" value=\"Test3\" style=\"whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;\" vertex=\"1\" parent=\"1\"&gt;&lt;mxGeometry width=\"120\" height=\"60\" as=\"geometry\"/&gt;&lt;/mxCell&gt;&lt;/root&gt;&lt;/mxGraphModel&gt;"`

Expand Down

1 comment on commit 71b8b1f

@davidjgraph
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

Please sign in to comment.