-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #307 from midlik/nightingale-track-canvas
NightingaleTrackCanvas
- Loading branch information
Showing
13 changed files
with
1,356 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# nightingale-track-canvas | ||
|
||
[![Published on NPM](https://img.shields.io/npm/v/@nightingale-elements/nightingale-track-canvas.svg)](https://www.npmjs.com/package/@nightingale-elements/nightingale-track-canvas) | ||
|
||
Alternative to `nightingale-track`, using HTML canvas for rendering instead of SVG graphics. | ||
|
||
Canvas-based rendering can provide better performance, especially with large datasets (many features within a track or many parallel tracks). Some non-critical parts are still implemented via SVG (e.g. highlights). | ||
|
||
Application interface for `nightingale-track-canvas` is the same as for `nightingale-track`. Some shapes might look slightly different. In case there are overlapping features, their order (z-index) might not be preserved. | ||
|
||
## Usage | ||
|
||
```html | ||
<nightingale-track-canvas | ||
id="my-track-id" | ||
length="223" | ||
height="100" | ||
display-start="1" | ||
display-end="50" | ||
layout="non-overlapping" | ||
></nightingale-track-canvas> | ||
``` | ||
|
||
#### Setting the data through property | ||
|
||
```javascript | ||
const track = document.querySelector("#my-track-id"); | ||
track.data = myDataObject; | ||
``` | ||
|
||
## API Reference | ||
|
||
This component inherits from `nigthingale-track` and has the same API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "@nightingale-elements/nightingale-track-canvas", | ||
"version": "5.2.0", | ||
"description": "Basic track type of the viewer, implemented via HTML canvas.", | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"main": "dist/index.js", | ||
"module": "dist/index.js", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "rollup --config ../../rollup.config.mjs", | ||
"test": "../../node_modules/.bin/jest --config ../../jest.config.js ./tests/*" | ||
}, | ||
"keywords": [ | ||
"nightingale", | ||
"webcomponents", | ||
"customelements" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ebi-webcomponents/nightingale.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ebi-webcomponents/nightingale/issues" | ||
}, | ||
"homepage": "https://ebi-webcomponents.github.io/nightingale/", | ||
"author": "Adam Midlik <midlik@gmail.com>", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@nightingale-elements/nightingale-new-core": "^5.2.0", | ||
"@nightingale-elements/nightingale-track": "^5.2.0", | ||
"d3": "7.9.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from "@nightingale-elements/nightingale-track"; | ||
|
||
import NightingaleTrackCanvas from "./nightingale-track-canvas"; | ||
export default NightingaleTrackCanvas; |
Oops, something went wrong.