Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I'm trying to create a custom visual similar to the shape map visual, with a few modifications. One modification is that I'm trying to find a way to use table data (strings) as the source of the json map(s). So, my data consists of:
I know I can't have multiple dataViews or multiple dataMappings. Does that mean the above is impossible? I've read the documentation on dataViewMappings but am having a hard time understanding what all is possible within a single dataMapping. Thanks!
Solved! Go to Solution.
Hi @Anonymous,
If I understand correctly, your dataViewMapping could contain the JSON data as a dataRole that would be seemingly unrelated to other data but would map out the JSON to each row of your dataView.
This can work but as you're presumably working with GeoJSON, I can't imagine these fields being particularly compact. As such having the GeoJSON in each row of your dataView is going to potentially blow up the resources your visual will need and you may not get particularly good performance. Not great if you want to use a lot of data points.
This is a great example where multiple dataViewMappings would be really useful, and I'd love to see this restriction lifted at some point...
I think that to minimise impact on visual performance and give you more flexibility with the dataView you can work with, it would probably be best to allow the GeoJSON to be provided as an object (property) of the visual, which unfortunately means that data-driving it might be tricky.
Alternatively, you could use a URL for the GeoJSON as a dataRole? This wouldn't add much overhead in terms of data consumption and you could use TypeScript to load from a known location, only if there is a difference in the value between updates?
Not sure if this answers your question, but might give you some jumping-off points.
Good luck!
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
We also require this feature to input unrelated data into the viewer.
In our 3D architecture viewer, we need:
Right now we need to create unnescessary fake relationship between these items, which makes for a messy data model and extra data. It's a dirty hack and we'd prefer to have an efficient method to input multiple data points that are not related in out 3D viewer application.
Hi @Anonymous,
If I understand correctly, your dataViewMapping could contain the JSON data as a dataRole that would be seemingly unrelated to other data but would map out the JSON to each row of your dataView.
This can work but as you're presumably working with GeoJSON, I can't imagine these fields being particularly compact. As such having the GeoJSON in each row of your dataView is going to potentially blow up the resources your visual will need and you may not get particularly good performance. Not great if you want to use a lot of data points.
This is a great example where multiple dataViewMappings would be really useful, and I'd love to see this restriction lifted at some point...
I think that to minimise impact on visual performance and give you more flexibility with the dataView you can work with, it would probably be best to allow the GeoJSON to be provided as an object (property) of the visual, which unfortunately means that data-driving it might be tricky.
Alternatively, you could use a URL for the GeoJSON as a dataRole? This wouldn't add much overhead in terms of data consumption and you could use TypeScript to load from a known location, only if there is a difference in the value between updates?
Not sure if this answers your question, but might give you some jumping-off points.
Good luck!
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Sorry for the late reply and acceptance, but thanks for taking the time to respond! For now I have the json set up as a property of the visual, as you suggested. I agree that multiple dataViewMappings would be great to see at some point!
Hi @Anonymous - you're very welcome! Glad you have a working visual 🙂
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |