Treedraw Documentation

Current version

Sandiway Fong. The University of Arizona. January 14th 2017.

(To see installed version, hover over (or touch) TreeDraw.)

Usage: no-install version


Safari on MacOS Sierra

Mobile Safari on iOS 10

Either download the file Tree Draw (remote).html to your device and load it into your browser or just click the link. Enter a bracketed expression (syntax given below) and hit ⮐ or Send. Rendered trees (in png format) may be dragged to other apps (MacOS) or saved (Control-Click:MacOS or long press:iOS).

Notes:

Bracketed Expression Syntax

Syntax: Examples 1-3: Examples 4 and 5: Example 6:
node = [labelterminal+ | node*]

Notes:
■ no space permitted between [ and label
* = zero or more occurrences
+ = one or more occurrences
■| = or
■ ␣ = space(s)
label and terminal should not contain spaces, square brackets, or double quotes (single quotes and round brackets are ok)

Underscore (_), see examples 2, 4 and 6:
■ _word = word
■ word1_word2 = word1word2
■ _ = ␣ (blank)
■ _N_ = ␣ (blank N characters long)

[a[b][c d]]

[a [b][_]]

label _ is a zero-length blank.

[a [b]]

[Adv by and large]

by and large is a multi-word terminal.
when k>1 in terminalk, a triangle is drawn.

cf. [Adv [by][and][large]]

[<ɸ,ɸ>[DP_i 香港][T[T][v*[_DP_i _香港][v*[v*][β _10_ _]]]]]

香港 is a single word.
β dominates an empty multi-word consisting of _10_ (= a 10 character blank) plus _ (= a zero-length blank).
(If the websocket interface is operating, pid⮐ displays the process ID.)

Usage: MacOS version

Download the app here (6.4MB). Double-click it. You should see the same webpage appear.

Debugging

There is no dock icon. The back-end process named treedrawpl runs as a daemon. Enter pid to see the treedrawpl process number. If nothing is displayed, the back-end may not be running.1



1To check whether treedrawpl is running, use Activity Monitor or Terminal with ps -e | grep treedrawpl.

How it works

The program consists of a front-end and a back-end. The back-end program communicates via a websocket interface ws://host:8019/ to your browser. 8019 is the arbitrarily agreed-upon port number that hosts the socket. The program receives bracketed expressions from the browser and computes the layout of the trees. The front-end displays trees using the built-in html5 graphics in your browser, i.e. the browser functions as the GUI.

According to wikipedia (here), Safari 5/6, Firefox 6,IE 10, Chrome 14, Opera 12.10 and onwards fully support websockets. As long your browser support websockets, and that should be the case from about 2011 on, the program should work using your browser as the front-end.

The no-install version uses a back-end hosted at Osaka Kyoiku University (host=language.cc.osaka-kyoiku.ac.jp). 2 Advantage: no installation required and any computer/phone/tablet with a html5 browser should work. Disadvantages: your device must be able to access the internet and port 8019 for the websocket must not be blocked.

The MacOS version runs the back-end locally on your Mac (host=localhost). Advantages: no internet access required and runs much faster. Disadvantage: the program was developed on MacOS Sierra. Therefore only MacOS Sierra is supported and earlier versions of MacOS/OS X may not work.



2Thanks to Jason Ginsburg for hosting the back-end at Osaka Kyoiku University.