A Javascript library to conveniently add distribution builders to your online and offline experiments.
-
Added arguments to the initialization of the distBuilder:
toggleGridClick
. If true, this argument allows user to add balls to bucket by clicking on the grid.addTotals
. If true, add a "totals" row at the bottom of the distBuilder, summarizing how many balls are in each bucket. Thanks to Marine Hainguerlot for the suggestion!
-
Fixed rare bugs causing the visual aspect of the distBuilder to diverge from its internal state
-
Cleaned up the code and documentation. It should now be faster for larger distBuilders.
- Added method:
distBuilder.setDistribution()
. This function is useful if you want the user to start from a pre-specified distribution. Thanks to Roy Hsieh for the suggestion!
- Minor changes to CSS to enhance compatibility with Qualtrics.
- distBuilder has been rewritten in Typescript. This does not affect the behavior of the library in any way, but makes it easier for developers to build more complex apps on top of distBuilder.
- The width of the distribution builder is now automatically adjusted
using CSS
flexbox
. - The argument
resize
ofDistributionBuilder.render()
will be deprecated in future versions. For compatibility reasons, using theresize
argument does not raise an error, but it no longer affects the behavior of the distribution builder. - Changed the HTML structure: the inner
<div class="cell"></div>
now includes a<div class="ball"></div>
. The appearance of the "balls" in the distribution builder can now be changed more easily. - The method
getDistribution()
now returns a copy of the current allocation. This is to avoid accidental side-effects.
- First release of the library.