Open timwis opened 9 years ago
@timwis there is probably a more elegant way to do this (or better place to stash this code) but I think that stringify'ing the JSON is a good start to solving this bug.
demo: https://marks.github.io/vizwit/?gist=cf635692f034e9a81c16
Finally, a clean commit from me to fix this issue. Got confused with different ticket numbers. Will be an easy merge if you want to do handle it this way
Pardon my delay on this. Going back and forth about this one because it has to loop through every record and every field in each record and test its type, and I'm wondering whether that geojson string looks any less confusing than [Object object]
:-/
I think I have an idea -- in socrata-fields.js it maps socrata field types to DataTables field types using a hash at the top (typeMap
). What if there was another hash for custom renderers using DataTables render option? For instance:
renderMap: {
point: function (data, type, row, meta) {
return data.coordinates ? data.coordinates[1] + ', ' + data.coordinates[0] : ''
}
}
The only downside here is that it's putting table/view logic inside the fields collection. But maybe we could do it in the table view..thoughts?
All good points. Let me look into a way to implement this.
Shows
[object Object]
instead