If you don't have a valid X or Y in your data (for example, if one of them is empty/blank), you get a weird error, Uncaught TypeError: Cannot read property 'clone' of null. I know it's up to me as a user of the library to make sure I have good data, BUT in the case I don't for whatever reason, would be nice to have a more instructive error message.
I think this can be done by wrapping these lines in a classic .hasOwnProperty(). This might be a bit verbose though ... what do you think?
If you don't have a valid X or Y in your data (for example, if one of them is empty/blank), you get a weird error,
Uncaught TypeError: Cannot read property 'clone' of null. I know it's up to me as a user of the library to make sure I have good data, BUT in the case I don't for whatever reason, would be nice to have a more instructive error message.I think this can be done by wrapping these lines in a classic
.hasOwnProperty(). This might be a bit verbose though ... what do you think?