Reduce duplicated particles
See original GitHub issueI am trying to display a set of images as particles and I would like each image to be displayed exactly once. Currently is not possible, because each particle gets assigned a random image, thus some of the images will appear multiple times and others won’t show at all.
Would it be possible to have an additional configuration option specifically for preventing duplicates as much as possible?
It could be a boolean option like reduceDuplicates under params.particles.shape options and when enabled, following behaviour would be expected:
- if
params.particles.number.limit<=image array length, then there will be no duplicates - if
params.particles.number.limit>image array length, then duplicates are to be expected
I am seeing as possible implementation to have 2 image arrays: original and copy. The original array would be immutable, and the copy array would get consumed with each particle that gets generated, then when the copy array gets empty, will get refreshed from the original array.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (7 by maintainers)

Top Related StackOverflow Question
@matteobruni alright, will try to implement this feature
Issue-Label Bot is automatically applying the label
feature_requestto this issue, with a confidence of 0.87. Please mark this comment with 👍 or 👎 to give our bot feedback!Links: app homepage, dashboard and code for this bot.