Gathering detailed insights and metrics for react-photo-gallery
Gathering detailed insights and metrics for react-photo-gallery
Gathering detailed insights and metrics for react-photo-gallery
Gathering detailed insights and metrics for react-photo-gallery
react-photo-gallery-next
Fork react-photo-gallery. Responsive Justified React Image Gallery Component for Next.js
react-photo-album
Responsive photo gallery component for React
react-touch-gallery
react photo gallery for touch
@zposten/photoswipe-react
**‼️ This package has moved to [@olivare/react-photo-gallery](https://www.npmjs.com/package/@olivare/react-photo-gallery)**
npm install react-photo-gallery
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,975 Stars
464 Commits
310 Forks
36 Watching
6 Branches
14 Contributors
Updated on 27 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-22.9%
2,634
Compared to previous day
Last week
-6%
15,015
Compared to previous week
Last month
-16.4%
61,890
Compared to previous month
Last year
2.2%
904,123
Compared to previous year
2
36
Row | Column |
---|---|
yarn add react-photo-gallery
http://neptunian.github.io/react-photo-gallery/
To build some examples locally, git clone and run:
yarn install
yarn start
Then open localhost:8000
in a browser.
1 2const photos = [ 3 { 4 src: 'http://example.com/example/img1.jpg', 5 width: 4, 6 height: 3 7 }, 8 { 9 src: 'http://example.com/example/img2.jpg', 10 width: 1, 11 height: 1 12 } 13]; 14 15<Gallery photos={photos} />; 16
This 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.
Inspired by this blog article and this Google Photos blog article (under 2. Justified Gallery).
Goes through each column looking for the best place to insert the next photo by finding the shortest column. Not recommended for panorama aspect ratios.
Special thanks to Christopher Chedeau for writing about this interesting algorithm and whos code served as a starting off point.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
123 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More