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
npm install react-photo-gallery
Typescript
Module System
Node Version
NPM Version
86.8
Supply Chain
90.9
Quality
75.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
4,566,216
Last Day
467
Last Week
12,239
Last Month
48,151
Last Year
771,814
NOASSERTION License
1,994 Stars
464 Commits
313 Forks
37 Watchers
6 Branches
14 Contributors
Updated on Apr 30, 2025
Minified
Minified + Gzipped
Latest Version
8.0.0
Package Id
react-photo-gallery@8.0.0
Size
12.20 kB
NPM Version
6.9.0
Node Version
10.16.0
Published on
Jul 01, 2019
Cumulative downloads
Total Downloads
Last Day
7.4%
467
Compared to previous day
Last Week
3%
12,239
Compared to previous week
Last Month
-19.4%
48,151
Compared to previous month
Last Year
-18.2%
771,814
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
127 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-04-28
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