D3 provides a method .data()
to acquire data from a selection. My simple experience suggests that applying this method may cost time, if not substantial, for the data to be loaded to a local variable using say, for instance, var data = d3.select('.someClass').data()
, especially if the dataset is large.
I am wondering is if there is a mechanism to verify if the data has been acquired. This appears to be different from, for example an AJAX call, since there is no server concerned here. (Correct me if I am wrong.) One possible solution is to use setTimeout
or use setInterval
. However, they both require a pre-set time interval, which may cause unnecessary delay.
Is there a mechanism to trigger an 'alert' when the data acquisition using this .data()
method has completed?