https://github.com/higlass/higlass-text
Display text in HiGlass
https://github.com/higlass/higlass-text
Last synced: 3 months ago
JSON representation
Display text in HiGlass
- Host: GitHub
- URL: https://github.com/higlass/higlass-text
- Owner: higlass
- License: mit
- Created: 2020-09-02T18:35:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-01T19:55:21.000Z (over 1 year ago)
- Last Synced: 2025-07-01T02:04:56.147Z (12 months ago)
- Language: JavaScript
- Size: 916 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Display text in HiGlass

**Note**: This is the source code for the text track only! You might want to check out the following repositories as well:
- HiGlass viewer: https://github.com/higlass/higlass
- HiGlass server: https://github.com/higlass/higlass-server
- HiGlass docker: https://github.com/higlass/higlass-docker
## Installation
```
npm install higlass-text
```
## Usage
The live script can be found at:
- https://unpkg.com/higlass-text/dist/higlass-text.js
### Client
1. Load this track before the HiGlass core script. For example:
```
...
```
### Options
The following options are available:
```
{
"uid": "texttrack",
"type": "text",
"options": {
"backgroundColor": "#ededed",
"textColor": "#333333",
"fontSize": 14,
"fontFamily": "Arial",
"fontWeight": "normal",
"offsetY": 0, // offset from the top of the track
"align": "left", // left, middle, right
"text": "Text to display",
},
"width": 568,
"height": 25
},
```
### ECMAScript Modules (ESM)
We also build out ES modules for usage by applications who may need to import or use `higlass-text` as a component.
Whenever there is a statement such as the following, assuming `higlass-text` is in your node_modules folder:
```javascript
import { TextTrack } from 'higlass-text';
```
Then TextTrack would automatically be imported from the `./es` directory (set via package.json's `"module"` value).
## Support
For questions, please either open an issue or ask on the HiGlass Slack channel at http://bit.ly/higlass-slack
## Development
### Testing
To run the test suite:
```
npm run test-watch
```
### Installation
```bash
$ git clone https://github.com/higlass/higlass-text.git
$ cd higlass-text
$ npm install
```
If you have a local copy of higlass, you can then run this command in the higlass-text directory:
```bash
npm link higlass
```
### Commands
- **Developmental server**: `npm start`
- **Production build**: `npm run build`