Split canvas js to partial