wsdm-tooltip

0.1.3 • Public • Published

wsdm-tooltip

Tooltip component for d3 charts.

Usage

Create tooltip (with optional configuration):

const tip = tooltip({
  className: "custom-tooltip",
  styles: {
    color: "#eee",
    "font-size": "0.75rem",
    "background-color": "rgba(0,0,0,.9)",
    "border-radius": "3px",
  },
})

Show tooltip with the content (text or html string):

tip.show(content)

Position tooltip (with optional coordinates object and offset array): Coordinates object defaults to d3's event, default offset is [0, -5]

tip.position({ pageX, pageY }, [x, y])

Hide tooltip:

tip.hide()

Run development server with:

$ npm i
$ make start

Build with:

$ make build

Lapidus Interactive

Readme

Keywords

Package Sidebar

Install

npm i wsdm-tooltip

Weekly Downloads

202

Version

0.1.3

License

BSD-3-Clause

Unpacked Size

5.88 kB

Total Files

4

Last publish

Collaborators

  • amytych