Skip to content

modifyElement

Introduction

The modifyElement method modify graphic elements and triggers re-rendering of the canvas.

Arguments

  • {object} element

Returns

None

Usage

js
import { iDraw } from 'idraw';

const data = {
  elements: [
    // ....
  ]
};
const app = document.querySelector('#app');
const options = {
  width: 600,
  height: 400,
  devicePixelRatio: 2
};
const idraw = new iDraw(app, options);
idraw.setData(data);

// ...

idraw.modifyElement({
  uuid: 'xxxxx',
  detail: {
    background: '#f0f0f0'
  }
});

Example

More demo >>