The scatter example page now has negative numbers in both directions

This commit is contained in:
Evert Timberg 2015-05-18 08:44:06 -04:00
parent 492292e94b
commit e30a9d2a94

View File

@ -16,7 +16,7 @@
<button id="randomizeData">Randomize Data</button>
<script>
var randomScalingFactor = function() {
return Math.round(Math.random() * 100);
return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
};
var randomColor = function(opacity) {
return 'rgba(' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + (opacity || '.3') + ')';