JoeK
JoeK

Reputation: 41

R Power BI Custom Visual Extra Data

I have created a Power BI custom visual for R based on the Medium and Radacad examples below

https://radacad.com/create-custom-visual-with-r-and-json-part3

https://medium.com/@Konstantinos_Ioannou/how-to-create-an-r-custom-visual-html-for-powerbi-7f2d2e44e453

Everything has worked so far but I can't find any way to load extra data into my visual apart from the dataset (Values) data provided by the package from Power BI to the R script.

I've spent hours trawling the web looking for any way to incorporate a JSON file into the package structure so that the data (image URIs in this case) will be available to the R script to process and use images from the JSON in an output.

I can't really share anything beyond that given this isn't a code issue more an understanding of where and how to place the JSON file within the structure of my package.

Here is the file structure, the JSON is called image_uri_v1.JSON

enter image description here

Any help would be massively appreciated.

I've tried adding the image JSON file to the assets,src,root folders and tried to pull the data in using multiple variations on the below, but everything culminates in the visual not displaying in Power BI due to a failure to locate the file.

I've also looked at this article, but I'm not sure it relates to Power BI Custom R visuals, it seems to be for R packages

inst and extdata folders in R Packaging

uri_data <- fromJSON(readLines("assets/yourfile.json"))

I know using fromJSON and readLines works as I have tried this in R studio outside of the Power BI R custom Visual package environment.

I'm using the pbiviz package --verbose pwsh command to execute the package build

Upvotes: 0

Views: 42

Answers (0)

Related Questions