Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table doesn't render point fields as text #104

Open
timwis opened this issue Sep 23, 2015 · 4 comments
Open

Table doesn't render point fields as text #104

timwis opened this issue Sep 23, 2015 · 4 comments
Labels

Comments

@timwis
Copy link
Owner

timwis commented Sep 23, 2015

Shows [object Object] instead

@timwis timwis added the bug label Sep 23, 2015
marks pushed a commit to marks/vizwit that referenced this issue Jan 9, 2016
@marks
Copy link
Collaborator

marks commented Jan 9, 2016

@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

marks pushed a commit to marks/vizwit that referenced this issue Jan 9, 2016
marks pushed a commit to marks/vizwit that referenced this issue Jan 21, 2016
marks pushed a commit to marks/vizwit that referenced this issue Jan 21, 2016
marks pushed a commit to marks/vizwit that referenced this issue Jan 21, 2016
this time in a feature branch
marks pushed a commit to marks/vizwit that referenced this issue Jan 21, 2016
@marks
Copy link
Collaborator

marks commented Jan 21, 2016

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

marks pushed a commit to marks/vizwit that referenced this issue Jan 21, 2016
@timwis
Copy link
Owner Author

timwis commented Jan 21, 2016

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?

@marks
Copy link
Collaborator

marks commented Jan 22, 2016

All good points. Let me look into a way to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants