googlevis

Superscript labels in r googleVis

拟墨画扇 提交于 2019-12-13 06:41:05
问题 I coded simple sankey with r googleVis package: DF= data.frame(From=c('A', 'B', 'C'), To=c('D','D', 'F'), Weight=c(0.460, 5.100, 2.393), Weight.html.tooltip = paste(c(0.460, 5.100, 2.393), paste(expression(m^3)))) plot(gvisSankey(DF,from="From", to="To", weight="Weight", options=list(width = "1200", height = "600", sankey="{ link: {colorMode: 'gradient', color: { fill: '#green' } }, node: {nodePadding: 80, width:50, color: { fill: '#a61d4c'} }, tooltip: {isHtml:'true'} }" ))) I am trying to

Hover style of label in googleVis

不打扰是莪最后的温柔 提交于 2019-12-13 00:48:13
问题 I'm trying to change the style of hover-label in googleVis columnChart. I'd like to format large numbers as it is done on axis. Do you know how to manage it (I've read whole Internet and still don't know how to fix it :D)? The illustration of my problem (red is the format I have and green that I'd like to have): And shiny-app example: ui.R: library("shiny") library("googleVis") shinyUI(fluidPage( htmlOutput("wyk") )) and server.R: library("shiny") library("googleVis") library("dplyr")

Shiny - googlevis: Tooltips for gvisPieChart

血红的双手。 提交于 2019-12-12 14:16:32
问题 I am trying to create custom tooltips for a googlevis pie chart. I have found Using Roles via googleVis but I cannot replicate a similar concept to a pie chart. See below for one of my attempts to achive this: df <- data.frame(year=c("a","b","g"),pop=1:3, pop.html.tooltip=c("alpha","beta","gamma")) plot( gvisPieChart(df,options=list(tooltip="{isHtml:'true'}")) ) Moreover, I found out that the first column chart example in Using Roles via googleVis is not working properly. Although the

Using a ordered factor as timevar in Motion Chart

不羁的心 提交于 2019-12-12 00:32:36
问题 I have some data like this: time var1 var2 idvar 1 Q1 1 4 A 2 Q1 2 3 B 3 Q2 3 2 A 4 Q2 4 1 B I need to make a MotionChart using each quarter ( Q1 and Q2 ) as a time var. I have tried to make df$time an ordered factor, but it still gives me an error as the timevar needs to be in numeric or date format. Is there any workaround with this? My actual data spans several years and all 4 quarters of each year in the YYYYQn format, which I would not like to change. The code I'm using in this example:

googleVis does not work properly with two dependent widget shiny

二次信任 提交于 2019-12-11 12:51:47
问题 I try to implement a simple shiny app with two dependent widgets.At first everything works fine but a problem occurs when I change a continent value i.e. a map disappears. Do you know what I should add to avoid this obstacle? ui.R library(shiny) shinyUI(fluidPage( sidebarLayout( sidebarPanel( selectInput("continent", "Select the continent: ", c("Africa", "America", "Asia","Europe"), selected = "Africa"), uiOutput('server_country') ), mainPanel( htmlOutput("map")) ) )) server.R library(shiny)

Combine R shiny and googlevis motion chart

喜欢而已 提交于 2019-12-11 10:32:42
问题 I'd like to deploy a web site using R shiny with a googleVis motion chart, but when running the app, the motion chart showed up in another window in IE browser. I'm wondering how the motion chart can show up together along with the R shiny. Thanks in advance. server.R shinyServer(function(input, output) { project_sub<-subset(project_all, select=c("name", "generation", "man_cost", "quantity")) motionchart2<-gvisMotionChart(project_sub, "name", "year2") output$view_gviz <- renderGvis ({ plot

How to color two links coming out of the same node (or going to the same node) with different colors using gvisSankey?

∥☆過路亽.° 提交于 2019-12-10 17:29:54
问题 I am creating a Sankey diagram using googleVis in R. I want to to color links of nodes that "advance" in one color, links of nodes that "regress" in another, and links of nodes that "stay the same" in a third color. For example: A1 -> B3 means moving up, A1 -> B0 means moving down, and A1 -> B1 means staying the same I looked at this post How to change node and link colors in R googleVis sankey chart but my case is a bit different in that two links coming out of the same node (when using

How to make a googleVis multiple Sankey from a data.frame?

早过忘川 提交于 2019-12-09 06:28:18
问题 Aim I am aiming to make a multiple Sankey in R using the googleVis package. The output should look similar to this: Data I've created some dummy data in R: set.seed(1) source <- sample(c("North","South","East","West"),100,replace=T) mid <- sample(c("North ","South ","East ","West "),100,replace=T) destination <- sample(c("North","South","East","West"),100,replace=T) # N.B. It is important to have a space after the second set of destinations to avoid a cycle dummy <- rep(1,100) # For

gvisScatterChart define series dynamically

走远了吗. 提交于 2019-12-07 11:55:17
问题 I am dynamically creating a couple of gvisScatterChart s. I want to define the colors of each line, which I can do using series and the color attribute. There is nothing like an order or a fix number by which I can predefine the colors. So I want to create an array of attributes parallel to my colors and just place it at series=myColors . The problem is that gVis expects a string like: series="[{color: 'black', visibleInLegend: false}]", As soon as I create a string using the paste function

googleVis: multi-level sorting feature gvisTable sortColumn?

梦想的初衷 提交于 2019-12-07 07:46:16
问题 Is there a way to do multi-level sorting in a gvisTable in googleVis? I am using Shiny to display a gvisTable like this: x <- gvisTable(tabData,options=list(sortColumn=2,showRowNumber='TRUE',allowHtml='TRUE'),chartid=tabID) I am wondering if there is a way to sort the values, say, first by column 2 then by column 3. If gvisTable does not have this feature but there is another type of table from another package other than googleVis that can do it in Shiny, that would be fine as well. Any ideas