Fixes #2 for Safari 5.0.x and other browsers without toISOString support.
Fix #5, allowing the y-axis to negative. If only nonpositive values are seen, then the y-maximum is 0; if only nonnegative values are seen, then the y-minimum is 0; otherwise, the y-domain is the minimum and maximum value. X-labels are always drawn on the bottom. This also adopts D3 2.4's si-prefix format for both y-axis labels and for rolling sum values. The y-axis labels use d3.formatPrefix to determine the SI prefix that would be used for the largest value, and then applies that to all ticks for consistent labeling.
This allows you to register static files for serving.
This allows you to build custom visualizations hosted by the visualizer.
This allows it to be used outside of lib/cube; for example, you can now add a static file endpoint to your visualizer if you want to host custom pages.
If you omit the "stop" attribute of an /event/get request, new events will continue to stream in periodically. This allows realtime visualizations of individual events.
We now detect when the web socket is closed, and abort the query. This commit also changes all errors to be re-thrown and logged centrally, rather than duplicating logging code.
The connection._socket is connection.socket for websocket (draft-10).
When POSTing event data to the `/1.0/event/put` endpoint, the POSTed JSON data can either be an array of event objects, or a single event object. Any other kind of JSON is ignored, and a 400 Malformed Request response is sent to the client. Test for a 400 response when POSTing either bad JSON or JSON whose root value is not an array or object, and a 200 response otherwise.
Previously, the test.request function in test.js checked for a data argument by looking at the value of `arguments.length`, but since it was inside a closure with no arguments, the test would never return true, even if a data argument was passed to the enclosing function. Now, the test is whether the data argument of the enclosing function is truthy and has a length greater than zero.
This retains support for older drafts of WebSockets for backwards-compatibility, using @theturtle32's websocket package for the latest draft-10. This makes Cube compatible with yesterday's stable release of Chrome (and other browsers).