Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension of the Tree Annotation Tool #28

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c634abd
Delete screenshot.jpg
kreslotim Jul 20, 2023
6a0cc1e
screenshot
kreslotim Jul 20, 2023
de3ce61
Delete screenshot.png
kreslotim Jul 20, 2023
0a8dcba
Add files via upload
kreslotim Jul 20, 2023
bf848b4
Delete resources/public/css directory
kreslotim Jul 20, 2023
02f1390
Add files via upload
kreslotim Jul 20, 2023
d078671
Delete screenshot.jpg
kreslotim Jul 20, 2023
5bec8f8
good screenshot
kreslotim Jul 20, 2023
abafbd4
Update deploy.yml
kreslotim Jul 24, 2023
66c86b1
Update deploy.yml
kreslotim Jul 24, 2023
a8e7d7c
Update deploy.yml
kreslotim Jul 24, 2023
d20be22
Update deploy.yml
kreslotim Jul 24, 2023
7c5df28
Delete style.css
kreslotim Jul 24, 2023
24d3f60
Add files via upload
kreslotim Jul 24, 2023
0613498
Delete core.cljs
kreslotim Jul 24, 2023
866e7a2
Delete database.cljs
kreslotim Jul 24, 2023
51d88ce
Add files via upload
kreslotim Jul 24, 2023
3108bdb
Delete core.cljs
kreslotim Jul 25, 2023
13d0654
Delete database.cljs
kreslotim Jul 25, 2023
bce5055
Add files via upload
kreslotim Jul 25, 2023
03a1c47
Delete style.css
kreslotim Jul 25, 2023
19351bb
Add files via upload
kreslotim Jul 25, 2023
ad95ee4
Update core.cljs
kreslotim Jul 25, 2023
ab8d3b8
Update index.html
kreslotim Jul 25, 2023
a024b0b
Update core.cljs
kreslotim Jul 26, 2023
bb631ab
Update database.cljs
kreslotim Jul 26, 2023
4e68f82
Update style.css
kreslotim Jul 26, 2023
e83fd2a
Delete screenshot.jpg
kreslotim Jul 26, 2023
bf82d35
screenshot
kreslotim Jul 26, 2023
32e1427
Update core.cljs
kreslotim Jul 26, 2023
9391459
Delete screenshot.jpg
kreslotim Jul 26, 2023
f478d57
screenshot
kreslotim Jul 26, 2023
4748c0e
right arrow update style.css
kreslotim Jul 26, 2023
e4371ce
Delete screenshot.jpg
kreslotim Jul 26, 2023
c18f7bb
Add files via upload
kreslotim Jul 26, 2023
513933b
Update core.cljs
kreslotim Jul 26, 2023
ed67133
Update database.cljs
kreslotim Jul 26, 2023
449eadc
Update style.css
kreslotim Jul 26, 2023
f625d41
Update core.cljs
kreslotim Jul 27, 2023
e906c9b
Update core.cljs
kreslotim Jul 27, 2023
92d0f17
Update core.cljs
kreslotim Jul 28, 2023
106d7fe
Update database.cljs
kreslotim Jul 28, 2023
93a3cd7
Update style.css
kreslotim Jul 28, 2023
210dd9b
Update index.html
kreslotim Jul 28, 2023
ffbdc5c
Update style.css
kreslotim Jul 28, 2023
3b3c77d
Update core.cljs
kreslotim Jul 28, 2023
6aea6af
Update core.cljs
kreslotim Jul 28, 2023
61e7274
Update database.cljs
kreslotim Jul 28, 2023
a7dbc45
Update index.html
kreslotim Jul 28, 2023
478b4c0
Update core.cljs
kreslotim Jul 28, 2023
e8b2f00
Update database.cljs
kreslotim Jul 28, 2023
fb64fc6
Update core.cljs
kreslotim Jul 31, 2023
b4c6194
Delete screenshot.jpg
kreslotim Aug 2, 2023
8c32e15
Add files via upload
kreslotim Aug 2, 2023
5aa75f7
Add files via upload
kreslotim Aug 2, 2023
b1a7b0e
Update README.md
kreslotim Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: DeLaGuardo/setup-clojure@2.0
- uses: actions/checkout@v3
- uses: DeLaGuardo/setup-clojure@11.0
with:
tools-deps: '1.10.1.469'
cli: '1.10.1.693'
- name: Compile
run: |
clojure -Amin
Expand Down
Binary file added Changelog.pdf
Binary file not shown.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ by [Daniel Harasim](https://people.epfl.ch/daniel.harasim),
and the [Digital and Cognitive Musicology Lab (DCML)](https://dcml.epfl.ch)

Find the web app [here](https://dcmlab.github.io/tree-annotation-code/).
New version available [here](https://kreslotim.github.io/tree-annotation-code/).

## Changelog
### Version 0.2.0 (August 2, 2023)

- Controls enhancements:
* Added `Elaborate` functionality, allowing top-down tree expansion with new generated node quantities determined by `Split arity`. Accessible using the `e` shortcut key on the selected node(s).
* Added `Unelaborate` functionality that serves as the counter-action to `Elaborate`, designed to eliminate descendants of the applied node. Accessible using the `u` or `Ctrl+E` shortcut keys on the selected node(s).
* Added `Uncombine` functionality that serves as the counter-action to `Combine`, effectively eliminating selected nodes and their ancestors, barring the leaves. Accessible via the `Backspace` or `Ctrl+U` shortcut keys on the selected node(s).
* Improved `Delete` functionality, to permit deletion of all node types in the tree, including leaves or roots as well. Accessible via `delete` shortcut key on the selected node(s).
* Added `Undo` & `Redo` functionalities to manipulate the history of forest modifications. Accessible through `Ctrl+Z` and `Ctrl+Y` shortcut keys.
* Added `⬅` and `➡` buttons to create new root nodes on the corresponding side of the tree, accessible via respective arrow keys.

* Visual interpretation
* Enhanced node aesthetics, ensuring nodes extend to the edges of the viewbox, always forming a rectangular forest shape.
* Added `Reverse tree` option to render the forest in an upside-down format, placing leaves at the top and roots at the bottom, akin to the previous version.
* Added `Math tree` option to render all forest nodes and preview tree labels in $\LaTeX$ format.
* Included the ability to manually enter $\LaTeX$-formatted input into a specific node, achieved by renaming the node and enclosing the input text with either `$` or `$$` symbols.

* User interaction
* Resolved issues with renaming nodes, which can now be confirmed by clicking outside of the node, in addition to pressing `Enter` or `r` while editing.
* Introduced a scrolling feature to navigate the webpage in all directions, useful when the tree dimensions exceed screen size.

* Output saving
* Added `Save forest` feature to enable saving the forest image in .png format.
* Added `Save preview` feature to enable saving the image of the preview tree in .svg format.

![A screenshot of the tool](screenshot.jpg)

Expand Down
100 changes: 99 additions & 1 deletion resources/public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,61 @@ code {
background: rgb(202,60,60);
}

.button-elaborate {
color: black;
/* text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); */
background: rgb(255,180,80);
}

.button-combine {
color: black;
/* text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); */
background: rgb(136,210,0);
}

.button-uncombine {
color: white;
/* text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); */
background: rgb(150,150,150);
}

.button-undo {
color: white;
/* text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); */
background: rgb(250,30,0);
}

.button-redo {
color: white;
/* text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); */
background: rgb(250,160,0);
}

.wrapper {
width: fit-content;
margin: 0 auto; /* centers the wrapper */
}

.button-new-left {
transform: translateY(-50%); /* This is to counteract the offset from top */
}

.button-new-right {
transform: translateY(-50%); /* This is to counteract the offset from top */
}

.reverse-box {
position: absolute;
margin-top: -20px;
margin-left: 20px;
}

.math-box {
position: absolute;
margin-left: 20px;
}


textarea {
max-width: 100%;
}
Expand All @@ -69,13 +124,17 @@ textarea {
}

.controls {
display: flex;
align-items: center;
justify-content: space-between;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
width: max-content;
}

.forest {
margin-top: 20px;
display: flex;
flex-direction: row;
width: min-content;
Expand All @@ -90,7 +149,22 @@ textarea {

.subtree {
/* margin-top: 1px; */
display: flex;
flex-direction: column;
margin-right: 2px;
margin-top: 2px;
margin-bottom: 0px;
flex-grow: 1;
flex-basis: auto;
}

.subtree.reversed {
/* margin-top: 1px; */
display: flex;
flex-direction: column-reverse;
margin-right: 2px;
margin-top: 0px;
margin-bottom: 2px;
flex-grow: 1;
flex-basis: auto;
}
Expand All @@ -100,21 +174,29 @@ textarea {
}

.children {
margin-bottom: 2px;
margin-bottom: 0px;
margin-top: 0px;
width: 100%;
flex-grow: 0;
}


.node {
/* position: absolute; */
border-style: solid;
border-width: thin;
border-color: #555;
display: flex;
text-align: center;
align-items: center;
justify-content: center;
min-width: 10px;
padding: 0.5em 1em;
flex-grow: 1;

}


div.node {
cursor: pointer;
background-color: #ccc;
Expand All @@ -134,3 +216,19 @@ div.node.selected {
div.node.tree-selected {
background-color: #88e;
}

.katex .katex-mathml {
position: static;
clip: auto;
padding: 3px;
border: 0;
height: auto;
width: auto;
overflow: hidden;
display: block;
}

.katex .katex-html {
display: none;
}

4 changes: 4 additions & 0 deletions resources/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<link href="css/style.css" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="https://clojurescript.org/images/cljs-logo-icon-32.png">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js"></script>
</head>
<body>
<div id="app"></div>
Expand Down
Binary file modified screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading