var timerId = setTimeout(...);
clearTimeout(timerId);
...
controllers
models
...
public_html
...
vendor
...
#cube {
background: linear-gradient(to top, #fce25b, #ecc92b);
box-shadow:
-1px 0px rgb(220,195,35), -1px 1px rgb(192,167,7),
-2px 1px rgb(219,194,34), -2px 2px rgb(191,166,6),
-3px 2px rgb(218,193,33), -3px 3px rgb(190,165,5),
-4px 3px rgb(217,192,32), -4px 4px rgb(189,164,4),
-5px 4px rgb(216,191,31), -5px 5px rgb(188,163,3),
-6px 5px rgb(215,190,30), -6px 6px rgb(187,162,2),
-7px 6px rgb(214,189,29), -7px 7px rgb(186,161,1),
-8px 7px rgb(213,188,28), -8px 8px rgb(185,160,0);
}
Скажите, может ли он ставить по одной точке и показывать?
const getRandom = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
const NUM_POINTS = 100000;
const BASE_POINTS = [
[ 50, 50 ],
[ 1200, 50 ],
[ 625, 500 ],
];
const draw = SVG('drawing').size(1200, 500);
const group = draw.group();
let currPoints = 0;
let point = [ (getRandom(50, 1200)), (getRandom(50, 500)) ];
function nextPoint(previousPoint) {
const basePoint = BASE_POINTS[getRandom(0, BASE_POINTS.length - 1)];
point = [ (previousPoint[0] + basePoint[0]) / 2, (previousPoint[1] + basePoint[1]) / 2 ];
group.add(draw.circle(1).fill('#000').move(point[0], point[1]));
}
(function next() {
if (currPoints < NUM_POINTS) {
for (let i = 0; i < 100; i++, currPoints++) {
nextPoint(point);
}
setTimeout(next, 50);
}
})();
<script src="https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.5/svg.min.js"></script>
<div id="drawing"></div>
я не понимаю о чем вы, что за методы
output
Returns the PDF as a string. The file will open a download dialog by default. The options parameter controls the output.
stream
Streams the PDF to the client. The file will open a download dialog by default. The options parameter controls the output.