Open kd-ods opened 3 years ago
Things have moved on since this was posted. We now say in the docs that:
The visualiser requires JSON data with a minimum set of data fields to produce a directed graph. It is not necessary for the supplied JSON data to be valid BODS data, but it must meet these minimum requirements.
From: BODS Visualiser specification
The error message is still as above, though, and needs to be improved. (And is there only one error message??) It would be more helpful to say sthg like: "There was an error drawing your data. Does it conform to the data requirements?"
I hope that the draft of the new specification makes it easier to see why and where error messages should be produced.
For example, we say that the input to the tool:
MUST be a valid JSON array of objects
So I think the first error that a user might encounter would give them the message:
"There was an error drawing your data. The data must be a valid JSON array of objects. See the data requirements."
Perhaps the next possible error message would be when data is a valid JSON array of objects, but - after parsing and processing - actually no nodes or edges are rendered. It would be good to give user feedback in that instance:
"Your data does not have any information that can be drawn. See the data requirements for help."
Once there is data can be rendered, there will be few if any occasions to give an error message.
Note, the current error doesn't exist in this repo; it's only implemented in the BODS Data Visualiser demo on the Open Ownership site.
New errors will need to be implemented within this repo directly, likely as a string originating in the /src
somewhere, then being passed to a alert
in the /demo
example code.
If the visualiser can't parse the BODS data, we have a message box pop up saying "Sorry, there was an error drawing your data. Is it valid BODS?" There are times, however, when a bug in the visualiser means that users get this error message even when the BODS is valid.
Could any additional info or error report be generated and shared with the user to help with troubleshooting and bug reporting?