DataStrategist / TileMaker

An R package that enables the creation of data tiles for inclusion in a html dashboard or some such.
http://datastrategist.github.io/TileMaker/
MIT License
41 stars 9 forks source link

how to use this tilemaker in power bi r #10

Open waywen85 opened 5 years ago

waywen85 commented 5 years ago

h, i would like to use this in power bi but somehow i got the error on displaying a blank html file

DataStrategist commented 5 years ago

Hi! I didn't know you could display the output of any random R package in Power BI... I thought the author had to make an extension for it specifically in that store... that might be what's happening. Then again, it's possible you're just not using the correct item. Are you making sure to use the finisher()?

waywen85 commented 5 years ago

Yes. i paste the code below in the r script visual in power bi as per below:

library(TileMaker)

finisher(title = "Multi Box", divs = multi_box( values = c(21, 45), title = "WO/MO Lead Time", number_zoom = 300, icons = c("apple", "calendar"), type = "warning", txt = c("% Target", "% Prev Yr") ))

just wondering is this library(tilemaker) can be used in power bi? as it is not showing anything in power bi and it will only open a blank html file

DataStrategist commented 5 years ago

Indeed... I was playing around and it seems like it's close but perhaps theere's a small piece missing... not sure where. I was making some progress here, but still no cigar, it tries to display the block in a seperate page not in the Power BI:

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script: 

# dataset <- data.frame(ID)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(TileMaker)
library(tidyverse)

a <- div_maker(subtitle = "boom", textModifier = "h2",multi_box(
values = c(21, 45), title = "WO/MO Lead Time",
number_zoom = 300, icons = c("apple", "calendar"), type = "warning",
txt = c("% Target", "% Prev Yr"))
)

htmltools::renderTags(a) %>% htmltools::html_print()

Sorry, I probably won't work on this for the moment... but if you find a solution, please post it!