{"name":"d3tooltip","version":"1.3.1","keywords":["d3","tooltip"],"author":{"name":"romseguy"},"license":"MIT","_id":"d3tooltip@1.3.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":"a462183b0bee0bb6d51cb243ceef99a3d386461d","tarball":"http://registry-npm.ywwl.com/d3tooltip/download/d3tooltip-1.3.1.tgz","fileCount":17,"integrity":"sha512-oCQzvt3VLFnS6bCIp6PqJBOZvEMGoi6b/nCDKyKW/Nnv8KRlPl++1r0phKZsdQUwKO1b3BEHTnWqghPDyLr+tQ==","signatures":[{"sig":"MEQCIDyRIaEtNoean2iB7W6appYFajWXc7sy/7Zzt91RyvocAiAZr2nTLGFPsK+AFRuJ+f0MTVxJ8zRFaY7x92cSjUiZRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152370,"size":30200,"noattachment":false,"key":"/d3tooltip/-/d3tooltip-1.3.1.tgz"},"main":"lib/index.js","types":"lib/index.d.ts","gitHead":"faff0db47b6d7ed0d1fd708d9264a6069f65e4ff","scripts":{"lint":"eslint . --ext .ts","build":"yarn run build:types && yarn run build:js && yarn run build:umd && yarn run build:umd:min","clean":"rimraf lib dist","prepack":"yarn run clean && yarn run build","build:js":"babel src --out-dir lib --extensions \".ts\" --source-maps inline","build:umd":"webpack --progress --config webpack.config.umd.ts","prepublish":"yarn run type-check && yarn run lint","type-check":"tsc --noEmit","build:types":"tsc --emitDeclarationOnly","build:umd:min":"webpack --env production --progress --config webpack.config.umd.ts"},"_npmUser":{"name":"methuselah96","email":"nbierema@gmail.com"},"repository":{"url":"git+https://github.com/reduxjs/redux-devtools.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.0+x64 (win32)","description":"A highly configurable tooltip for d3","directories":{},"_nodeVersion":"16.13.0","dependencies":{"ramda":"^0.27.1"},"_hasShrinkwrap":false,"devDependencies":{"d3":"^3.5.17","eslint":"^7.32.0","rimraf":"^3.0.2","ts-node":"^10.4.0","webpack":"^5.61.0","@types/d3":"^3.5.46","@babel/cli":"^7.16.0","typescript":"~4.4.4","@babel/core":"^7.16.0","@types/node":"^16.11.6","webpack-cli":"^4.9.1","@types/ramda":"^0.27.46","babel-loader":"^8.2.3","@types/webpack":"^5.28.0","@babel/preset-env":"^7.16.0","eslint-config-prettier":"^8.3.0","@babel/preset-typescript":"^7.16.0","@typescript-eslint/parser":"^5.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"peerDependencies":{"d3":"^3.5.17","@types/d3":"^3.5.46"},"_npmOperationalInternal":{"tmp":"tmp/d3tooltip_1.3.1_1636222269685_0.3293738867066285","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":1636222269843,"_cnpm_publish_time":1636222269843,"dist-tags":{"latest":"4.0.1"}}