resize canvas to window size
calculate data and paint to canvas