Diagram / Diagram DOM / Libraries / Predefined Libraries
In This Topic

    Predefined Libraries

    In This Topic
     Shape Factories and Embedded Shape Libraries

    Nevron Open Vision (NOV) Diagram includes the following predefined shape factories and libraries:

    • NBasicShapeFactory - creates commonly used basic shapes like rectangles, ellipses, circles, stars, hexagons, etc.
    • NConnectorShapeFactory - creates various types of connectors.
    • NLibrary.FamilyTree - creates family tree shapes. Pass an ENFamilyTreeShape enum value to the Create method of the library to create a family tree shape.
    • NLibrary.Flowchart - creates flowchart shapes. Pass an ENFlowchartingShape enum value to the Create method of the library to create a flowchart shape.
    • NLibrary.OrganizationalChart - creates organizational chart (org chart) shapes. Pass an ENOrganizationalShape enum value to the Create method of the library to create an organizational chart shape. 

    The following code example demonstrates how to create shapes with shape factories and the embeded shape libraries:

    Creating shapes with shape factories and predefined libraries
    Copy Code
    NBasicShapeFactory factory = new NBasicShapeFactory();
    NShape rectangleShape = factory.CreateShape(ENBasicShape.Rectangle);
    page.Items.Add(rectangleShape);
    
    NShape decisionShape = NLibrary.Flowchart.CreateShape(ENFlowchartingShape.Decision);
    page.Items.Add(decisionShape);
    
     Shape Library Files

    NOV includes more than 350 predefined shape libraries (NLB files), which you can load and use in your applications. They are placed in the "Resources\ShapeLibraries" sub folder of your NOV installation. Take a look at the "Diagram -> Shape Libraries" NOV examples for code examples.

    To browse the predefined libraries run the NOV Examples and open the Diagram > Demo Apps and Diagrams > Diagram Designer example. Then click the button with a blue book at the top left corner of the library browser and select "Library Gallery..." from the drop down menu that opens.

    When developing a desktop application (a WinForms, a WPF or a Xamarin.Mac application), shape libraries can be distributed either as files in a "Resources\ShapeLibraries" sub folder of the application or as embedded resources in the application. For web (Blazor WebAssembly) applications, we recommend distributing shape libraries as embedded resources.

    For more information on how to load and use shape libraries take a look at the "Loading and Using Libraries" section of the Libraries topic.

    See Also