Skip to content

Conversation

@ZechyW
Copy link
Collaborator

@ZechyW ZechyW commented Jan 8, 2019

Summary of notable changes:

Conversion of project into library, various bugfixes

  • Cleaned up build process, removed hard-coded dependencies on HTML elements, and separated out the core app behaviour into a re-usable, modular library.

  • Added a demo that shows how a full UI replicating the original functionality may be built around the new library, using various other front-end libraries (viz., Bootstrap 4, Codeflask, Bootstrap-colorpicker, Bootstrap-slider, etc.)

  • Bugfixes/Enhancements/Rewrites to much of the SVG handling code, which should take care of various glitches (e.g., overlapping words/rows/links, incorrectly drawn lines, etc.)

  • Rewrote slotting and drawing code for links to minimise crossings and fix visual glitches (e.g., nested link handles falling off their bases, etc.)

New features

  • Added a new Odin parser, deprecated the old "json" parser, and fixed a number of subtle bugs in the Brat parser.

  • Added a number of configurable display options, and moved all options to a separate object so that changes can be made (and reflected) on the fly.

  • Both the main label and all argument labels can now be shown for all links; previously, only the main label was available for relation (i.e., non-trigger) links, and only the argument labels were available for event (i.e., trigger) links.

  • Added ability to toggle link and tag visibility by category.

  • Added documentation to much of the codebase, using JSDoc as a documentation-generation framework.

  • Added Jest as a testing framework, with a few proof-of-concept tests.

- Moved demo files to separate folder

- Added Express.js server for demo files

- Cleanup of Babel/ESLint/NPM dependencies

- Proof-of-Concept: Converted file upload modal to use Bootstrap 4
modals

- Updated readme
- Removed most build tasks from `package.json`
- Removed unnecessary dependencies from `package.json`
- Moved to using `runjs` as build tool
- Moved to using Sass for application styles
- Updated README
- Changed demo file organisation and build process
- Partial rewrite as library
- Change package name in `package.json` to avoid conflict with existing
`tag` package on NPM registry
- Separated core visualisation styles from general demo UI styles
- Bugfixes to demo script
- Backported more bits from original sources into library sources
- Can now display a rudimentary version of the visualisation for the
sample data
- Changed Google font import to reflect previous demo more closely

- Deprecated the native YAML parser implementation in favour of the
`js-yaml` library

- Added support for a testing framework (Jest), added tests for the YAML
parser

- No longer crashing when `taxonomy.yml` is not present (in fact, no
longer loading it by default at all)

- Interim visualisation now uses default colours on token tags (via the
taxonomy manager)
- Default build command (`npm run build`) changed to retain
compatibility with full UI version

- Parser manager now keeps a private copy of the parsed annotation data,
so that users can redraw the visualisation without reloading the entire
dataset

- Added test for the circular references within the parsed data; mocked
out `svg.draggable.js` to prevent errors with Jest
- The new demo page will show both a basic embedded example as well as
an example with a more fully-fledged UI

- Some fixes for resizing behaviour
- Split demo into basic and advanced examples

- RowManager class now properly supports multiple TAG instances on the
same page

- Added .tag-element class to most SVG elements in the visualisation for
easy referencing

- Downloaded SVGs now properly capture fonts and other imported styles
- Build: The build process will now generate both minified and full
versions of the library's JS/CSS bundles

- NPM: Updated to latest versions of Babel, added Bootstrap, Popper.js,
and Prismjs as demo dependencies

- Main: Using autobind decorator to ensure correct scope of `this`
within library functions

- Demo/Parse: Incorporated file upload modal and backing code into demo

- Demo: Included external dependencies (Bootstrap/Popper.js/Prism +
styles) directly into demo bundles to remove need to load them from
external CDNs
- Build: Watch task for demo files now produces minified output (as
implied by the output filenames)
- Partial rewrite of the Taxonomy manager code to be more
readable/intuitive, and to remove hard-coded dependencies on HTML
elements

- Support for assigning default/random colours to various labels via the
Taxonomy manager
- Users can now edit the loaded taxonomy YAML on the fly, with syntax
highlighting

- Trimmed down the generated demo JS bundle by selectively importing
parts of the Bootstrap code instead of the full bundle
- Users can now type colour codes/names manually into the colour picker
text box
- When dragging a handle under a Link that is itself an argument of
another Link, the upper Link's handles would sometimes overshoot the
lower Link's rightward bound.
- When a Link's handles are on different rows, it was sometimes possible
to end up dragging a handle on the wrong row instead of the one the user
clicked on.
- Dragging the ends of Links now works as expected with nested Links (no
more overshooting the rightward bound)

- Dragging Links across multiple rows now shows up properly.
(Previously, the Link would not be drawn across the intervening rows.)

- General clean-up, documentation, and refactoring of Link component
code

- Minor bugfixes and enhancements

- Currently, the fixes are only in place for Links without trigger
words.  Fixes for the remaining cases coming soon
- Added per-instance configuration object

- Rewrote Word movement code; should fix some buggy behaviours (e.g.,
Words moving off the left boundary of the Row, Words overlapping when
moving to new Rows, etc.)

- SVG Polylines for trigger relations still broken; fix coming soon
- Other miscellaneous spacing and SVG fixes

- Some bugs remain
- Row: Row SVG groups are now positioned relatively to their Row's
base/resize line. Added some documentation

- Word/WordTag: Fixed positioning to be relative to Row's baseline.
Fixed alignment issues. Removed extraneous padding/spacing.  Added some
documentation.

- Brat parser: Fixed issue with empty tokens being added as Words.

- Config: Added more configuration options.

- Build: Fixed bug in `runfile.js` (watch task previously failed to
detect changes to core TAG styles)

- Broke compatibility with original TAG `main.js` somewhere around here
or the previous commit (probably with the introduction of the
per-instance Config object)
- simple-brat.ann: Added test cases for various types of Links and Words

- Link: Improved handling of Link Handles and Link slot calculations

- Row: Added getters for various Row size/position attributes

- RowManager: Fixed resizing algorithm to account for Row minimum
heights

- BRAT parser: Fixed Word indexes to begin from 0 instead of 1
- Build: Irrevocably broke backwards compatibility with the old code

- Link/Row: Fixed bug with positioning Links that stretch across Rows
  with no Words.
  Fixed bug with Links with Handles on different Rows.
  Removed dead code.

- RowManager: Fixed bug with dragging Words leftwards onto previous
  Rows.
- Renamed: `processors` -> `odin`

- Styles: Removed `.polyline` class for SVG elements (misleading; these
are actually full Paths and not Polylines)

- Some optimisation of SVG-handling code

- Bugfix: Previously, large leftwards/rightwards movements of a Word
might cause it to be placed outside the right bound of its Row.

- Demo: Watch task for demo builds now produces source maps for easier
debugging

- Removed various bits of dead, debug, and deprecated code
- Demo/Options: New select menus in UI demo options pane for selecting between
categories of top/bottom Links

- Links: `.visible` attribute now indicates whether or not a Link has
been drawn onto the visualisation, not whether it *should* be.

- Links: Bugfix to slotting algorithm: Previously, Links with nested
Links might have occupied too low a slot

- Row: Added configuration option for specifying additional top padding
for Link labels (it is not trivial to get the exact amount of extra
height needed from the elements directly)

- Taxonomy: Taxonomy manager will now revert to configured default
colours when the visualisation is cleared

- Odin: Now parses RelationMentions properly
- Relation labels for Odin data comprise the labels of the two
arguments, separated by a hyphen. Because the relative order of the two
arguments is not guaranteed at execution time (they are keys of a JS
Object), we should make sure to sort them before generating the label.
- Under the full Odin spec, all Links (both Events and Relations) have
one main label and individual type labels for each argument.  Both types
of labels should be drawn for all Links.
(Previously, Event Links only had their argument labels drawn, and
Relation Links only had their main label drawn).

- Parse: Odin parses now include both label types for all Links

- Link: Both label types are initialised for all Links, but the ones not
in use are hidden for now.

- Config: Increased the Link slot interval in preparation for showing
argument labels along the vertical lines
- Deprecated provisional Reach parser in favour of general Odin parser.

- Removed Reach sample datasets, added Odin sample datasets.
- Previously, Word indices were being reset to 0 for each new
document/sentence.
- Demo: Added option for enabling/disabling argument labels

- Demo: Added bold font import for Nunito

- Links: New CSS classes for controlling the look of Link labels

- Links: New `Label` class for drawing various types of labels on or
around Links. Includes an opaque rectangular background.

- Config: Increased Link slot interval to accommodate argument labels
- Demo: Added option to hide/show main link labels

- Link: Optimised and corrected Relation link drawing algorithm

- Link: Labels are now drawn with a rounded rectangular background that
tries not to be too obtrusive
- Demo: Separated label display options for top vs. bottom links

- Links: Removed unnecessary colour overrides for label text

- Links: Corrected and optimised event relation drawing code
- Links: Distinguished between `enabled` and `visible` Links (the former
being active but not necessarily drawn yet; the latter being active and
drawn)

- RowManager: Better checks for Row size/spacing when contents change or
Rows are resized

- Row: No longer reserve vertical space for Links that are not currently
visible, allowing for more compact visualisations
- Added init parameter for overriding default options
- Demo: Updated basic example to reflect parameter for option overrides

- Styles: Removed some dead code, slightly increased size of label
background rectangles
- Links: Dragging nested Link handles now properly constrains the
handles of their parent Links again

- Styles: Slight modifications to link label backgrounds
- Links: Change to label drawing code to account for Firefox
(in)compatibility
- Demo: Use the Web Font Loader library to ensure that the fonts used
for the demo are loaded before the visualisation is drawn. Should fix
issues with minor visual glitches and inconsistencies caused by late
font loading.

- Links: Labels can now be moved by either their textual baselines or
their absolute vertical centres. Their background rectangles are now
slightly bigger (to follow the Text elements' BBoxes)

- Config: Increased the Link slot interval and inter-Row padding
defaults
- Demo: Added option to compact rows, locking their heights to the
minimum required to show links.

- Demo: Added option slider for setting the link slot interval on the
fly.

- Config: Moved all user options directly into the Config object for
easy access/modification.

- Main: Separated `.init()` and `.draw()` -- The visualisation can now
be redrawn (to account for new display options) without unduly affecting
Word/Link handle positions, etc.

- Build: Added verbose flag to demo CSS watch task
- Words: Words may now have multiple categories of tags associated with
them, and users may choose to display one category above the Word and one
below it.

- Demo: Added ability to switch top/bottom word tag categories for full
UI demo

- Words: Fixed positioning issues for Words/WordTags

- RowManager: Will now check to make sure no Words overlap when doing a
full resize

- Odin: Will now read more types of token-level annotations from Odin
data files

- Config: Added ability to set default top/bottom tags for Words
- Docs: Using JSDoc with a modified version of the Braintree
JSDoc Template for generating documentation

- Docs: Improved documentation of Configuration options, other
minor documentation tweaks

- Demo: Added link to generated documentation to demo page

- Scripts: Migrated all project scripts to the ES6 module system
(i.e., using `import` and `export` rather than `module.exports`
and `require`)

- Brat: Renamed file: `ann.js` -> `brat.js`

- Removed old code that has been superseded, added warnings to
old code that is not currently in use
@ZechyW
Copy link
Collaborator Author

ZechyW commented Jan 8, 2019

Should fix #30, close #22, close #13, and close #12.

@myedibleenso
Copy link
Collaborator

myedibleenso commented Jan 8, 2019

Awesome work, @ZechyW! I think we should aim for a first release on npm after this is merged. Now that there are tests in place, we should probably also add a CI hook.
@angusforbes, this PR includes a Travis CI config, but you'll have to enable builds for this repo on Travis for the hook to work.

myedibleenso and others added 8 commits January 8, 2019 14:02
- Taxonomy manager test now loads the `taxonomy.yml` file from the tests
folder and checks output against a snapshot.
- Worked around CORS CSS error on Chrome on download

- Downloaded SVG files now have the relevant styles applied to WordTag
lines (they were missing previously)

- Downloaded SVG files now include Google font imports for proper
display (although the main library uses the Web Font Loader to load
fonts instead)
@ZechyW ZechyW merged commit 9ccee40 into CreativeCodingLab:master Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants