mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 01:58:27 +00:00
38 lines
651 B
JavaScript
38 lines
651 B
JavaScript
import Core from './../src/index';
|
|
import { getData } from './data.js';
|
|
|
|
console.log('Core =', Core);
|
|
|
|
var opts = {
|
|
width: 300,
|
|
height: 200,
|
|
contextWidth: 300,
|
|
contextHeight: 200,
|
|
devicePixelRatio: 4
|
|
};
|
|
// var config = {
|
|
// elementWrapper: {
|
|
// controllerSize: 4,
|
|
// }
|
|
// }
|
|
|
|
const mount = document.querySelector('#mount');
|
|
const data = getData();
|
|
const core = new Core(
|
|
mount,
|
|
Object.assign({}, opts, {
|
|
contextWidth: 500,
|
|
contextHeight: 400
|
|
}),
|
|
{
|
|
scrollWrapper: {
|
|
use: true
|
|
}
|
|
}
|
|
);
|
|
core.setData(data);
|
|
|
|
const elem1 = core.getData().elements[1];
|
|
elem1.desc.text = 'Updated';
|
|
|
|
core.updateElement(elem1);
|