add isEmpty method in viewhistory, optimize history init in canvas #135