Fix bug 328. Simplify resizing by not recreating everything from scratch. This makes it simpler to deal with i328, since we don't have to worry about unremoved event handlers.

Since we're not building everything from scratch, we have to make sure the clipping area is set correctly. Although there's a resetClip method in the HTML5 spec, it's too new. But, man, if we had it things would be great. So instead there's a conditional restore (no restore on the first operation) and a save, for the subsequent restore.

Almost all tests pass, but the ones that test save/restore balances are unsurprisingly broken, as there's one additional save. This can be addressed with calls to g.destroy prior to the assertion, or make a special assertion that verifies there's one more context save than restore.

This has an additional benefit of being slightly faster. Using /Users/konigsberg/git/kberg-dygraphs/tests/resize.html and the following snippet

var start = new Date().getTime();
for (var idx = 0; idx < 500; idx++) {
    g.resize(100 + idx, 100 + idx);
}
console.log(new Date().getTime() - start);

I frequently saw a difference of about 200ms (2200-range to 2400-range.) How much of that was drawing a mildly complex image? Who knows?

I also did some minor refactoring with regards to events, and event method names to make things easier to track.

There may be a need for a plug-in event for resizing.
Fix bug 382. Simplify resizing by not recreating everything from scratch. This makes it simpler to deal with i328, since we don't have to worry about unremoved event handlers.

Since we're not building everything from scratch, we have to make sure the clipping area is set correctly. Although there's a resetClip method in the HTML5 spec, it's too new. But, man, if we had it things would be great. So instead there's a conditional restore (no restore on the first operation) and a save, for the subsequent restore.

Almost all tests pass, but the ones that test save/restore balances are unsurprisingly broken, as there's one additional save. This can be addressed with calls to g.destroy prior to the assertion, or make a special assertion that verifies there's one more context save than restore.

This has an additional benefit of being slightly faster. Using /Users/konigsberg/git/kberg-dygraphs/tests/resize.html and the following snippet

var start = new Date().getTime();
for (var idx = 0; idx < 500; idx++) {
    g.resize(100 + idx, 100 + idx);
}
console.log(new Date().getTime() - start);

I frequently saw a difference of about 200ms (2200-range to 2400-range.) How much of that was drawing a mildly complex image? Who knows?

I also did some minor refactoring with regards to events, and event method names to make things easier to track.

There may be a need for a plug-in event for resizing.
Merge branch 'i382' of https://github.com/kberg/dygraphs into i382
Merge branch 'i382' of https://github.com/kberg/dygraphs into i382
Merge branch 'master' of https://github.com/danvk/dygraphs into i382
Remove the vestigial DygraphLayout.setDateWindow.
(Also, add a clarifying comment.)
LogScale and customBars with negative values

When LogScale and customBars are enabled, it was verifying if the value was negative by using a <= on an array and then inserting a null. This caused exceptions in rollingAverage(), the value can't be null when using customBars.

(This a new patch based on the current code, since pull request #236 was getting old).
Add test for custom bars with negative values in logScale
Add comment
Update dygraph.js
Update dygraph.js
The local auto tester's javascript is messy and having it embedded in HTML doesn't help, so this change moves it out into its own file.
Turn auto-tests script into an object for saner manipulation.
Rewrite local testdriver processing. Using a listener framework to report test results, and also, store test execution durations.
Make a table view out of the test results for easier reading.
Merge pull request #251 from kberg/auto-tests

Nicer auto tests
Add nice little things to the in-browser test runner.
1. Add meta-links to the test name and new "more..." links.
2. Test name link runs that single test. more... shows the stack trace in an alert window. (Not ideal, but it's something.)
Merge branch 'master' of https://github.com/danvk/dygraphs into i382
Merge pull request #252 from kberg/auto-tests

Add nice little things to the in-browser test runner.
Merge branch 'master' of https://github.com/danvk/dygraphs into i382