1. Products
  2.   Diagram
  3.   Node.js
  4.   Aspose.Diagram Cloud SDK for Node.js

Aspose.Diagram Cloud SDK for Node.js

 
 

Node.js REST API to Generate & Manipulate Visio Diagrams

A Powerful Node.js Library That allows to Develop Cloud-based Applications for Creating, Editing, Manipulating and Converting Microsoft Visio VSDX, VDX & VSX Diagrams via JavaScript.

Many organizations rely on diagrams to visualize complex data and processes. Microsoft Visio is a leading tool for creating and sharing such diagrams, but manipulating these files programmatically has traditionally been challenging, especially when working in a cloud-based environment. With the growing demand for cloud-native solutions, the Aspose.Diagram SDK for Node.js provides the perfect solution for software developers aiming to build diagram-centric applications. It simplifies working with Visio file formats like VSD, VSDX, and many more, allowing businesses to handle their diagram workflows efficiently.

Aspose.Diagram Cloud SDK for Node.js provides a comprehensive solution for handling Microsoft Visio diagram files in a cloud-based environment. It allows software developers to create, read, modify, manipulate, and convert Visio diagrams without needing Microsoft Visio installed on the server. The SDK simplifies working with various diagramming formats, such as VSDX, VDX, VSDM, VSSX, VSSM, VSTX, VSTM, VTX, VDX, and other diagram formats while integrating seamlessly into Node.js applications. There are several important features part of the library, such as creating Visio diagrams from scratch, conversion of Visio files to various formats, modifying existing diagrams, extracting diagrams data, version control features support, customizing shapes and many more.

Aspose.Diagram Cloud SDK for Node.js is more than just a tool for working with diagrams—it’s a foundation for building complex, scalable applications. From automating diagram creation to enabling seamless integration with other cloud services, software developers can create solutions that streamline workflows, enhance productivity, and improve data visualization. By providing an easy-to-use API, robust cloud infrastructure, and support for a wide range of diagram operations, this SDK simplifies working with Visio diagrams in any Node.js application. Dive into the comprehensive documentation and start crafting stunning diagrams today!

Previous Next

Getting Started with Aspose.Diagram Cloud SDK for Node.js

The recommend way to install Aspose.Diagram Cloud SDK for Node.js is using NPM. Please use the following command for a smooth installation.

Install Aspose.Diagram Cloud SDK for Node.js via npm

npm install aspose.diagram

You can download the library directly from Aspose.Diagram product page

Create Visio Diagrams in Node.js Programmatically

Aspose.Diagram Cloud SDK for Node.js has provided complete support for creating Visio diagrams from scratch inside Node.js applications. This capability is useful for applications that need to dynamically generate diagrams based on user input, data processing, or automation scripts. For example, imagine an application that creates organizational charts based on user data input. The SDK allows developers to programmatically add shapes, connectors, and define their properties such as position, size, and rotation. Here is an example that shows, how software developers can create a nee diagram inside Node.js applications.

How to Create a Visio Diagram inside Node.js Apps

var aspose = aspose || {};

aspose.diagram = require("aspose.diagram"); 

var diagram = new aspose.diagram.Diagram();

diagram.save("output.vsdx", aspose.diagram.SaveFileFormat.VSDX);

Visio Diagram Conversion in Node.js

In many scenarios, diagrams need to be shared in different formats. The Aspose.Diagram Cloud SDK for Node.js supports conversion of Visio files to various other supported file formats such as PDF, SVG, PNG, GIF, JPEG and many more. This feature allows developers to build applications where users can upload a diagram and download it in a preferred format. The following example shows how easily software developers can convert an existing Visio diagram into PNG file formats inside Node.js.

How to Export Visio Diagram into PNG Image inside Node.js Apps?

const diagram = new Diagram('myDiagram.vsdx');
diagram.exportTo('myDiagram.png', 'png');

Visio Diagram Data Extracting in Node.js

In some cases, software developers may need to analyze diagram structures and extract detailed information from a diagram. Aspose.Diagram Cloud SDK for Node.js provides APIs to programmatically retrieve shape data, page information, layer details, and other elements from existing Visio diagrams inside Node.js application. This is useful for creating reports or integrating diagrams with other business systems. For example, an application could extract shapes and connectors from a workflow diagram to generate a textual summary of the process. The following example demonstrates how software developers can Extract Shape Data inside Node.js applications.

How to Extract Shape Data from Visio Diagram inside Node.js Environment?

const getShapeInfo = async () => {
    try {
        const shapeInfo = await diagramApi.getShape("diagram.vsdx", "Page-1", 1);
        console.log("Shape info:", shapeInfo);
    } catch (error) {
        console.error("Error retrieving shape info:", error);
    }
};
getShapeInfo();

Manipulate Visio Diagrams in Node.js Apps?

Aspose.Diagram Cloud SDK for Node.js allows software developers to load and manipulate existing diagrams with ease inside Node.js environment. You can add, remove, or edit shapes and their properties. Additionally, users can manipulate diagram pages, layers, connectors, and formatting properties directly through the SDK. Here is a simple example that shows how programmers can add a shape to a diagram inside Node.js applications.

How to Add a Shape to a Diagram via Node.js Library?

const addShape = async () => {
    try {
        const shapeData = {
            shapeId: 1,
            pageName: "Page-1",
            x: 2,
            y: 2,
            width: 2,
            height: 2
        };
        const response = await diagramApi.addShape("sample.vsdx", shapeData);
        console.log(response);
    } catch (error) {
        console.error("Error adding shape:", error);
    }
};
addShape();