2021-12-05 17:33:09 +01:00
|
|
|
import $ from 'jquery';
|
2021-12-05 00:39:20 +01:00
|
|
|
import {
|
2021-12-30 21:32:32 +01:00
|
|
|
Workspace, CurvedLine, Point,
|
2021-12-05 00:39:20 +01:00
|
|
|
} from '../../src';
|
|
|
|
|
2021-12-30 21:32:32 +01:00
|
|
|
const workspace = new Workspace({ fillColor: 'green' });
|
|
|
|
workspace.setSize('400px', '400px');
|
2021-12-05 00:39:20 +01:00
|
|
|
const line1 = new CurvedLine();
|
|
|
|
line1.setStyle(CurvedLine.SIMPLE_LINE);
|
|
|
|
line1.setFrom(200, 200);
|
|
|
|
line1.setTo(100, 100);
|
|
|
|
line1.setSrcControlPoint(new Point(-100, 0));
|
|
|
|
line1.setDestControlPoint(new Point(100, 0));
|
2021-12-30 21:32:32 +01:00
|
|
|
workspace.append(line1);
|
2021-12-05 00:39:20 +01:00
|
|
|
|
|
|
|
const line2 = new CurvedLine();
|
|
|
|
line2.setStyle(CurvedLine.NICE_LINE);
|
|
|
|
line2.setFrom(0, 0);
|
|
|
|
line2.setTo(150, 90);
|
|
|
|
line2.setSrcControlPoint(new Point(100, 0));
|
|
|
|
line2.setDestControlPoint(new Point(-100, 0));
|
2021-12-30 21:32:32 +01:00
|
|
|
workspace.append(line2);
|
2021-12-05 00:39:20 +01:00
|
|
|
|
2022-01-26 20:25:11 +01:00
|
|
|
workspace.addItAsChildTo($('#overflowExample').first());
|