Skip to content

Commit 1c056e8

Browse files
committed
hoist the config
1 parent 93ca5e3 commit 1c056e8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ const roomId = '!MMLsEB4klBO4GToM:bucephalus';
1414

1515
window.onload = async (event) => {
1616
const limit = 300000;
17+
const showStateEvents = true;
18+
const showAuthDag = true;
19+
const hideMissingEvents = false;
20+
const hideOrphans = false;
21+
22+
const width = 1920;
23+
const height = 2920;
24+
1725
const events = {};
1826
const latestEventsAndState = await postData(
1927
`${host}/api/roomserver/queryLatestEventsAndState`,
2028
{ 'room_id': roomId },
2129
);
2230

23-
const showStateEvents = false;
2431
// grab the state events
2532
if (showStateEvents) {
2633
for (const event of latestEventsAndState.state_events) {
@@ -79,7 +86,6 @@ window.onload = async (event) => {
7986
}
8087
} while(missing);
8188

82-
const hideMissingEvents = true;
8389
// tag events which receive multiple references
8490
for (const event of Object.values(events)) {
8591
if (hideMissingEvents) {
@@ -127,7 +133,6 @@ window.onload = async (event) => {
127133

128134
//console.log(JSON.stringify(events));
129135

130-
const showAuthDag = false;
131136
let parentIdFn;
132137
if (showAuthDag) {
133138
parentIdFn = (event) => event.prev_events.concat(event.auth_events.filter(id=>id!=rootId));
@@ -144,17 +149,13 @@ window.onload = async (event) => {
144149

145150
console.log(dag);
146151

147-
const hideOrphans = true;
148152
if (hideOrphans) {
149153
if (dag.id === undefined) {
150154
// our root is an undefined placeholder, which means we have orphans
151155
dag.children = dag.children.filter(node=>(node.children.length > 0));
152156
}
153157
}
154158

155-
const width = 2000;
156-
const height = 4000;
157-
158159
const nodeRadius = 10;
159160
const margin = nodeRadius * 4;
160161
const svgNode = document.createElementNS("http://www.w3.org/2000/svg", "svg");

0 commit comments

Comments
 (0)