1+ import * as SVG from 'svg.js' ;
12import Parser from './parser.js' ;
3+ import TreeLayout from './treelayout.js' ;
4+ import ymlToJson from './ymljson.js' ;
25import LabelManager from './managers/labelmanager.js' ;
36import RowManager from './managers/rowmanager.js' ;
47import Taxonomy from './managers/taxonomy.js' ;
58import Tooltip from './managers/tooltip.js' ;
9+ import Word from './components/word.js' ;
10+ import WordCluster from './components/wordcluster.js' ;
11+ import Link from './components/link.js' ;
612
713const Main = ( function ( ) {
814 // classes
@@ -33,10 +39,9 @@ const Main = (function() {
3339 */
3440 function init ( ) {
3541 // setup
36- body = document . body . getBoundingClientRect ( ) ;
37- svg = SVG ( 'main' )
42+ let body = document . body . getBoundingClientRect ( ) ;
43+ svg = new SVG . Doc ( 'main' )
3844 . size ( body . width , window . innerHeight - body . top - 10 ) ;
39-
4045 tooltip = new Tooltip ( 'tooltip' , svg ) ;
4146 parser = new Parser ( ) ;
4247 rm = new RowManager ( svg ) ;
@@ -317,7 +322,6 @@ const Main = (function() {
317322 w . setSyntaxId ( token . id ) ;
318323 return w ;
319324 } ) ;
320- console . log ( 'words' , words ) ;
321325 const clusters = [ ] ;
322326
323327 [ ] . concat ( parser . data . entities , parser . data . triggers ) . forEach ( el => {
@@ -360,7 +364,7 @@ const Main = (function() {
360364 parser . data . events . forEach ( evt => {
361365 // create a link between the trigger and each of its args
362366 const trigger = entities . find ( word => word . eventIds . indexOf ( evt . trigger ) > - 1 ) ;
363- const args = evt . args . map ( searchForEntity ) ;
367+ const args = evt . arguments . map ( searchForEntity ) ;
364368
365369 // create link
366370 const link = new Link ( evt . id , trigger , args ) ;
@@ -370,7 +374,7 @@ const Main = (function() {
370374 } ) ;
371375
372376 parser . data . relations . forEach ( rel => {
373- const args = rel . args . map ( searchForEntity ) ;
377+ const args = rel . arguments . map ( searchForEntity ) ;
374378 // create link
375379 const link = new Link ( rel . id , null , args , rel . type ) ;
376380
@@ -382,7 +386,7 @@ const Main = (function() {
382386 parser . data . syntax . forEach ( syn => {
383387 // create a link between the trigger and each of its args
384388 const trigger = entities . find ( word => word . syntaxId === syn . trigger ) ;
385- const args = syn . args . map ( arg => {
389+ const args = syn . arguments . map ( arg => {
386390 let anchor = words . find ( w => w . syntaxId === arg . id ) ;
387391 return { anchor, type : arg . type } ;
388392 } ) ;
@@ -491,6 +495,7 @@ const Main = (function() {
491495 // document.getElementById('pos--all').checked = true;
492496 // }
493497
498+
494499 // export public functions
495500 return {
496501 init,
@@ -500,4 +505,4 @@ const Main = (function() {
500505
501506} ) ( ) ;
502507
503- Main . init ( ) ;
508+ Main . init ( ) ;
0 commit comments