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
87.7
Supply Chain
90.9
Quality
75.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
4,376,023
Last Day
2,385
Last Week
11,009
Last Month
41,748
Last Year
841,566
1,982 Stars
464 Commits
310 Forks
37 Watching
6 Branches
14 Contributors
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
Publised On
01 Jul 2019
Cumulative downloads
Total Downloads
Last day
-4.3%
2,385
Compared to previous day
Last week
-13.6%
11,009
Compared to previous week
Last month
-26.3%
41,748
Compared to previous month
Last year
-9.3%
841,566
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
project is not fuzzed
Details
Reason
security policy file not detected
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
125 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-20
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