/*
* MyVisualisation.java
* */
import de.tum.binfo.proj.engine.EngineResults;
public class MyVisualisation extends Visualisation {
/**
* @param data the result created by an engine
*/
public MyVisualisation(EngineResults data) {
super(data);
}
public int hashCode() {
return 0;
}
public void run() throws Exception {
}
}
Every visualisation class has to extend Visualisation and implement the method run(). The run() method will be called, when you click on the menu entry to get a visualisation, so your code has to start here. It is important that the method Visualisation.performPlotting(String) is called within the run() method. performPlotting(String) needs a string as parameter. This string is the R command for a specific plot (e.g. if you want to have a boxplot, the string will be the R notation for a boxplot(boxplot(x, ...))). The run() method might look like this:
public void run() throws Exception {In the performPlotting(String) method the whole R command will be assembled and piped to R.
String rcmds = "plot(data[,2])\n";
performPlotting(rcmds);
}