Commit Graph

908 Commits (2d2efc545e8264ed3b2e0447c063840fc88ccecf)
 

Author SHA1 Message Date
David Schnur e7de873524 Factor out text layer creation to its own method.
This sets the stage for allowing the use of multiple layers.
13 years ago
David Schnur a036aa962a Reverse cache key order to ensure uniqueness.
Also switch from dashes to pipes, and remove the angle for now, since we
don't currently support rotated text.
13 years ago
David Schnur a9a31644c7 Replace drawText with add and remove methods.
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.
13 years ago
David Schnur 42286155be Updated credits for #964 navigate event.drag fix. 13 years ago
David Schnur 1774536af6 Fixed inline event.drag's use of $.event.handle.
This resolves issue #964.
13 years ago
David Schnur 5d7086968f Simplify creation of the cached element. 13 years ago
David Schnur 4b1ff972b1 Merge pull request #966 from bor/fix/PLUGINS_example
Fix example (syntax error and indenting).
13 years ago
Sergiy Borodych 68df2de308 fix example (syntax error and indenting) 13 years ago
David Schnur ff0e5c1b1a Move cached hasOwnProperty to the top level. 13 years ago
David Schnur 73baa2b9e3 Cache actual elements instead of buffering HTML.
This significantly improves performance, since we already create the
elements when measuring them, and that effort is now no longer wasted.
We must take care to detach, rather than remove, when clearing the text
layer, so we can add the elements back later if necessary.
13 years ago
David Schnur 2cd4f8b900 Merge pull request #961 from brianpeiris/master
Add basic Travis CI setup with test script that runs JSHint.
13 years ago
Brian Peiris c39053d845 Fix README. 13 years ago
Brian Peiris 71d32b6735 Fix build status. 13 years ago
Brian Peiris 88485f7a39 Add build status to README. 13 years ago
Brian Peiris 232ad7fbff Fix travis config. YAML forbids tabs. 13 years ago
Brian Peiris 5a4fc55d8d Add basic Travis CI setup with jshint test. 13 years ago
David Schnur d4f93a28b8 Allow 'false' to be provided as a stack option.
This resolves #18, but without catching zero, which is a valid key.
13 years ago
David Schnur be9f60d210 Merge pull request #957 from dnschnur/legend-reverse
Added a legend 'reverse' sorting option.
13 years ago
David Schnur 6bbce44644 Updated the API with the legend 'reverse' option. 13 years ago
David Schnur 51e14f6a27 Added a 'reverse' sorted option.
This orders the legend entries in reverse order of their series.
13 years ago
David Schnur 9696579386 Minor tweak to example title alignment. 13 years ago
David Schnur ccb37e4965 Added missing credit line. 13 years ago
David Schnur 410dd7dbef Merge pull request #953 from dnschnur/jquery-chainable
Added the plot function as a chainable property.
13 years ago
David Schnur a787fa4e9c Updated credits for #953 chainable property. 13 years ago
David Schnur 1cb170df6e Updated credits for #895 threshold rounding fix. 13 years ago
David Schnur 06b201934c Updated credits for #534 pie string data fix. 13 years ago
David Schnur a6ce78d156 Remove unnecessary debugging code.
Modern browser consoles obviate the need for an object logging function.
13 years ago
David Schnur e491dc7a06 Cache the data value, since it is used repeatedly. 13 years ago
David Schnur d3a6bc965f Remove unnecessary numeric value checks.
The previous processing step already guarantees that the values are
numeric.
13 years ago
David Schnur 2a189b2cfb Improve the data value fix-up step.
This resolves #534 by handling the case where data is a string, whether
it is provided alone or as a pair.  We can also eliminate the old and
unnecessary check for undefined values.
13 years ago
David Schnur aaa1cc7f84 Document the new plot chainable property. 13 years ago
David Schnur 49cce02be9 Add the plot function as a chainable property.
Resolves #734 and #816.
13 years ago
David Schnur 78f2dfdf09 Updated credits for #937 lineWidth work-around. 13 years ago
David Schnur ad823de836 Merge pull request #937 from jamiehs/issue-842-cherry-pick
Fix inability to set the point lineWidth to 0.
13 years ago
David Schnur 9108c292c7 Avoid rounding errors with intersection points.
This resolves #895.
13 years ago
David Schnur 73e7dd7da8 Updated credits for pie setData fix. 13 years ago
David Schnur ef73cf7ec1 Set processed back to false after processing.
This temporary fix addresses the problem described in #810, and possibly
#945, where calls to setData for a pie chart do nothing.
13 years ago
David Schnur 7317b9c632 Remove the non-existent second 'data' parameter. 13 years ago
David Schnur 9ede692e2f Removed the unused plugin-global raw variable. 13 years ago
David Schnur 55864254d2 Removed unnecessary plugin-global variables.
The canvasWidth, canvasHeight, legendWidth and legendHeight variables
existed only to share data between the setupPie and draw functions.  Now
that setupPie has been folded into draw, they're no longer necessary.
13 years ago
David Schnur 6d70144d5e Moved setupPie into the draw function.
This code is only used to prepare the plot for drawing; inlining it is
cleaner and will allow us to get rid of some plugin-global variables
that existed only to give setupPie a way to share data with the draw
function.
13 years ago
David Schnur cfc07ff285 Eliminate the plugin-global redraw flag.
The redraw flag starts out as true, then is immediately set to false on
draw.  If labels are enabled, drawPie calls drawLabels, which calls
drawLabel for each label.  Any label that can't fit sets redraw back to
true, so the whole process can repeat.

This isn't the most obvious mechanism, and forces one to remember to do
things like setting redraw back to true after drawing, so the plot can
redraw itself on resize or when setting new data.

Instead we now have drawPie return true when it drew successfully, and
false otherwise, which the same happening in drawLabels and drawLabel.
Instead of checking the flag, we now just check the return value.

This has the added benefit of slightly improving performance in the case
where several redraws are necessary, since it now short-circuits out of
the draw loop as soon as one label fails to fit.
13 years ago
David Schnur fa463311dc Make redrawAttempts and shrink proper constants. 13 years ago
David Schnur 778894324d Make the slice total a local variable.
The total is only used within the combine function; it doesn't need to
exist at the top level of the plugin.
13 years ago
David Schnur a1c84203bd Moved fixData and calcData into combine.
They're small and not used anywhere else, so keeping them in separate
functions only serves to increase complexity.
13 years ago
David Schnur a03c4c199d Moved other hooks out of the processOptions hook.
In plugins we should never add hooks conditionally; the condition should
remain within individual hooks, so the plugin can be toggled at any
time.

Ideally we should also 'inline' the hook functions, since they're used
nowhere else.  But since that would involve a lot of code changes, we'll
put it off until the broader cleanup effort scheduled for 0.9.0.
13 years ago
David Schnur f294bf19a3 Cleaned up processOptions and bindEvents hooks. 13 years ago
David Schnur aaf41ea411 Fix placeholders for examples with other content.
After shrinking the global example placeholder size, ones with
additional content within the demo area needed to be tweaked
individually, to prevent the other content from wrapping down or
extending off the side of the container.
13 years ago
David Schnur b475c7219e Slightly reduce placeholder and header sizes.
The smaller size ensures that the example plots remain fully visible on
more of our most common visitor screen resolutions.
13 years ago
David Schnur bcce4a48b5 Load the first AJAX series by default.
We don't want users to think the example is broken when they first load
it.
13 years ago