{"_id":"@alkihis/react-d3-cloud","_rev":"1-d44a59eee97d7b76a66bf764b0dec519","name":"@alkihis/react-d3-cloud","dist-tags":{"latest":"0.7.0"},"versions":{"0.7.0":{"name":"@alkihis/react-d3-cloud","description":"a word cloud component using d3-cloud","license":"MIT","author":{"name":"cph"},"homepage":"https://github.com/Yoctol/react-d3-cloud#readme","repository":{"type":"git","url":"git+https://github.com/Yoctol/react-d3-cloud.git"},"bugs":{"url":"https://github.com/Yoctol/react-d3-cloud/issues"},"version":"0.7.0","main":"lib/index.js","scripts":{"build":"cross-env NODE_ENV=production npm run build:dev","build:dev":"babel src -d lib --ignore __tests__","deploy":"gh-pages -d demo -b gh-pages -m 'Auto-generated commit [ci skip]'","lint":"eslint .","lint:fix":"npm run lint -- --fix","lint:staged":"lint-staged","prepublishOnly":"npm run build","test":"npm run lint && npm run testonly","testonly":"jest --no-cache","testonly:watch":"npm run testonly -- --watch","preversion":"npm test"},"dependencies":{"d3-cloud":"^1.2.5","d3-scale":"^2.1.2","d3-scale-chromatic":"^1.3.3","d3-selection":"^1.3.2","enzyme-adapter-react-16":"^1.6.0","prop-types":"^15.6.2","react-faux-dom":"^4.2.0"},"peerDependencies":{"react":"^0.14.0 || ^15.0.0-0 || ^16.0.0-0","react-dom":"^0.14.0 || ^15.0.0-0 || ^16.0.0-0"},"devDependencies":{"@babel/cli":"^7.1.2","@babel/core":"^7.1.2","@babel/plugin-proposal-class-properties":"^7.1.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/preset-env":"^7.1.0","@babel/preset-react":"^7.0.0","babel-core":"^7.0.0-bridge.0","babel-eslint":"^10.0.1","canvas":"^1.6.13","cross-env":"^5.2.0","enzyme":"^3.7.0","eslint":"^5.8.0","eslint-config-yoctol":"^0.19.0","eslint-plugin-import":"^2.14.0","eslint-plugin-jsx-a11y":"^6.1.2","eslint-plugin-prettier":"^3.0.0","eslint-plugin-react":"7.11.1","eslint-plugin-sort-imports-es6-autofix":"^0.3.0","gh-pages":"^2.0.1","husky":"^1.1.3","jest":"^23.6.0","lint-staged":"^7.3.0","prettier":"^1.14.3","prettier-package-json":"^2.0.1","react":"^16.6.0","react-dom":"^16.6.0","react-test-renderer":"^16.6.0"},"keywords":["d3","react","word-cloud"],"husky":{"hooks":{"pre-commit":"lint-staged"}},"jest":{"setupFiles":["./test/setupJest.js"],"testPathIgnorePatterns":["/node_modules/","/examples/","/lib/"],"timers":"fake","resetModules":true,"resetMocks":true},"lint-staged":{"*.js":["eslint --fix","git add"],"*.md":["prettier --write","git add"],"*package.json":["prettier-package-json --write","git add"]},"gitHead":"b4336b6c4ffe8e4fa544f6c951245bef1e5689b6","_id":"@alkihis/react-d3-cloud@0.7.0","_nodeVersion":"13.1.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-oIur1BraE72LjdwytJa/mIJVU+uu1dB1ydP8oJxnmIM2qfZngjFhiB3SA/JGRLnDTYxgTlrkCgM1u2m9DeGqPg==","shasum":"4936c8b2bd27354713fd54971a5d0428ca625d61","tarball":"https://registry.npmjs.org/@alkihis/react-d3-cloud/-/react-d3-cloud-0.7.0.tgz","fileCount":17,"unpackedSize":21676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFzgeCRA9TVsSAnZWagAAZJsP/3MCHUibMlUyU94GwLro\nbAqQG11aFvv3NDOsr/iUQHQHiVaLJpnfhZD1MS4iEChb2H3Y+lieSYNOu6fj\n/gJVug81wM/tpXOpay4zmgghB3eSujkhqhQhWVQXCVNZgfXl9/pZzTxlmeOO\neekRrYLKyKLW1DulaguhyIoZecwBr9CTaaYy+ihuYWBkckidLkgW5VMtEw1/\nAQRnA9bW4xvIwpEWi7dbGd1vtIYji2sWiAArLfbJSmORZuQLxn8gShy1Qcl7\ntooCr/A6F5EQJnGwCMj9kko8lTx5KIWx/Q09vdlymDVipYrD8T9lQ/Ch00QS\nOfgCoNiIoEUmg3mzFpQCZEeG0n8dryI2DRtJUdyc5PRC2kiV8XnGhlcQM5wY\n0PbwTqgo5p048NiTANpW8EHUfF5jL4bxNDtPZCZS5P3/5XYdYhqlSBMRxpw3\ne/XKgRPcbrGeQdnQI/Rx5zjJwxg4OwYRjKec+gJNNy8moH5sQlUnqJqCt/1q\nmmgTtxwdEsFYZVito/Lq77fhi4eb6PxSE/Xirr/xCbZriZR0dTXB5jA6/u26\n+OZ60sKAwOm/gigl0I5WtBW5OIrElDI7WZTLeNJNvAB5RXaaedi2uM27OgQB\nNZb5OyWq3QiFH5KndiREWmqlSGYi66vWUBeHzEylmsIfos9B9FG0pieAHVEP\nZKaU\r\n=Yaf+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwk+3CmewGV/GYUCQqHao9lsGfFvauQ98FHomQq6E9iAIhAM9iDZUoiPT7KZlZkZ15kZnnmNmqXFXtfCwsBUwc8GNO"}]},"maintainers":[{"name":"alkihis","email":"tulouca@gmail.com"}],"_npmUser":{"name":"alkihis","email":"tulouca@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-d3-cloud_0.7.0_1578579998241_0.08882298443188086"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-09T14:26:38.217Z","0.7.0":"2020-01-09T14:26:38.404Z","modified":"2022-04-04T13:31:09.352Z"},"maintainers":[{"name":"alkihis","email":"tulouca@gmail.com"}],"description":"a word cloud component using d3-cloud","homepage":"https://github.com/Yoctol/react-d3-cloud#readme","keywords":["d3","react","word-cloud"],"repository":{"type":"git","url":"git+https://github.com/Yoctol/react-d3-cloud.git"},"author":{"name":"cph"},"bugs":{"url":"https://github.com/Yoctol/react-d3-cloud/issues"},"license":"MIT","readme":"# react-d3-cloud\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Dependency Status][david_img]][david_site]\n\nA word cloud react component built with [d3-cloud](https://github.com/jasondavies/d3-cloud).\n\n![image](https://cloud.githubusercontent.com/assets/6868283/20619528/fa83334c-b32f-11e6-81dd-6fe4fa6c52d9.png)\n\n## Usage\n\n```sh\nnpm install react-d3-cloud\n```\n\n```jsx\nimport React from \"react\";\nimport { render } from \"react-dom\";\nimport WordCloud from \"react-d3-cloud\";\n\nconst data = [\n  { text: \"Hey\", value: 1000 },\n  { text: \"lol\", value: 200 },\n  { text: \"first impression\", value: 800 },\n  { text: \"very cool\", value: 1000000 },\n  { text: \"duck\", value: 10 }\n];\n\nconst fontSizeMapper = word => Math.log2(word.value) * 5;\nconst rotate = word => word.value % 360;\n\nrender(\n  <WordCloud data={data} fontSizeMapper={fontSizeMapper} rotate={rotate} />,\n  document.getElementById(\"root\")\n);\n```\n\nPlease checkout [demo](https://yoctol.github.com/react-d3-cloud)\n\nfor more detailed props, please refer to below:\n\n## Props\n\n| name            | description                                                                                                  | type                                            | required | default               |\n| --------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- | -------- | --------------------- |\n| data            | The input data for rendering                                                                                 | Array<{ text: string, value: number }>          | ✓        |\n| width           | Width of component (px)                                                                                      | number                                          |          | 700                   |\n| height          | Height of component (px)                                                                                     | number                                          |          | 600                   |\n| fontSizeMapper  | Map each element of `data` to font size (px)                                                                 | Function: `(word: string, idx: number): number` |          | `word => word.value;` |\n| rotate          | Map each element of `data` to font rotation degree. Or simply provide a number for global rotation. (degree) | Function \\| number                              |          | 0                     |\n| padding         | Map each element of `data` to font padding. Or simply provide a number for global padding. (px)              | Function \\| number                              |          | 5                     |\n| font            | The font of text shown                                                                                       | Function \\| string                              |          | serif                 |\n| onWordClick     | Function called when click event triggered on a word                                                         | Function: `word => {}`                          |          | null                  |\n| onWordMouseOver | Function called when mouseover event triggered on a word                                                     | Function: `word => {}`                          |          | null                  |\n| onWordMouseOut  | Function called when mouseout event triggered on a word                                                      | Function: `word => {}`                          |          | null                  |\n\n## Build\n\n```sh\nnpm run build\n```\n\n## Test\n\n### pre-install\n\n#### Mac OS X\n\n```sh\nbrew install pkg-config cairo pango libpng jpeg giflib librsvg\nnpm install\n```\n\n#### Ubuntu and other Debian based systems\n\n```sh\nsudo apt-get update\nsudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++\nnpm install\n```\n\nFor more details, please check out [Installation guides](https://github.com/Automattic/node-canvas/wiki) at node-canvas wiki.\n\n### Run test\n\n```sh\nnpm test\n```\n\n## License\n\nMIT © [Yoctol](https://github.com/Yoctol/react-d3-cloud)\n\n[npm-image]: https://img.shields.io/npm/v/react-d3-cloud.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/react-d3-cloud\n[travis-image]: https://travis-ci.org/Yoctol/react-d3-cloud.svg?branch=master\n[travis-url]: https://travis-ci.org/Yoctol/react-d3-cloud\n[david_img]: https://david-dm.org/Yoctol/react-d3-cloud.svg\n[david_site]: https://david-dm.org/Yoctol/react-d3-cloud\n","readmeFilename":"README.md"}