LayoutOptions
Source: aspose.
Used to specify style and additional options of layout of shapes to perform Re-Layout of page(pages).
new LayoutOptions()
Initializes a new instance of LayoutOptions.
Example
var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("LayOutShapesInCompactTreeStyle.vdx");
// set layout options
compactTreeOptions = new aspose.diagram.LayoutOptions();
compactTreeOptions.setLayoutStyle(aspose.diagram.LayoutStyle.COMPACT_TREE);
compactTreeOptions.setEnlargePage(true);
// set layout direction as DownThenRight and then save
compactTreeOptions.setDirection(aspose.diagram.LayoutDirection.DOWN_THEN_RIGHT);
diagram.layout(compactTreeOptions);
diagram.save("out-sample_down_right.vdx", aspose.diagram.SaveFileFormat.VDX);
// set layout direction as DownThenLeft and then save
diagram = new aspose.diagram.Diagram("LayOutShapesInCompactTreeStyle.vdx");
compactTreeOptions.setDirection(aspose.diagram.LayoutDirection.DOWN_THEN_LEFT);
diagram.layout(compactTreeOptions);
diagram.save("out-sample_down_left.vdx", aspose.diagram.SaveFileFormat.VDX);
// set layout direction as RightThenDown and then save
diagram = new aspose.diagram.Diagram("LayOutShapesInCompactTreeStyle.vdx");
compactTreeOptions.setDirection(aspose.diagram.LayoutDirection.RIGHT_THEN_DOWN);
diagram.layout(compactTreeOptions);
diagram.save("out-sample_right_down.vdx", aspose.diagram.SaveFileFormat.VDX);
// set layout direction as LeftThenDown and then save
diagram = new aspose.diagram.Diagram("LayOutShapesInCompactTreeStyle.vdx");
compactTreeOptions.setDirection(aspose.diagram.LayoutDirection.LEFT_THEN_DOWN);
diagram.layout(compactTreeOptions);
diagram.save("out-LayOutShapesInCompactTreeStyle.vdx", aspose.diagram.SaveFileFormat.VDX);
Methods
getDirection()
Used to set direction of shapes layout. The value of the property is LayoutDirection integer constant. Default value is TopToBottom.
getEnlargePage()
Defines whether need enlarge page to fit drawing or not. Default value is false.
getLayoutStyle()
Used to specify style of layout. The value of the property is LayoutStyle integer constant. Default value is FlowChart.
getSpaceShapes()
Defines the spacing between the shapes in inches. Default value 0.3 inch ~ 7.5 mm.
setDirection()
Used to set direction of shapes layout. The value of the property is LayoutDirection integer constant. Default value is TopToBottom.
setEnlargePage()
Defines whether need enlarge page to fit drawing or not. Default value is false.
setLayoutStyle()
Used to specify style of layout. The value of the property is LayoutStyle integer constant. Default value is FlowChart.
setSpaceShapes()
Defines the spacing between the shapes in inches. Default value 0.3 inch ~ 7.5 mm.