EDIT: I figured it out. in one of the attached script was window.onload what caused for canvas to be created after everything alse was already executed. So when I added a script the canvas yet did not exist :)
I cannot change the size of canvas element. I build typical website with Bootstrap and the code in my index.html is like this:
<div id="container">
//some code
<div id="divForCanvas">
</div>
</div>
<script src="js/index2.js"></script>
in the index2.js I append canvas as a child of
<div id="divForCanvas"></div>
What happens is that the generated canvas has different width and height than its div parent.
Is there a way to adjust size of canvas after it was already generated (without editing index2.js) ?