• David Schnur's avatar
    Replace drawText with add and remove methods. · a9a31644
    David Schnur authored
    Every cache element now contains the actual text element instead of just
    its HTML, plus a flag indicating whether it is visible.  The addText and
    removeText methods control the state of this flag, and the render method
    uses it to manage elements within the text container.  So where we
    previously used drawText to actually render text, now we add each string
    once, then let the render method take care of drawing them as necessary.
    
    This dramatically improves performance by eliminating the need to clear
    and re-populate HTML text on every drawing cycle.  Since the elements
    are now static between add/remove calls, this also allows users to add
    interactivity, as they could in 0.7.  Finally, it eliminates the need
    for a separate 'hot' cache.
    
    I also removed the unnecessary 'dimensions' object; it's easier and
    faster to store the width and height at the top level of the info
    object.
    a9a31644
jquery.flot.canvas.js 8.17 KB