{"name":"d3tooltip","version":"4.0.0","keywords":["d3","tooltip"],"author":{"name":"romseguy"},"license":"MIT","_id":"d3tooltip@4.0.0","maintainers":[{"name":"timdorr","email":"timdorr@timdorr.com"},{"name":"romseguy","email":"rom.seguy@gmail.com"},{"name":"zalmoxisus","email":"zalmoxisus@gmail.com"},{"name":"methuselah96","email":"nbierema@gmail.com"}],"homepage":"https://github.com/reduxjs/redux-devtools/tree/master/packages/d3tooltip","bugs":{"url":"https://github.com/reduxjs/redux-devtools/issues"},"dist":{"shasum":"7bb1845172292b9e8bec059ccbf7c2d0833a0ffe","tarball":"http://registry-npm.ywwl.com/d3tooltip/download/d3tooltip-4.0.0.tgz","fileCount":6,"integrity":"sha512-jQRmF04fL9G+sROeN1/CZaHRqE31Pl7Qky6qIJ2MkecTwXZtgfDgmgrPZ0VS5Ewnj9sYWJ6CAl6fYI4PNn2Fpw==","signatures":[{"sig":"MEUCIFhsXZgIuzfwSZuCrNcvkOAHRrkMN1pOHe10K5nQAcXnAiEAl1PhXXnfI1/IWVlgm6p6N7/ewdZ/OQC0h0R1ZSERxKs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10410,"size":3379,"noattachment":false,"key":"/d3tooltip/-/d3tooltip-4.0.0.tgz"},"main":"lib/index.js","type":"module","_from":"file:d3tooltip-4.0.0.tgz","types":"lib/index.d.ts","scripts":{"lint":"eslint . --ext .ts","build":"tsc","clean":"rimraf lib","prepublish":"pnpm run lint","type-check":"tsc --noEmit"},"_npmUser":{"name":"methuselah96","email":"nbierema@gmail.com"},"_resolved":"/tmp/34bf5f4cf7d091b4ea5969c6e3d12133/d3tooltip-4.0.0.tgz","_integrity":"sha512-jQRmF04fL9G+sROeN1/CZaHRqE31Pl7Qky6qIJ2MkecTwXZtgfDgmgrPZ0VS5Ewnj9sYWJ6CAl6fYI4PNn2Fpw==","repository":{"url":"git+https://github.com/reduxjs/redux-devtools.git","type":"git"},"_npmVersion":"10.5.0","description":"A highly configurable tooltip for d3","directories":{},"sideEffects":false,"_nodeVersion":"20.12.0","_hasShrinkwrap":false,"devDependencies":{"d3":"^7.9.0","eslint":"^8.57.0","rimraf":"^5.0.5","@types/d3":"^7.4.3","typescript":"~5.3.3","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^7.4.0","@typescript-eslint/eslint-plugin":"^7.4.0"},"peerDependencies":{"d3":"^7.9.0","@types/d3":"^7.4.3"},"_npmOperationalInternal":{"tmp":"tmp/d3tooltip_4.0.0_1712463041945_0.6266588309174583","host":"s3://npm-registry-packages"},"readme":"# d3tooltip\n\nThis tooltip aims for a minimal yet highly configurable API. It has a long way to go, but the essentials are there.\nIt was created by [@romseguy](https://github.com/romseguy) and merged from [`romseguy/d3tooltip`](https://github.com/romseguy/d3tooltip).\n\n## Installation\n\n`npm install d3-state-visualizer`\n\n## Quick usage\n\n```javascript\nimport * as d3 from 'd3';\nimport { tooltip } from 'd3tooltip';\n\nconst DOMNode = document.getElementById('chart');\nconst root = d3.select(DOMNode);\nconst vis = root.append('svg');\n\nconst options = {\n  offset: { left: 30, top: 10 },\n  styles: { 'min-width': '50px', 'border-radius': '5px' },\n};\n\nvis\n  .selectAll('circle')\n  .data(someData)\n  .enter()\n  .append('circle')\n  .attr('r', 10)\n  .call(\n    d3tooltip('tooltipClassName', {\n      ...options,\n      text: (d) => toStringOrHtml(d),\n    }),\n  )\n  .on('mouseover', function () {\n    d3.select(this).style('fill', 'skyblue');\n  })\n  .on('mouseout', function () {\n    d3.select(this).style('fill', 'black');\n  });\n```\n\n## API\n\n| Option   | Type               | Default             | Description                                                                                                                                                      |\n| -------- | ------------------ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `root`   | DOM.Element        | `body`              | The tooltip will be added as a child of that element. You can also use a D3 [selection](https://github.com/mbostock/d3/wiki/Selections#d3_select).               |\n| `left`   | Number             | `undefined`         | Sets the tooltip `x` absolute position instead of the mouse `x` position, relative to the `root` element.                                                        |\n| `top`    | Number             | `undefined`         | Sets the tooltip `y` absolute position instead of the mouse `y` position, relative to the `root` element.                                                        |\n| `offset` | Object             | `{left: 0, top: 0}` | Sets the distance, starting from the cursor position, until the tooltip is rendered. **Warning**: only applicable if you don't provide a `left` or `top` option. |\n| `styles` | Object             | `{}`                | Sets the styles of the tooltip element.                                                                                                                          |\n| `text`   | String or Function | `''`                | Sets the text of the tooltip. Can be a constant `string` or a function that takes the datum and returns a `string`.                                              |\n","publish_time":1712463042097,"_cnpm_publish_time":1712463042097,"dist-tags":{"latest":"4.0.1"}}