PantherView
PantherView copied to clipboard
Pin description style
When we hover over the pins, or click on them, the description that pops up should be prett-ified. This will need coordination from the UI team and the Data team, because the contexts for each dataset is different.
Right now both datasets we have (city 311 and police) are displaying different info (#46). We should have some UI to standardize this; maybe a key-value table. On the other hand, the keys from the dataset are really ugly... maybe we can hard-code map the keys we want to display to some user-friendly property name in the record
before it's pushed to the array of markers
.
@chrisski44 , would you be interested in taking this issue? Essentially, I think you should create a function that takes an object that has the general form:
{
title: "Example Title",
fields:[{
label: "Field label example 1",
value: "Field label example 1 value",
}, {
label: "Field label example 2",
value: "Field label example 2 value",
}]
}
Then it creates an HTML string for this. For example, the obj.title
should be inside a <h4>
tag, I think, and I think you should create a <table>
you should loop over all the obj.fields
and add a two-column table mapping the label
to the value
. Normally, we should stay away from tables in HTML, but this is actually tabular data, so it's the right use-case. Here's an MDN reference on tables: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table. Test it on the 311 data, for example, using some of the important fields that are returned in the record
, and we'll go from there.
Are you interested?
This will fix #46, too.
@vonbearshark Yeah for sure I'll take this one on. I may have a few questions but I'll let you know!
I'll be happy to help. Thanks!