Update dataset.js

Make local a function are datum to be more flexible