{"id":16317728,"url":"https://github.com/zfletch/commentary-demo","last_synced_at":"2025-05-13T16:33:02.362Z","repository":{"id":72191093,"uuid":"313370542","full_name":"zfletch/commentary-demo","owner":"zfletch","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-16T17:07:03.000Z","size":1596,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T20:21:03.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zfletch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://tuftsgiving.org/giving-form.html?id=7\u0026showarea=AR001037\u0026areaid=601\u0026recurring=true"}},"created_at":"2020-11-16T17:01:27.000Z","updated_at":"2020-11-16T17:07:05.000Z","dependencies_parsed_at":"2023-05-31T07:27:25.490Z","dependency_job_id":null,"html_url":"https://github.com/zfletch/commentary-demo","commit_stats":{"total_commits":68,"total_committers":1,"mean_commits":68.0,"dds":0.0,"last_synced_commit":"620226492d87a8ed4862d4e8315efc0372206a8d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fcommentary-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fcommentary-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fcommentary-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fcommentary-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zfletch","download_url":"https://codeload.github.com/zfletch/commentary-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253981934,"owners_count":21994361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T22:09:08.504Z","updated_at":"2025-05-13T16:33:02.339Z","avatar_url":"https://github.com/zfletch.png","language":"JavaScript","funding_links":["https://tuftsgiving.org/giving-form.html?id=7\u0026showarea=AR001037\u0026areaid=601\u0026recurring=true"],"categories":[],"sub_categories":[],"readme":"# Treebank React\n\nReact library for displaying treebanks.\nIt displays treebanks visually using the [Dagre](https://github.com/dagrejs/dagre) library\nas well as displaying XML and other formats.\n\n## Demo\n\n[https://perseids-tools.github.io/treebank-react/](https://perseids-tools.github.io/treebank-react/)\n\n## Installation\n\n`yarn add treebank-react`\n\nNote that this package has the following peer dependencies:\n\n```json\n{\n  \"react\": \"^16.0.0 || ^17.0.0\"\n}\n```\n\n(See project on [npm](https://www.npmjs.com/package/treebank-react).)\n\n## How to use\n\n### Demo\n\nSee the demo [App.js](/src/demo/App/App.js).\n\n### Example\n\n```jsx\nimport {\n  Treebank,\n  Sentence,\n  Text,\n  Graph,\n  Information,\n  Xml,\n  Collapse,\n} from 'treebank-react';\n\nimport 'treebank-react/build/index.css';\n\nconst xml = '\u003ctreebank xml:lang=\"grc\" format=\"aldt\" version=\"1.5\"\u003e\\n'\n  + '  \u003csentence id=\"1\" document_id=\"\" subdoc=\"\" span=\"\"\u003e\\n'\n  + '    \u003cword id=\"1\" form=\"χαῖρε\" lemma=\"χαίρω\" postag=\"v2spma---\" relation=\"PRED\" head=\"0\"/\u003e\\n'\n  + '    \u003cword id=\"2\" form=\"ὦ\" lemma=\"ὦ\" postag=\"i--------\" relation=\"AuxZ\" head=\"3\"/\u003e\\n'\n  + '    \u003cword id=\"3\" form=\"κόσμε\" lemma=\"κόσμος\" postag=\"n-s---mv-\" relation=\"ExD\" head=\"1\"/\u003e\\n'\n  + '  \u003c/sentence\u003e\\n'\n  + '\u003c/treebank\u003e';\n\nconst App = () =\u003e (\n  \u003cTreebank treebank={xml}\u003e\n    \u003cSentence id=\"1\"\u003e\n      \u003cText /\u003e\n      \u003cGraph /\u003e\n      \u003cInformation /\u003e\n      \u003cCollapse title=\"XML\"\u003e\n        \u003cXml /\u003e\n      \u003c/Collapse\u003e\n    \u003c/Sentence\u003e\n  \u003c/Treebank\u003e\n);\n\nexport default  App;\n```\n\n#### Treebank\n\nThe `\u003cTreebank\u003e` component accepts treebank XML as a `treebank` prop.\nThe other components should be children (or grandchildren, etc.) of the `\u003cTreebank\u003e` component.\n\n#### Sentence\n\nThe `\u003cSentence\u003e` component accepts a string `id` which represents the `id` of the\nsentence to display.\n\n#### Graph\n\nThe `\u003cGraph\u003e` component must be within a `\u003cSentence\u003e` component.\nIt uses Dagre-d3 to display the treebank.\n\nThe height and width of the graph are determined by the parent element.\nThis is subject to change, but currently it expects a parent with `display: flex`.\n\n```jsx\n\u003cdiv style={{ display: 'flex', height: '60vh' }}\u003e\n  \u003cGraph /\u003e\n\u003c/div\u003e\n```\n\n#### Information\n\nThe `\u003cInformation\u003e` component shows the deconstructed POSTag and the lemma for the active word.\nThe headers are taken from the treebank configuration.\nSee [alpheios-project/arethusa-configs](https://github.com/alpheios-project/arethusa-configs) for more information about treebank configuration.\n\n#### Xml\n\nThe `\u003cXml\u003e` component displays the XML of the sentence.\n\n#### Collapse\n\nThe `\u003cCollapse\u003e` component is provided for convenience.\nIt is a button that displays or hides its children whenever it is clicked.\n\n## Development\n\n### Setup\n\n```\ngit clone --recurse-submodules git@github.com:perseids-tools/treebank-react.git\n```\n\nor if the repository is already initialized\n\n```\ngit pull --recurse-submodules\n```\n\nthen install development dependencies\n\n```\nyarn install\n```\n\n### Running tests\n\n`yarn test`\n\n### Running demo application\n\n`yarn start`\n\n### Deploying demo application\n\n`yarn deploy`\n\n### Building\n\n`yarn build`\n\n### Publishing\n\n```\nyarn build\nnpm publish\n```\n\n(Make sure to update the `version` in `package.json` before publishing a new release.)\n\n## Upgrading Notes\n\nThis library is build on top of [DimiMikadze/create-react-library](https://github.com/DimiMikadze/create-react-library).\nTo upgrade to the latest version of `create-react-library`:\n\n* In `package.json`, everything above `devDependencies` should not be updated,\n  but everything below it should be replaced by the new versions in `create-react-library`.\n* Add back the dependencies for the project\n* All of the files in `./scripts` should be replaced with new versions in `create-react-library`.\n* All of the files in `./config` should be replaced with new versions in `create-react-library`.\n* Test to make sure that building and deploying demo application still work\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzfletch%2Fcommentary-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzfletch%2Fcommentary-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzfletch%2Fcommentary-demo/lists"}