programmatic creation of canvas