1. 19 Jan, 2013 4 commits
    • David Schnur's avatar
      Added methods to draw and measure text. · edc2bbd9
      David Schnur authored
      These methods provide a common way to draw HTML text above a canvas.
      
      The getTextInfo method generates div HTML for text with a given font
      style/class and angle, measures the element's dimensions, and saves
      everything in a cache.  The drawText method takes the resulting entry,
      finishes generating the inline styles necessary to position the div, and
      adds the result to a buffer.  The render method dumps the buffer into an
      overlay and expires unused cache entries.
      edc2bbd9
    • David Schnur's avatar
      42d5592a
    • David Schnur's avatar
      Abstract-out canvas creation into an object. · a9be4d55
      David Schnur authored
      Moved canvas creation and size management into a new Canvas class.
      
      This is the first step towards a more object-oriented architecture.
      Since we create multiple canvases, and have to maintain several
      module-global variables to track their properties, they are the ideal
      place to start.
      
      This commit also removes sizing code that was duplicated between
      makeCanvas and resizeCanvas.
      a9be4d55
    • David Schnur's avatar
      Renamed the 'canvas' variable to 'surface'. · f66c9ae3
      David Schnur authored
      Renaming the variable gives us room to create a new class called Canvas.
      f66c9ae3
  2. 14 Jan, 2013 2 commits
  3. 13 Jan, 2013 1 commit
  4. 12 Jan, 2013 4 commits
  5. 11 Jan, 2013 5 commits
  6. 10 Jan, 2013 7 commits
  7. 03 Jan, 2013 3 commits
  8. 23 Dec, 2012 2 commits
    • David Schnur's avatar
      Update auto-scaling to support the zero option. · b6924a96
      David Schnur authored
      Added a format option 'autoscale' that controls whether the given point
      is considered when determining an automatic scale.
      
      The lines & bars 'zero' option controls whether autoscale is set on the
      dummy point that is inserted to create the series lower-bound.
      b6924a96
    • David Schnur's avatar
      Added a 'zero' option for lines and bars. · 126cb072
      David Schnur authored
      Area and bar plots normally use a minimum of zero, since their purpose
      is to show size, and using an auto-scaled minimum distorts the plot's
      meaning.  But this behavior is undesirable in cases where the plot type
      is used in more of a decorative sense.
      
      The zero option provides a way to control this behavior.  It defauls to
      true for bars and filled lines.
      126cb072
  9. 22 Dec, 2012 4 commits
    • David Schnur's avatar
      Enforce left-to-right canvas layout orientation. · d7c58b59
      David Schnur authored
      When the placeholder has (or inherits) the HTML 'dir' attribute or CSS
      'direction' we get unexpected results from text metrics, resulting in
      visual glitches on the axes.
      
      The suggested solution in #716 was to set ltr on the placeholder, but
      this introduces its own problems, since the user probably *does* expect
      rtl on items like the legend.  So we'll instead set ltr only on the
      canvases.
      
      We should review this behavior at some point; rtl is something we need
      to handle, not work around.  It also needs to be kept in mind as we move
      canvas-text into a plugin.  But for now this solution at least ensures
      consistent behavior.
      d7c58b59
    • David Schnur's avatar
      Prevent color generation with all fixed indexes. · a6414cac
      David Schnur authored
      As pointed out in a comment to #832, initializing maxIndex to zero
      results in the creation of a single color even when all indexes are
      fixed.
      a6414cac
    • David Schnur's avatar
      Tweak comparison order for clarity. · 88e0567b
      David Schnur authored
      88e0567b
    • David Schnur's avatar
      61c1cad9
  10. 21 Dec, 2012 6 commits
  11. 20 Dec, 2012 2 commits