aspose.diagram

Class LayoutOptions

Used to specify style and additional options of layout of shapes to perform Re-Layout of page(pages).

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);

Constructor Summary
LayoutOptions()
Initializes a new instance of LayoutOptions.
 
Property Getters/Setters Summary
functiongetDirection()
function
           Used to set direction of shapes layout. The value of the property is LayoutDirection integer constant.
functiongetEnlargePage()
function
           Defines whether need enlarge page to fit drawing or not.
functiongetLayoutStyle()
function
           Used to specify style of layout. The value of the property is LayoutStyle integer constant.
functiongetSpaceShapes()
function
           Defines the spacing between the shapes in inches.
 

    • Constructor Detail

      • LayoutOptions

        function LayoutOptions()
        Initializes a new instance of LayoutOptions.
    • Property Getters/Setters Detail

      • getLayoutStyle/setLayoutStyle : Number 

        function getLayoutStyle() / function setLayoutStyle(value)
        
        Used to specify style of layout. The value of the property is LayoutStyle integer constant. Default value is FlowChart.
      • getDirection/setDirection : Number 

        function getDirection() / function setDirection(value)
        
        Used to set direction of shapes layout. The value of the property is LayoutDirection integer constant. Default value is TopToBottom.
      • getSpaceShapes/setSpaceShapes : Number 

        function getSpaceShapes() / function setSpaceShapes(value)
        
        Defines the spacing between the shapes in inches. Default value 0.3 inch ~ 7.5 mm.
      • getEnlargePage/setEnlargePage : boolean 

        function getEnlargePage() / function setEnlargePage(value)
        
        Defines whether need enlarge page to fit drawing or not. Default value is false.