It seems that Vega has no fallbacks for what happens if a user gives it bad data; instead, it outputs crazy errors to the console (on mousemove over the graph) and loads a blank graph.
We've first seen the error when stack data was inputted with double coordinates by accident. Having no fallback for errors in data, vega "exploded", giving a console error, not rendering the graph in view mode and then outputting more and more errors on mouseover.
Example of faulty data:
<graph>{ "width": 650, "height": 350, "padding": { "top": 25, "left": 30, "bottom": 30, "right": 10 }, "data": [ { "name": "table", "values": [ { "x": 1, "y": 30, "c": 0 }, { "x": 0, "y": 55, "c": 1 }, { "x": 1, "y": 43, "c": 0 }, { "x": 1, "y": 91, "c": 1 },
As you can see, x:1,c:0 exists twice, which makes this a duplicate dataset and hence an error. This isn't a very obvious error, though, so it might be expected to happen especially with direct manipulation of the JSON string.
The errors are -
vega.js:4142 Uncaught TypeError: Cannot read property 'push' of undefined vega.js:2372 Uncaught TypeError: Cannot read property 'marktype' of null (repeatedly, on mouseover)
This means that any user that either makes a mistake or uploads data that has errors may make vega very unhappy and ruin graphs. This is something the Graph extension should validate.
We've submitted a bug upstream to vega about this, and hopefully one day they'll have some sort of 'isValid' method, but as they don't, the data piece of graphs should probably be validated for the user, and the system should refuse to save if the data portion is invalid or has obvious errors.