{"_id":"d3tooltip@4.0.1","bugs":{"url":"https://github.com/reduxjs/redux-devtools/issues"},"dist":{"shasum":"a5f3fffa325f953b5de11bb5f36f2ed868c5022a","tarball":"http://registry-npm.ywwl.com/d3tooltip/download/d3tooltip-4.0.1.tgz","fileCount":6,"integrity":"sha512-5ASsF3ocKLLsvq1onP97Xvxo+Ih2bIld7vCM8RnqImh3td9/EtzHwQwe4J6JkLCfqou5LnFLMFXh1UhWVkEJ8A==","signatures":[{"sig":"MEUCIQCaFYspw7Um1nWLMbtwdx3srLbdWw7/SOTsJWlCdPN1ogIgDrIopMvjxnWYLmBpnwPdzpYtwGR0g3e1QYqiryI9+6Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH0uhuJ87Dkn6nokscZqeLvuF25zGRUvCT0iBSe0DXExAiEAoIrISkmLzdY2yJ8xgBzHQpMpXeUWRxEYuFvxepZiTrQ="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/d3tooltip@4.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10159,"size":3278,"noattachment":false,"key":"/d3tooltip/-/d3tooltip-4.0.1.tgz"},"name":"d3tooltip","type":"module","author":"romseguy","exports":"./lib/index.js","license":"MIT","scripts":{"build":"tsc","clean":"rimraf lib","type-check":"tsc --noEmit"},"version":"4.0.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"93741e84-5672-4fc3-bca7-2b4173a7745b"}},"homepage":"https://github.com/reduxjs/redux-devtools/tree/master/packages/d3tooltip","keywords":["d3","tooltip"],"repository":{"url":"https://github.com/reduxjs/redux-devtools.git","type":"git"},"description":"A highly configurable tooltip for d3","directories":{},"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"}],"sideEffects":false,"_hasShrinkwrap":false,"devDependencies":{"d3":"^7.9.2","rimraf":"^6.1.4","@types/d3":"^7.4.3","typescript":"^7.0.2"},"peerDependencies":{"d3":"^7.9.2","@types/d3":"^7.4.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/d3tooltip_4.0.1_1794268846847_0.5587675265276393"},"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":1794268846969,"_cnpm_publish_time":1794268846969,"dist-tags":{"latest":"4.0.1"}}