Contact us

Applies to: Customer's Canvas On-Premises; Customer's Canvas Hub cloud; Design Atoms JS 7.0 - 7.4; Design Atoms .NET 7.0 - 7.4

Skip to main content

Getting started

Design Atoms JS lets you iterate all items in a design, find elements, for example text elements named Date, and change their values. You can also create a new design and pass it to Design Editor.

The package doesn't work alone. Design Atoms JS needs a backend, which you can connect as described in this guide.

Installing the frontend library​

To install the frontend part of Design Atoms, just run

npm install @aurigma/design-atoms --save

Then, you can import modules to your project and start using them.

import { Product } from "@aurigma/design-atoms/Model/Product";

let product = new Product([new Surface(100, 100)]);

However, to use it for practical purposes, you need to connect a frontend to a backend.

There are two main ways to get the backend:

  • Create your own backend using the Aurigma.DesignAtoms NuGet package.
  • Hook your frontend to an existing Design Editor instance.

Creating a custom backend​

This way is a good option if you don't need the editor but rather need to manipulate designs through the JavaScript/TypeScript or C# code and render the result in your application. Also, you may want to create a custom editor based on the Viewer control. Another purpose is to handle the rendered output in a separate application.

To do so, you need to create a .NET Web API project, add a reference to Aurigma.DesignAtoms NuGet package and expose the necessary endpoints.

For reference, you can download a sample backend implementation from GitHub. You can use this sample solution as a separate object or merge it with your existing ASP.NET application.

Connecting to backend​

You can use a running instance of either a custom backend or Design Editor. To connect to your backend, add the following code.

import { Viewer } from "@aurigma/design-atoms/Viewer/Viewer";

const backendUrl = "http://<instance_url>";
const holderId = "#id-of-your-div";
const holder = document.querySelector(holderId) as HTMLDivElement;
const viewer = new Viewer({
holderElement: holder,
backendUrl: backendUrl,
canvasBackground: { color: "white" }
});
Was this page helpful?