# Quick Start

Integrate source code as specified on the installation page.

### HTML container:

Create an HTML container with ID to render the graphical context element.

Example: div as mentioned below

```
<div id="myCanvas"> </div>
```

{% embed url="<https://codepen.io/nswamy14/pen/BVxjog>" %}

### Layer Creation:

**I2Djs** provides API's for **SVG, Canvas,** and **WebGL** rendering contexts. In this example, we will be creating the Canvas context using canvasLayer API. Below API creates the **canvas** element under **"#myCanvas"** html container.

```
let renderer = i2d.canvasLayer('#myCanvas', {}, {});
```

canvasLayer API returns renderer instance, in this case Canvas renderer. It accepts parameters - **containerId**, **contextAttrObject** and **layerSettingsObject**. For more details on layer API, refer to **API Reference > Layers**&#x20;

### **Element Creation:**

Using renderer instance we will create a circle. **createEl** API is used to create the Element of type '**Circle**' with attributes and style properties as specified below.

```
let circle = renderer.createEl({
    el: 'circle',
    attr: {
        r: 50,
        cx: renderer.width / 2,
        cy: renderer.height / 2
    },
    style: {
        fillStyle: '#ff0000'
    }
})
```

### Animation:

To animate circle properties we use **animateTo** API. In the below example **radius** and **fillStyle** are being animated for 500 milliseconds.

```
circle.animateTo({
    duration: 500,
    ease: 'easeInOutSin',
    attr: {
        r: 200
    },
    style: {
        fillStyle: '#00ff00'
    }
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nswamy14.gitbook.io/i2djs-v5/getting-started/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
