Here’s how you’d do it using setVisualPropertyDefault(). Obviously, I’d like to create a dedicated function to make this easier to use, but this should work to make a bar chart, for example, in the meantime:
barchart = list(cyrange = c(-2.426,3.126), cy_colors = c("#FF00FF","#8000FF","#00FF00"),cy_dataColumns = c("gal1RGexp","gal4RGexp","gal80Rexp"))
style.string = list(visualProperty = "NODE_CUSTOMGRAPHICS_1", value = paste("org.cytoscape.BarChart",toJSON(barchart),sep = ":"))
setVisualPropertyDefault(style.string,
style.name)
You need to specify the min and max values in ‘cyrange’ and then pair the colors and columns you want in “cy_colors” and “cy_dataColumns”. Keep everything else the same and it should set the "Image/Chart 1” in the default style. Ah, and you’ll need to install/library the RJSONIO package for toJSON().