Skip to content

Commit 9fffbce

Browse files
committed
WordClusters now work properly; other fixes
- Added simple test document for Reach parser - Link: Handle Links that have WordClusters as anchors - Row: Redraw WordClusters properly on resize - WordCluster: WordClusters are now drawn and positioned properly. - Word: Now initialised with a reference to the main API instance (so that WordClusters have access to the RowManager for calculating line positions) - Build: Fixed bug with demo watch task -- It was not picking up changes to the core TAG styles properly.
1 parent b9ab2b0 commit 9fffbce

File tree

21 files changed

+469
-246
lines changed

21 files changed

+469
-246
lines changed

demo/data/test-reach.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"eventData": {
3+
"comments": [
4+
"This is a simple test of the Reach parser.",
5+
"It focuses on testing WordClusters and associated Links.",
6+
"For more general tests, see the BRAT parser test (`test-brat.ann`).",
7+
"",
8+
"N.B.: As currently written, the Reach parser relies on `.syntaxData`",
9+
"for the tokenisation of the text string."
10+
],
11+
"entities": [
12+
["T1", "Tag 1", [["0", "4"]]],
13+
["T2", "Cluster 1", [["10", "22"]]]
14+
],
15+
"attributes": [],
16+
"text": "This is a word cluster test. This is a word cluster test.",
17+
"relations": [],
18+
"triggers": [],
19+
"events": []
20+
},
21+
"syntaxData": {
22+
"comments": [],
23+
"entities": [
24+
["T1", "DT", [["0", "4"]]],
25+
["T2", "VBZ", [["5", "7"]]],
26+
["T3", "DT", [["8", "9"]]],
27+
["T4", "NN", [["10", "14"]]],
28+
["T5", "NN", [["15", "22"]]],
29+
["T6", "NN", [["23", "27"]]],
30+
["T7", ".", [["27", "28"]]],
31+
["T8", "DT", [["29", "33"]]],
32+
["T9", "VBZ", [["34", "36"]]],
33+
["T10", "DT", [["37", "38"]]],
34+
["T11", "NN", [["39", "43"]]],
35+
["T12", "NN", [["44", "51"]]],
36+
["T13", "NN", [["52", "56"]]],
37+
["T14", ".", [["56", "57"]]]
38+
],
39+
"attributes": [],
40+
"text": "This is a word cluster test. This is a word cluster test.",
41+
"relations": [],
42+
"triggers": [],
43+
"events": []
44+
}
45+
}

demo/demo.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/demo.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/demo.min.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/src/demo.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ $(async () => {
6262

6363
// Debug
6464
window.basicTag = basicTag;
65-
await basicTag.loadUrlAsync("data/simple-brat.ann", "brat");
65+
await basicTag.loadUrlAsync("data/test-brat.ann", "brat");
6666

6767
// -------------------
6868
// Advanced/UI example
@@ -76,6 +76,9 @@ $(async () => {
7676
const sampleData = require("../data/data1.json");
7777
uiTag.loadData(sampleData, "json");
7878

79+
// Debug
80+
await uiTag.loadUrlAsync("data/test-reach.json", "json");
81+
7982
// --------------------------------------------------------------------------
8083

8184
// Data from an external URL can also be loaded into the visualisation

dist/tag/css/tag.css

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tag/css/tag.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tag/js/tag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43503,7 +43503,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
4350343503

4350443504
var _word = _interopRequireDefault(require("../components/word.js"));
4350543505

43506-
var _wordcluster = _interopRequireDefault(require("../components/wordcluster.js"));
43506+
var _wordcluster = _interopRequireDefault(require("../components/word-cluster.js"));
4350743507

4350843508
var _link = _interopRequireDefault(require("../components/link.js"));
4350943509

runfile.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,18 +411,20 @@ const demo = {
411411

412412
console.log(`\n[${colourType(type)}: ${colourOutput(output)}] ${colourInfo(desc)}`);
413413

414-
return run(`chokidar ${input} --initial -c "sass ${input} ${output} && postcss ${output} --use autoprefixer --replace && cleancss ${output} -o ${output}"`, {async: true});
414+
return run(`chokidar ${input} -c "sass ${input} ${output} && postcss ${output} --use autoprefixer --replace && cleancss ${output} -o ${output}"`, {async: true});
415415
},
416416

417417
async coreStyles() {
418418
const input = "src/css/tag.scss";
419419
const output = `${config.assetsDir}/${config.stylesDir}/tag.css`;
420+
const input2 = "demo/src/demo.scss";
421+
const output2 = `demo/demo.min.css`;
420422
const type = "Build";
421423
const desc = "Main TAG CSS bundle (Unminified)";
422424

423425
console.log(`\n[${colourType(type)}: ${colourOutput(output)}] ${colourInfo(desc)}`);
424426

425-
return run(`chokidar ${input} --initial -c "sass ${input} ${output} && postcss ${output} --use autoprefixer --replace`, {async: true});
427+
return run(`chokidar ${input} --initial -c "sass ${input} ${output} && postcss ${output} --use autoprefixer --replace && sass ${input2} ${output2} && postcss ${output2} --use autoprefixer --replace && cleancss ${output2} -o ${output2}`, {async: true});
426428
},
427429

428430
async all() {

0 commit comments

Comments
 (0)