Changed the way sample size info is passed to canvas, to avoid coupling