42 lines
1.2 KiB
HTML
42 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<head>
|
|
<title>Flowchart test</title>
|
|
<link type="text/css" rel="stylesheet" href="../index.css" />
|
|
</head>
|
|
|
|
<body>
|
|
<h2><a href="../">DGF Tests</a></h2>
|
|
<div id="flowchart-test"></div>
|
|
</body>
|
|
<script type="module">
|
|
import { Box } from '../classes/display/box.js';
|
|
import { Scene } from '../classes/display/scene.js';
|
|
import { Actor } from '../classes/display/actor.js';
|
|
import { Action } from '../classes/display/action.js';
|
|
import { delay } from '../util/helpers.js';
|
|
|
|
const DEFAULT_DELAY_INTERVAL = 500;
|
|
|
|
const rootElement = document.getElementById('flowchart-test');
|
|
const rootBox = new Box('rootBox', rootElement).flex();
|
|
|
|
const scene = (window.scene = new Scene('Flowchart test', rootBox));
|
|
scene.withSequenceDiagram();
|
|
|
|
const actor1 = new Actor('A', scene);
|
|
const actor2 = new Actor('B', scene);
|
|
const action1 = new Action('Action 1', scene);
|
|
await action1.log(actor1, actor2);
|
|
await actor1.setDisplayValue('value', 1);
|
|
|
|
await scene.withFlowchart();
|
|
await scene.flowchart.log('A --> B');
|
|
|
|
await delay(DEFAULT_DELAY_INTERVAL);
|
|
action1.log(actor1, actor2);
|
|
|
|
await delay(DEFAULT_DELAY_INTERVAL);
|
|
await scene.flowchart.log('A --> C');
|
|
</script>
|