woodbuffalo / powerbi-leaflet

Leaflet based visualization for PowerBI
18 stars 10 forks source link

roles or mapping have some static column #7

Closed whyvez closed 8 years ago

whyvez commented 8 years ago

@jo-tham looks like there are hard coded columns in the roles or mapping config. I exported the data from the real datasets and it didn't work. As soon as I renamed the fields latitude,longitude,category it worked.

jo-tham commented 8 years ago

Looking into it now

jo-tham commented 8 years ago

kind of stumped here

a dataRole name attribute is supposed to be bound to any field we assign to the data role.

so should be able to drag a field, say, long into dataRole with a displayName Longitude, which internally has name longitude

there's no a lot to change in the data role. so either i'm wildly missing something or there is some leaky abstraction

whyvez commented 8 years ago

@jo-tham I saw https://github.com/Microsoft/PowerBI-visuals/blob/master/src/Clients/Visuals/capabilities/map.capabilities.ts#L56 yesterday. Wonder if to do with it or something similar?

jo-tham commented 8 years ago

thanks for pointing that out @whyvez

actually, when you asked earlier if i was using capabilities.json or putting it in the typescript file, this came to mind, and in the commit history you can probably see that i once removed calls to createDisplayNameGetter because it was giving me errors before and didn't seem necessary given their description of how name attr works.

i'll try moving capabilities to visual.ts and using that function

jo-tham commented 8 years ago

not so sure actually - since that is for displayName it shouldn't make a difference...

i.e. in the dataViewMappings they use name, Y to bind roles

https://github.com/Microsoft/PowerBI-visuals/blob/master/src/Clients/Visuals/capabilities/map.capabilities.ts#L132

:S