{"name":"d3tooltip","version":"3.0.1","keywords":["d3","tooltip"],"author":{"name":"romseguy"},"license":"MIT","_id":"d3tooltip@3.0.1","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":"314850b6aa78e38eebe7b9a8b453ddca0a076b67","tarball":"http://registry-npm.ywwl.com/d3tooltip/download/d3tooltip-3.0.1.tgz","fileCount":7,"integrity":"sha512-y1CqKBZE/PUVvXzPeJrAxRh5pj6hzz8/oFdEpgGI0TbhFVhQ1xBv0wCFEz6BzZ94t+5Y+n1x+Q6rGMDtlzy7rA==","signatures":[{"sig":"MEQCIAsiwgnngQG3cYVk6mo2JBVZJIJtcxM70Ggn7629OpxoAiApsQBMAkMZN01NgnSyoaZyi2dCbLQhG6+2AKr0SKolIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13359,"size":4029,"noattachment":false,"key":"/d3tooltip/-/d3tooltip-3.0.1.tgz"},"main":"lib/cjs/index.js","_from":"file:d3tooltip-3.0.1.tgz","types":"lib/types/index.d.ts","module":"lib/esm/index.js","scripts":{"lint":"eslint . --ext .ts","build":"pnpm run build:cjs && pnpm run build:esm && pnpm run build:types","clean":"rimraf lib","build:cjs":"babel src --extensions \".ts\" --out-dir lib/cjs","build:esm":"babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm","prepublish":"pnpm run type-check && pnpm run lint","type-check":"tsc --noEmit","build:types":"tsc --emitDeclarationOnly"},"_npmUser":{"name":"methuselah96","email":"nbierema@gmail.com"},"_resolved":"/tmp/044d64e886d20933f5f619d35d0ac28f/d3tooltip-3.0.1.tgz","_integrity":"sha512-y1CqKBZE/PUVvXzPeJrAxRh5pj6hzz8/oFdEpgGI0TbhFVhQ1xBv0wCFEz6BzZ94t+5Y+n1x+Q6rGMDtlzy7rA==","repository":{"url":"git+https://github.com/reduxjs/redux-devtools.git","type":"git"},"_npmVersion":"10.2.3","description":"A highly configurable tooltip for d3","directories":{},"sideEffects":false,"_nodeVersion":"20.10.0","dependencies":{"@babel/runtime":"^7.23.2"},"_hasShrinkwrap":false,"devDependencies":{"d3":"^7.8.5","eslint":"^8.53.0","rimraf":"^5.0.5","@types/d3":"^7.4.3","@babel/cli":"^7.23.0","typescript":"~5.2.2","@babel/core":"^7.23.3","@babel/preset-env":"^7.23.3","@babel/eslint-parser":"^7.23.3","eslint-config-prettier":"^9.0.0","@babel/preset-typescript":"^7.23.3","@typescript-eslint/parser":"^6.11.0","@typescript-eslint/eslint-plugin":"^6.11.0"},"peerDependencies":{"d3":"^7.0.0","@types/d3":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/d3tooltip_3.0.1_1702099598996_0.8327432762854774","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":1702099599186,"_cnpm_publish_time":1702099599186,"dist-tags":{"latest":"4.0.1"}}