{"name":"d3tooltip","version":"1.2.3","keywords":["d3","tooltip"],"author":{"name":"romseguy"},"license":"MIT","_id":"d3tooltip@1.2.3","maintainers":[{"name":"romseguy","email":"rom.seguy@gmail.com"}],"homepage":"https://github.com/reduxjs/redux-devtools","bugs":{"url":"https://github.com/reduxjs/redux-devtools/issues"},"dist":{"shasum":"564f8439dff172dc5207329176cc01eef00e913b","tarball":"http://registry-npm.ywwl.com/d3tooltip/download/d3tooltip-1.2.3.tgz","fileCount":14,"integrity":"sha512-VoguUK+Hxy9Ruhqm6O1UKmETNWjASNTK+gzR9G5r3AAgGp0ENCGWg860Eh5YJThPpog33eAD+afQ31PfJwAz+A==","signatures":[{"sig":"MEYCIQDSTPtugL3bBZOcullFmSg2K00cuJejRzrqp5prjORffgIhAIuNInEbYx3LcDMeJSE8xshW6dcegQxnnSjjnp7wqxWB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":819721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNqRCCRA9TVsSAnZWagAAgKsP/0/3QZGka5DWg1irVfco\nOZSszBi5rABUJDB3CE+39v5/MotSA6Kl2wYVUFlE3do9Y3AZx5mhIsoePf7x\n/9Qnj7WHfJ/Jjppb0c3MzlwHaPpA9bytIZ31UWX0yuTQJviZkVhngwmswPzb\nOTjkIPl3mG3SsrMqI2zuMkte0ixnwnPuRzwVJPQOOMjcSbIdX7ItBpBUjGVc\nKz3+hmqyb93NkVxrlipBmlnoPPTfX5GGJlAJIgSuRoXWyNY0mTC4+ypEHJf3\nTXlT1MUgojqWiXsSFYh9A9OxJdeHKptyqNvG7yBjjAPDU0ctPndpACi/icYu\nbGU8snp/Y2gDmbHFD/nQFzCHE0JlkNHZYx0VAEKfppblf7GMGxbUyhkenT9K\nnKtYKForhltkhXybEA4JLwZWWyT+K80h+RP52cdRPiw/fwpJriwAKvDgZmZ/\nhnNGpFiSiZ7PiCYxoO2hprS318BVpgj5+8+XQ6EloW49WKwl0xg3dXfHzfug\n69jO6g+OQt+efE7jnkGQACZBwWCeKNmOR2EK2CLM/gpOObZtRqf5RtpjeFb/\nK9Un97PAkQ9njTwNAg+C9lEXpMiN8aNmgzbWHrRRaHpVShuJ6NAm1/BpF76z\njy0qiJJK+HKxKg59R+nI0LNHZHZMDBsaKUNDS/1jZ+QpNyXUpiwkspOd6UYO\nJZb8\r\n=+FJC\r\n-----END PGP SIGNATURE-----\r\n","size":108746,"noattachment":false,"key":"/d3tooltip/-/d3tooltip-1.2.3.tgz"},"main":"lib/index.js","gitHead":"d8da887da86441c890e0820aa9f924f6ebbad8e7","scripts":{"build":"babel src --out-dir lib","clean":"rimraf lib dist","prepare":"npm run clean && npm run build","version":"npm run build","build:umd":"webpack --progress --config webpack.config.umd.js","postversion":"git push && git push --tags && npm run clean","build:umd:min":"webpack --env.production --progress --config webpack.config.umd.js","prepublishOnly":"npm run clean && npm run build && npm run build:umd && npm run build:umd:min"},"_npmUser":{"name":"methuselah96","email":"nbierema@gmail.com"},"repository":{"url":"git+https://github.com/reduxjs/redux-devtools.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (win32)","description":"A highly configurable tooltip for d3","directories":{},"_nodeVersion":"12.18.3","dependencies":{"ramda":"^0.27.1"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^3.0.2","webpack":"^4.44.1","@babel/cli":"^7.10.5","@babel/core":"^7.11.1","webpack-cli":"^3.3.12","babel-loader":"^8.1.0","@babel/preset-env":"^7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/d3tooltip_1.2.3_1597416513581_0.2136606094479614","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":1597416513691,"_cnpm_publish_time":1597416513691,"dist-tags":{"latest":"4.0.1"}}