Skip to content

Commit

Permalink
Added Tooltip Class To Manage Tooltips Better (#34)
Browse files Browse the repository at this point in the history
* Improved tooltip

* Updated Demo Page

* Updated Documentation

* Bump up lib version

* Updated Readme
  • Loading branch information
OssamaRafique authored Jan 31, 2024
1 parent 63e549a commit 9ded3ec
Show file tree
Hide file tree
Showing 17 changed files with 14,715 additions and 8,730 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ package is available through [npm](https://www.npmjs.com/package/epiviz.heatmap.
### Usage

- [app/index.html](./app/index.html) provides an easier example and code on how to use the library
- Include the css in your application

```html
<link
rel="stylesheet"
href="https://epiviz.github.io/epiviz.heatmap.gl/dist/ehgl.css"
/>
```

```scss
@import url("https://epiviz.github.io/epiviz.heatmap.gl/dist/ehgl.css");
```

#### Intensity Legend

Expand Down Expand Up @@ -418,3 +430,28 @@ These attributes either take a fixed value or an array of values for each data p
columnGroupingData: <COLUMN_GROUPING_DATA>,
});
```

### Tooltip Functionality

The `Tooltip` class in `epiviz.heatmap.gl` provides dynamic tooltips for enhanced data point interaction. This feature allows users to see detailed information about specific data points on hover.

#### Implementation

- A singleton `Tooltip` instance is created for consistent behavior across the application.
- Tooltips are triggered on mouse movement over data points, displaying context-sensitive information.
- Positioning and content of the tooltip are dynamically updated based on the data point under the cursor.

#### Usage Example

```javascript
const tooltip = new Tooltip();
svgElement.addEventListener("mousemove", (event) => {
const content = `Detailed info`;
tooltip.updateTooltip(content, event.clientX, event.clientY);
});
svgElement.addEventListener("mouseout", () => {
tooltip.hideTooltip();
});
```

This feature enhances the interactive experience by providing immediate, in-context data insights to users.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { b as getViewportForSpecification } from './rgb-b646728b-0756143b.js';
import { S as SpecificationProcessor, a as SIZE_UNITS, t as transformGenomicRangeArcToStandard, b as transformGenomicRangeToStandard } from './specification-processor-f5ff7c7a-f223adaf.js';
import { b as getViewportForSpecification } from './rgb-b646728b-2f709b61.js';
import { S as SpecificationProcessor, a as SIZE_UNITS, t as transformGenomicRangeArcToStandard, b as transformGenomicRangeToStandard } from './specification-processor-f5ff7c7a-2d0faaee.js';

class FlatQueue {

Expand Down
1 change: 1 addition & 0 deletions app/ehgl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9ded3ec

Please sign in to comment.