Add beforeDraw event callback attribute as discussed in #97