{"name":"d3tooltip","version":"1.2.2","keywords":["d3","tooltip"],"author":{"name":"romseguy"},"license":"MIT","_id":"d3tooltip@1.2.2","maintainers":[{"name":"romseguy","email":"rom.seguy@gmail.com"}],"homepage":"https://github.com/romseguy/d3tooltip","bugs":{"url":"https://github.com/romseguy/d3tooltip/issues"},"dist":{"shasum":"88a8b2525fb8cc479196e0382a8cb858fbf27b32","tarball":"http://registry-npm.ywwl.com/d3tooltip/download/d3tooltip-1.2.2.tgz","integrity":"sha512-F2HWrm5krXzHPop/D4B8on2+pg9R8xayUHwJUYL0l5rloKwt7RtCBxjR3AA8VN1odYHVtRLxPTR8L6ShxL4/Vg==","signatures":[{"sig":"MEUCIQDfVkVtE333jDIT8ZLO8GmlakOKVGaWs1z5iSG291klhwIgXqr8aRPM7H7Uvq9jsaMTt+l9WlrCHwBkG41W3JQBQO0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":73455,"noattachment":false,"key":"/d3tooltip/-/d3tooltip-1.2.2.tgz"},"main":"lib/index.js","_from":".","_shasum":"88a8b2525fb8cc479196e0382a8cb858fbf27b32","gitHead":"38a377cb3ba0210b468b72158f14d89920bd3c8c","scripts":{"lint":"eslint src examples","build":"npm run build:lib && npm run build:umd && npm run build:umd:min","clean":"rimraf lib dist","version":"npm run build","build:lib":"babel src --out-dir lib","build:umd":"webpack src/index.js dist/d3tooltip.js --config webpack.config.development.js","prepublish":"npm run clean && npm run build","postversion":"git push && git push --tags && npm run clean","build:umd:min":"webpack src/index.js dist/d3tooltip.min.js --config webpack.config.production.js"},"_npmUser":{"name":"romseguy","email":"rom.seguy@gmail.com"},"repository":{"url":"git+https://github.com/romseguy/d3tooltip.git","type":"git"},"_npmVersion":"3.5.3","description":"A highly configurable tooltip for d3","directories":{},"_nodeVersion":"5.4.0","dependencies":{"ramda":"^0.17.1"},"devDependencies":{"eslint":"^0.23","rimraf":"^2.3.4","webpack":"^1.9.6","babel-cli":"^6.3.15","babel-core":"^6.1.20","babel-eslint":"^5.0.0-beta4","babel-loader":"^6.2.0","babel-preset-react":"^6.3.13","webpack-dev-server":"^1.8.2","eslint-plugin-react":"^3.6.3","babel-preset-stage-0":"^6.3.13","eslint-config-airbnb":"0.0.6","babel-preset-es2015-loose":"^6.1.3"},"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":1452516005425,"_cnpm_publish_time":1452516005425,"dist-tags":{"latest":"4.0.1"}}