PK
FJLk package.json{
"version": "1.0.3",
"author": {"name":"Microsoft","email":"pbicvsupport@microsoft.com"},
"resources": [
{
"resourceId": "rId0",
"sourceType": 5,
"file": "resources/PBI_CV_9D783E0D_2610_4C22_9576_88AD092AB59E.pbiviz.json"
}
],
"visual": {"name":"PowerBI-visuals-spline","displayName":"Spline","guid":"PBI_CV_9D783E0D_2610_4C22_9576_88AD092AB59E","visualClassName":"Visual","version":"1.0.3","description":"Smoothing spline helps you visualize and understand noisy data. Control the colors and the rest of attributes to meet your specific needs.
Service prerequisites: R-powered custom visual is used in service seamlessly
Desktop prerequisites: To run R scripts in Power BI Desktop, you must separately install R on your local computer.
You can download and install R for free from the Revolution Open download page or the CRAN Repository
R package dependencies(auto-installed): graphics, scales, reshape, ggplot2, mgcv, htmlWidgets, XML, plotly
Supports R versions: R 3.3.1, R 3.3.0, MRO 3.3.1, MRO 3.3.0, MRO 3.2.2
","supportUrl":"http://community.powerbi.com/","gitHubUrl":"https://github.com/microsoft/PowerBI-visuals-spline/tree/HTML-based"},
"metadata": {
"pbivizjson": {
"resourceId": "rId0"
}
}
}PK
FJ
resources/PK
FJ=g, A resources/PBI_CV_9D783E0D_2610_4C22_9576_88AD092AB59E.pbiviz.json{"visual":{"name":"PowerBI-visuals-spline","displayName":"Spline","guid":"PBI_CV_9D783E0D_2610_4C22_9576_88AD092AB59E","visualClassName":"Visual","version":"1.0.3","description":"Smoothing spline helps you visualize and understand noisy data. Control the colors and the rest of attributes to meet your specific needs.
Service prerequisites: R-powered custom visual is used in service seamlessly
Desktop prerequisites: To run R scripts in Power BI Desktop, you must separately install R on your local computer.
You can download and install R for free from the Revolution Open download page or the CRAN Repository
R package dependencies(auto-installed): graphics, scales, reshape, ggplot2, mgcv, htmlWidgets, XML, plotly
Supports R versions: R 3.3.1, R 3.3.0, MRO 3.3.1, MRO 3.3.0, MRO 3.2.2
","supportUrl":"http://community.powerbi.com/","gitHubUrl":"https://github.com/microsoft/PowerBI-visuals-spline/tree/HTML-based"},"apiVersion":"1.4.0","author":{"name":"Microsoft","email":"pbicvsupport@microsoft.com"},"assets":{"icon":"assets/icon.png"},"externalJS":[],"style":"style/visual.less","capabilities":{"dataRoles":[{"displayName":"X axis","description":"Numeric variable","kind":"Grouping","name":"x_var"},{"displayName":"Y axis","description":"Numeric variable","kind":"GroupingOrMeasure","name":"y_var"},{"displayName":"Point color","description":"Define colors per point (optional)","kind":"Grouping","name":"color"},{"displayName":"Tooltips","description":"Tooltips (optional)","kind":"Grouping","name":"tooltips"},{"displayName":"Unique ID","description":"Unique ID (optional). May be used to prevent two identical rows from being counted as one","kind":"Grouping","name":"unique_id"}],"dataViewMappings":[{"conditions":[{"x_var":{"max":1},"y_var":{"max":1},"color":{"max":1},"tooltips":{"max":1},"unique_id":{"max":1}}],"scriptResult":{"dataInput":{"table":{"rows":{"select":[{"for":{"in":"x_var"}},{"for":{"in":"y_var"}},{"for":{"in":"color"}},{"for":{"in":"tooltips"}},{"for":{"in":"unique_id"}}],"dataReductionAlgorithm":{"top":{}}}}},"script":{"scriptProviderDefault":"R","scriptOutputType":"html","source":{"objectName":"rcv_script","propertyName":"source"},"provider":{"objectName":"rcv_script","propertyName":"provider"},"scriptSourceDefault":"# Copyright (c) Microsoft Corporation. All rights reserved.\r\n\r\n# Third Party Programs. This software enables you to obtain software applications from other sources. \r\n# Those applications are offered and distributed by third parties under their own license terms.\r\n# Microsoft is not developing, distributing or licensing those applications to you, but instead, \r\n# as a convenience, enables you to use this software to obtain those applications directly from \r\n# the application providers.\r\n# By using the software, you acknowledge and agree that you are obtaining the applications directly\r\n# from the third party providers and under separate license terms, and that it is your responsibility to locate, \r\n# understand and comply with those license terms.\r\n# Microsoft grants you no license rights for third-party software or applications that is obtained using this software.\r\n\r\n\r\n##PBI_R_VISUAL: VIZGAL_SPLINE Visualization of spline interpolation\r\n# Computes and visualizes a spline interpolation of 2D scatter \r\n# Smoothness is controlled by the user \r\n# INPUT: \r\n# The input dataset should include exactly two numerical non-constant columns for X and Y \r\n#\r\n#\r\n# WARNINGS: \r\n#\r\n# CREATION DATE: 24/7/2016\r\n#\r\n# LAST UPDATE: 16/03/2017\r\n#\r\n# VERSION: 1.0.3\r\n#\r\n# R VERSION TESTED: 3.2.2\r\n# \r\n# AUTHOR: pbicvsupport@microsoft.com\r\n#\r\n# REFERENCES: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/loess.html\r\n\r\n#DEBUG in RStudio\r\n# fileRda = \"C:/Users/boefraty/projects/PBI/R/tempData.Rda\"\r\n# if(file.exists(dirname(fileRda)))\r\n# {\r\n# if(Sys.getenv(\"RSTUDIO\")!=\"\")\r\n# load(file= fileRda)\r\n# else\r\n# save(list = ls(all.names = TRUE), file=fileRda)\r\n# }\r\n\r\n\r\n############### Utility functions ###############\r\nlibraryRequireInstall = function(packageName, ...)\r\n{\r\n if(!require(packageName, character.only = TRUE)) \r\n warning(paste(\"*** The package: '\", packageName, \"' was not installed ***\", sep=\"\"))\r\n}\r\n\r\nlibraryRequireInstall(\"XML\")\r\nlibraryRequireInstall(\"htmlwidgets\")\r\n\r\ninternalSaveWidget <- function(widget, fname)\r\n{\r\n tempFname = paste(fname, \".tmp\", sep=\"\")\r\n htmlwidgets::saveWidget(widget, file = tempFname, selfcontained = FALSE)\r\n FlattenHTML(tempFname, fname)\r\n}\r\n\r\nFlattenHTML <- function(fnameIn, fnameOut)\r\n{\r\n # Read and parse HTML file\r\n # Embed all js and css files into one unified file\r\n \r\n if(!file.exists(fnameIn))\r\n return(FALSE)\r\n \r\n dir = dirname(fnameIn)\r\n html = htmlTreeParse(fnameIn, useInternal = TRUE)\r\n top = xmlRoot(html)\r\n \r\n # extract all