getValues

retrieves current values of Diagram Editor

void getValues();

Example

const data = $$("editor").getValues();
$$("diagram").parse(data);

Related samples

Details

The method returns an object with the following fields:

  • data (array) - an array with block data
  • links (array) - an array with link data
  • shapes (array) - an array with all shapes currently used in this Diagram (default and custom ones)
  • item (object) - a set of the default properties that are applied to Diagram blocks unless they have the corresponding settings of their own
  • linkItem (object) - a set of the default properties that are applied to Diagram links unless they have the corresponding settings of their own.

Data sample

{
  data:[
    { id: "start", type: "circle", value: "start",  x: 0, y: 80 },
    // other blocks
  ],
  links: [ 
    { source: "start", target: "search", id: 132 },
    // other links
  ],
  shapes: [ 
    {
      backgroundColor: "#65C0B7", fontColor: "#fff",
      group: "block", id: "circle",
      lineColor: "#65C0B7", name: "Circle",
      svg: "svg_code"
    },
    // other shapes
  ],
  item: { 
    height: 50, width: 100
  },
  linkItem: { 
    arrowSize: 6, arrow: false, 
    mode: "edges", backgroundColor: "magenta"
  }
}
See also
Back to top