{"name":"d3tooltip","version":"1.2.0","keywords":["d3","tooltip"],"author":{"name":"romseguy"},"license":"MIT","_id":"d3tooltip@1.2.0","maintainers":[{"name":"romseguy","email":"rom.seguy@gmail.com"}],"homepage":"https://github.com/romseguy/d3tooltip","bugs":{"url":"https://github.com/romseguy/d3tooltip/issues"},"dist":{"shasum":"05104b214b693800eab7803d5735e6eb3377eb9b","tarball":"http://registry-npm.ywwl.com/d3tooltip/download/d3tooltip-1.2.0.tgz","integrity":"sha512-HUHkbX8UPs0W/iUVXBp3a8tEiFO9kfLmFrxQ9yiyDVw3fV7s66+wQbv5HDx4CN/ebsnsQtXXid15/UXxdMbPxA==","signatures":[{"sig":"MEUCIQC9fTT4tn3WjQajFogvY4p1OZ9k4DdKf+LHHr0poCQQSgIgQfCrc3Pe8aGkXGtBAYXfDd2noJPr4x5qhqQtOSkgX0A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":72207,"noattachment":false,"key":"/d3tooltip/-/d3tooltip-1.2.0.tgz"},"main":"lib/index.js","_from":".","_shasum":"05104b214b693800eab7803d5735e6eb3377eb9b","gitHead":"b406c4209bbed70c3adde69a9907d34a2ae9552e","scripts":{"lint":"eslint src examples","build":"babel src --out-dir lib","clean":"rimraf lib dist","build:umd":"webpack src/index.js dist/d3tooltip.js && NODE_ENV=production webpack src/index.js dist/d3tooltip.min.js","prepublish":"npm run lint && npm run clean && npm run build && npm run build:umd"},"_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":1452510606864,"_cnpm_publish_time":1452510606864,"dist-tags":{"latest":"4.0.1"}}