{"_id":"@amplexus/react-photo-gallery","_rev":"2-17c7c1243aa37548a8a2b61909cd0a49","name":"@amplexus/react-photo-gallery","dist-tags":{"latest":"8.0.0"},"versions":{"8.0.0":{"name":"@amplexus/react-photo-gallery","version":"8.0.0","description":"Responsive Justified React Image Gallery Component","main":"dist/react-photo-gallery.umd.js","module":"dist/react-photo-gallery.esm.js","author":{"name":"Sandra Gonzales"},"license":"MIT","homepage":"https://github.com/neptunian/react-photo-gallery","repository":{"type":"git","url":"git+https://github.com/neptunian/react-photo-gallery.git"},"bugs":{"url":"https://github.com/neptunian/react-photo-gallery/issues"},"dependencies":{"prop-types":"~15.7.2","react-images":"^1.2.0-beta.7","resize-observer-polyfill":"^1.5.1"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-react":"^7.0.0","@wojtekmaj/enzyme-adapter-react-17":"^0.6.5","array-move":"^2.1.0","babel-eslint":"^9.0.0","babel-jest":"^27.3.1","babel-loader":"^8.0.0","coveralls":"^3.0.4","cross-env":"^5.0.5","enzyme":"^3.8.0","enzyme-to-json":"^3.3.4","eslint":"^8.2.0","eslint-config-prettier":"^2.3.0","eslint-plugin-prettier":"^2.2.0","eslint-plugin-react":"^7.3.0","eslint-plugin-react-hooks":"^1.6.0","graceful-fs":"^4.2.8","jest":"^27.3.1","jest-cli":"^27.3.1","jsonp":"^0.2.1","nps":"^5.10.0","nps-utils":"^1.7.0","prettier":"^1.6.1","react":"^17.0.2","react-dom":"^17.0.2","react-sortable-hoc":"^1.9.1","react-test-renderer":"^17.0.2","rollup":"^1.0.0","rollup-plugin-babel":"^4.0.1","rollup-plugin-node-resolve":"^3.0.0","webpack":"^5.62.1","webpack-cli":"^4.9.1","webpack-dev-server":"^4.4.0"},"peerDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"scripts":{"build":"nps build","build:docs":"NODE_ENV=production nps build:docs","start":"webpack-dev-server --progress","lint":"eslint -c ./.eslintrc.js ./src","eslint-check":"eslint --print-config .eslintrc.js | eslint-config-prettier-check","test":"jest","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"keywords":["react","react component","react-component","justified image gallery","photo gallery","responsive","image gallery","images","react-image-gallery","react-masonry-gallery","react-photo-gallery","image-gallery","react-gallery","react image gallery","react gallery","masonry","react masonry","react-masonry","masonry layout","grid","layout"],"directories":{"doc":"docs","example":"examples"},"gitHead":"24e2ef2c7fc4a225ad6c97e80f68fd4bdb4058fe","_id":"@amplexus/react-photo-gallery@8.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-5y0pUCZrRkpYmBBpKCvVX9qYEbzAVx7Uewu7YnjV5z7r9GDOIcSuS10VOHzHttPKhmhImo5D0BGa8V7fYJa6Cg==","shasum":"7b3d379ee616a7b295b9593faf24d01c46f2b04f","tarball":"https://registry.npmjs.org/@amplexus/react-photo-gallery/-/react-photo-gallery-8.0.0.tgz","fileCount":6,"unpackedSize":58259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzFQ5CRA9TVsSAnZWagAANzgQAJrGWmqXZGLwVc8yhv5A\nI4O1TC15KIsGl+ZB/X/HpE9qzjpScoZ83Cuy7yczCSqBl5zHDRTR1PZ5V/jC\njlIP57GnLE+WSJ6rBXoFaUL+poNRsmpXYauhiVfOdpEaD8v0SY32KNlCgkwo\n1tIxC60tRkoqNbpWs8qHWzLkEa6IB73sEfFntzlmH2gFcnDWzi48vlfR7KiD\ngCDiv6z/2uGpgt+8U0yqbfO7Ok5gOnfmyL2Ul6M0EH4HMXrKXecfXnqN1JGA\nw95QaEZq4y7hHQy77UqxH7tRGaiFPGjIMeRjK7XD04IqyTrRKga8sEKOXH86\nXruzNsvPnv7KeczsbTOpVyDP5iPM1StBGBZpoPDZ+EQTHb2Gd/sHBoto/4ij\n05gf4xmwAernEvVoUe5e3MVhaH9JXUru83X0xys2kPYpfTtK/JTK9+RGygvK\nYtKhxGAaEAEY6Ah0+QL0JqIckMue2Mh+li/ZC1K65cpugrN+uBMpWft+rxXm\nCBVwS/ZQjbPnF062XZ7vI7gX1Fw/Gxd2+bbJH3jmedN1MNG98o4aIEH4o6Ti\nKkg1qVXKILagtPDUITp0mtjEDzhZo5fFgR4wdWNiP3etTYRGu5Ubrk/0QLBz\nkM86d8119dy10cTNCgrgWQOw5GZ6BXhwVZSI47H9CZjD163aKe4wqOv7g7LB\nhbfI\r\n=9dMQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGVTNvS2DOz/Xmv+NoSA61i0i/62uRRHBOIaR+gXi2ZTAiAMsZybmTpJ+0nBjvJFb0oVe7ETTEkhQEqv2LMrI5MyJw=="}]},"_npmUser":{"name":"amplexus","email":"igetcheapthrills@gmail.com"},"maintainers":[{"name":"amplexus","email":"igetcheapthrills@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-photo-gallery_8.0.0_1636611060247_0.9172744897937453"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-11T06:11:00.189Z","8.0.0":"2021-11-11T06:11:00.420Z","modified":"2022-04-04T13:52:12.520Z"},"maintainers":[{"name":"amplexus","email":"igetcheapthrills@gmail.com"}],"description":"Responsive Justified React Image Gallery Component","homepage":"https://github.com/neptunian/react-photo-gallery","keywords":["react","react component","react-component","justified image gallery","photo gallery","responsive","image gallery","images","react-image-gallery","react-masonry-gallery","react-photo-gallery","image-gallery","react-gallery","react image gallery","react gallery","masonry","react masonry","react-masonry","masonry layout","grid","layout"],"repository":{"type":"git","url":"git+https://github.com/neptunian/react-photo-gallery.git"},"author":{"name":"Sandra Gonzales"},"bugs":{"url":"https://github.com/neptunian/react-photo-gallery/issues"},"license":"MIT","readme":"# React Photo Gallery\n\n[![Join the chat at https://gitter.im/react-photo-gallery/Lobby](https://badges.gitter.im/react-photo-gallery/Lobby.svg)](https://gitter.im/react-photo-gallery/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![npm version](https://badge.fury.io/js/react-photo-gallery.svg)](https://badge.fury.io/js/react-photo-gallery)\n![npm downloads](https://img.shields.io/npm/dt/react-photo-gallery.svg)\n[![Build Status](https://travis-ci.org/neptunian/react-photo-gallery.svg?branch=master)](https://travis-ci.org/neptunian/react-photo-gallery)\n[![Coverage Status](https://coveralls.io/repos/github/neptunian/react-photo-gallery/badge.svg?branch=master)](https://coveralls.io/github/neptunian/react-photo-gallery?branch=master)\n[![Dependency Status](https://david-dm.org/neptunian/react-photo-gallery.svg)](https://david-dm.org/neptunian/react-photo-gallery)\n\n* Responsive, accessible, composable, and customizable image gallery component \n* Maintains the original aspect ratio of your photos\n* Creates a masonry or justified grid \n* Supports row or column direction layout\n* Provides an image renderer for custom implementation of things like image selection, favorites, captions, etc.\n* SSR app compatible\n\n## Preview\n\n| Row       | Column           |\n| ------------- |:-------------:|\n| <img src=\"https://live.staticflickr.com/65535/40680327133_6f6218bfa3.jpg\" /> | <img src=\"https://live.staticflickr.com/65535/47594180212_0dc2694eda.jpg\"> |\n\n\n## Installation\n\n```\nyarn add react-photo-gallery\n```\n\n## API Documentation\n\n[http://neptunian.github.io/react-photo-gallery/](http://neptunian.github.io/react-photo-gallery/)\n\n## CodeSandbox Demos with Example Use Cases\n\n* [Basic Row Layout](https://codesandbox.io/s/9yx911wl9y)\n* [Basic Column Layout](https://codesandbox.io/s/r09k1xj614)\n* [With Lightbox](https://codesandbox.io/s/5vn3lvz2n4)\n* [Dynamic Columns Using columns prop](https://codesandbox.io/s/ll7ym48027)\n* [Selection using custom renderImage](https://codesandbox.io/s/o7o241q09)\n* [Sortable with drag and drop](https://codesandbox.io/s/8y7n1r9y5j)\n\nTo build some examples locally, git clone and run:\n\n```\nyarn install\nyarn start\n```\n\nThen open [`localhost:8000`](http://localhost:8000) in a browser.\n\n\n## Minimal Setup Example\n\n```jsx\n\nconst photos = [\n  {\n    src: 'http://example.com/example/img1.jpg',\n    width: 4,\n    height: 3\n  },\n  {\n    src: 'http://example.com/example/img2.jpg',\n    width: 1,\n    height: 1\n  }\n];\n\n<Gallery photos={photos} />;\n\n```\n\n## How It Works\n\n### Row Layout\nThis layout uses an algorithm adapted from the Knuth and Plass line breaking algorithm.  It uses a graph to calculate the single best layout where each photo to break on is represented by a node and each edge is represented by a row. The cost of the edge is determined by the user provided `targetRowHeight` vs the row height calculated if it were to break on this node/photo. What you end up with is a layout with rows that are similar in height and photos that are not being stretched or shrunken abnormally as is what happens in a naive implementation. This solves the issue of panoramas shrinking rows or having stragglers or stretched images at the last row, instead creating a justified grid.  To make sure it's speedy the graph is being built as the shortest path is being calculated so the entire adjacency list is not calculated ahead of time. You can control how many neighboring nodes that Dijkstra's algorithm will search when it's visiting a node by adjusting the `limitNodeSearch` property, but it's recommended you use the default algorithm. See documentation for recommendations.\n\nInspired by [this blog article](http://blog.vjeux.com/2014/image/google-plus-layout-find-best-breaks.html) and this [Google Photos blog article](https://medium.com/google-design/google-photos-45b714dfbed1) (under 2. Justified Gallery).\n\n### Column Layout\nGoes through each column looking for the best place to insert the next photo by finding the shortest column. Not recommended for panorama aspect ratios.\n\n## Thanks\n\nSpecial thanks to [Christopher Chedeau](https://blog.vjeux.com/) for [writing about this interesting algorithm](http://blog.vjeux.com/2014/image/google-plus-layout-find-best-breaks.html) and whos code served as a starting off point.","readmeFilename":"README.md"}