Fixup missing flowcharts

This commit is contained in:
Ladd Hoffman 2023-02-06 08:35:48 -06:00
parent fc27cda81d
commit 92cfdaaa63
4 changed files with 14 additions and 5 deletions

View File

@ -15,11 +15,10 @@ const BALANCE = 'balance';
*/ */
export class Forum extends ReputationHolder { export class Forum extends ReputationHolder {
constructor(dao, name, scene) { constructor(dao, name, scene) {
super(name, scene); super(name, scene);
this.dao = dao; this.dao = dao;
this.id = this.reputationPublicKey; this.id = this.reputationPublicKey;
this.posts = new WDAG(); this.posts = new WDAG(scene);
this.actions = { this.actions = {
propagate: new Action('propagate', scene), propagate: new Action('propagate', scene),
confirm: new Action('confirm', scene), confirm: new Action('confirm', scene),

View File

@ -0,0 +1,9 @@
import { MermaidDiagram } from './mermaid.js';
export class Flowchart extends MermaidDiagram {
constructor(box, logBox, direction = 'BT') {
super(box, logBox);
this.log(`graph ${direction}`, false);
}
}

View File

@ -3,6 +3,7 @@ import { CryptoUtil } from '../util/crypto.js';
import { MermaidDiagram } from './mermaid.js'; import { MermaidDiagram } from './mermaid.js';
import { SequenceDiagram } from './sequence.js'; import { SequenceDiagram } from './sequence.js';
import { Table } from './table.js'; import { Table } from './table.js';
import { Flowchart } from './flowchart.js';
export class Scene { export class Scene {
constructor(name, rootBox) { constructor(name, rootBox) {
@ -30,7 +31,6 @@ export class Scene {
this.box.addBox('Spacer').setInnerHTML(' '); this.box.addBox('Spacer').setInnerHTML(' ');
const logBox = this.box.addBox('Sequence diagram text').addClass('dim'); const logBox = this.box.addBox('Sequence diagram text').addClass('dim');
this.sequence = new SequenceDiagram(box, logBox); this.sequence = new SequenceDiagram(box, logBox);
this.sequence.log('sequenceDiagram', false);
return this; return this;
} }
@ -38,8 +38,7 @@ export class Scene {
const box = this.topSection.addBox('Flowchart').addClass('padded'); const box = this.topSection.addBox('Flowchart').addClass('padded');
this.box.addBox('Spacer').setInnerHTML(' '); this.box.addBox('Spacer').setInnerHTML(' ');
const logBox = this.box.addBox('Flowchart text').addClass('dim'); const logBox = this.box.addBox('Flowchart text').addClass('dim');
this.flowchart = new MermaidDiagram(box, logBox); this.flowchart = new Flowchart(box, logBox, direction);
this.flowchart.log(`graph ${direction}`, false);
return this; return this;
} }

View File

@ -6,6 +6,8 @@ export class SequenceDiagram extends MermaidDiagram {
super(...args); super(...args);
this.activations = []; this.activations = [];
this.sections = []; this.sections = [];
this.log('sequenceDiagram', false);
} }
async log(...args) { async log(...args) {