2007 55 1 27 45 c 2007 Java 1 2,3 3 2006 8 2 2007 3 6 Jasplot Java statistical plot Jasplot R Jasp Java linked views 1. 3 Microsoft Excel Gnuplot http://www.gnuplot.info/ 1 1 R Murrell, 2005 focusing brushing zooming linked views Symanzik, 2004 R 1 769 2193 1314 1 2 106 8569 4 6 7 3 106 8569 4 6 7
28 55 1 2007 R iplots http://rosuda.org/iplots/ iplots linked highlighting Urbanek and Theus, 2003 iplots Java Java R C++ Java JFreeChart http://www.jfree.org/jfreechart/ Java JFreeChart Web Web Java Jasplot Java statistical plot; http:// jasp.ism.ac.jp/jasplot/ Jasplot R Jasp http://jasp.ism.ac.jp/; Nakano et al., 2000, 2004 Gamma et al., 1995; Martin, 2003 Jasplot Jasplot 3 4 2. 2.1 brushing Symanzik, 2004
Java 29 2.2 2 2 2 2 1 1 2.3 2.4 Linked views 1 linked views 1 linked highlighting linked brushing 2.5 CSV Comma Separated Values Microsoft Excel Web
30 55 1 2007 3. Jasplot Jasplot Jasp Java statistical processor Jasplot Jasp Java Java Jasp Java rjava http://rosuda.org/rjava/ R Jasplot 1 2 1. 2.
Java 31 3. 4.
32 55 1 2007 Jasplot 3 4 focusing zooming linked brushing 3.1 Jasplot GoF MVC Model-View-Controller GoF Gang of Four GoF 4 Gamma et al., 1995 23 3 Jasplot 7 Adapter Decorator Factory method Mediator Mediator Observer 1 1 Subject Subject Observer State Strategy MVC Model-View-Controller GoF Samlltalk Krasner and Pope, 1988 GUI Graphical User Interface MVC Model View Controller 3 GUI 3.2 Jasplot 2 DataModel RealDataModel CSVDataModel ExcelDataModel DataTableDataModel RDataModel
Java 33 PlotModel BasicPlotModel ScatterPlotModel HistogramPlotModel BoxPlotModel MultiPlotModel MosaicPlotModel BarPlotModel Plotter BasicPlotter ScatterPlotter HistogramPlotter BoxPlotter MultiPlotter MosaicPlotter BarPlotter JasplotPanel JasplotPanelPaletteLayer JasplotPanelPaletteLayerUI JasplotPanelDragLayer JasplotPanelDragLayerUI JasplotPanelPopupLayer JasplotPanelPopupLayerUI DragLayerState BrushingState DragGestureState DraggingState ManipulatingState SelectingState ToolTipState ZoomingState Selector RectangleSelector PointSelector LineSelector linked views PlotModelEvent PlotModelHandler PlotModelListener DataModelEvent DataModelHandler DataModelListener TableModel TableDisplayer 5 UML Unified Modeling Language Hunt, 2003 Jasplot DataModel PlotModel Plotter JasplotPanel MVC DataModel Model View 2 PlotModel Plotter JasplotPanel Controller 3.3 Jasplot DataModel DataModel 2 DataModel
34 55 1 2007 5. Jasplot DataModel 2 Java RealDataModel CSVDataModel ExcelDataModel DataTableDataModel RDataModel RealDataModel CSVDataModel CSV ExcelDataModel Microsoft Excel Decorator CSVDataModel setreal() CSV 2 RealDataModel setreal() CSVDataModel RealDataModel
Java 35 DataTableDataModel Jasp DataModel Jasp DataTable RDataModel R Jasplot Adapter Jasplot DataModel Adapter DataModel DataTableDataModel Jasp DataTable Jasplot DataTableDataModel DataTable 3.4 PlotModel DataModel PlotModel 10 50 PlotModel PlotModel PlotModel PlotModel BasicPlotModel Plotter Selector Jasplot BasicPlotModel 2 BasicPlotModel ScatterPlotModel MultiPlotModel 1 BasicPlotModel MultiPlotModel MultiPlotModel 3 4 3.5 Plotter PlotModel Java java.awt.graphics Plotter PlotModel BasicPlotter BasicPlotter ScatterPlotter Factory method Plotter JasplotPanel PlotModel createplotter createplotter Plotter createplotter Factory method
36 55 1 2007 3.6 JasplotPanel PlotModel Plotter PlotModel JasplotPanel Plotter JasplotPanel Swing JLayeredPanel 3 JasplotPanelPaletteLayer 3.7 1 1 linked views 3.7.1 Jasplot JasplotPanelDragLayer JasplotPanelDragLayerUI Swing MouseInputListener DragGesture- Listener mousepressed mousemoved mousedragged mouse- Released draggesturerecognized JasplotPanelPopupLayer JasplotPanelPopupLayerUI mousepressed 3.7.2 State Jasplot DragLayerState 4 mousepressed, mousemoved, mousedragged, mousereleased
Java 37 BrushingState DragGestureState DragLayerState DraggingState ManipulatingState SelectingState ZoomingState 1 JasplotPanelDragLayer addmousemotionlistener addmouselistener Jasplot 2 1 BrushingState 1 SelectingState DraggingState Reset ManipulatingState x y MultiPlotModel 1 ZoomingState mousereleased Reset Jasplot Plotter DragGestureState & 3.7.3 RectangleSelector 1 1 PointSelector LineSelector Strategy Jasplot getregion mousereleased Selector
38 55 1 2007 RectangleSelector PointSelector LineSelector Selector HistogramPlotModel PointSelector RectangleSelector Strategy 3.7.4 linked views 1 linked views Jasplot PlotModel PlotModelListener JasplotPanelPaletteLayer Observer Mediator PlotModel Observer Observer JasplotPanelPaletteLayer Subject JasplotPanelPaletteLayer PlotModel JasplotPanelPaletteLayer PlotModel Mediator Mediator JasplotPanelPaletteLayer Jasplot PlotModelHandler DataModel PlotModelListener JasplotPanelPaletteLayer PlotModelHandler addplotmodellistener SelectorState PlotModelEvent PlotModelHandler setselectedobservation JasplotPanelPalletLayer PlotModelEvent JasplotPanelPalletLayer observation- Select ed PlotModelEvent e repaint JasplotPanelPalletLayer 4. Jasplot Jasplot Jasplot http://jasp.ism.ac.jp/jasplot/ Apache Ant http://ant.apache. org/ Jasplot jasplot-demos.jar 4.1 Jasplot iris 2 Java import javax.swing.jframe; import jp.jasp.jasplot.csvdatamodel; import jp.jasp.jasplot.datamodel; import jp.jasp.jasplot.jasplotpanel; import jp.jasp.jasplot.scatterplotmodel;
Java 39 public class Sample { public Sample() { DataModel datamodel = new CSVDataModel("data/iris.csv"); ScatterPlotModel model = new ScatterPlotModel(dataModel, 1, 2); JasplotPanel jasplot = new JasplotPanel(model); } JFrame jframe = new JFrame("Jasplot Scatter Plot Sample"); jframe.getcontentpane().add(jasplot); jframe.setdefaultcloseoperation(jframe.exit_on_close); jframe.setsize(500, 500); jframe.setvisible(true); } public static void main(string[] args) { Sample sample = new Sample(); } Jasplot 1 DataModel DataModel CSVDataModel CSVDataModel data/iris.csv 2 PlotModel ScatterPlotModel 3 JasplotPanel PlotModel JasplotPanel ScatterPlotModel 4 JasplotPanel java.awt.container Container JFrame add JasplotPanel Jasplot demo/scatterplot/sample.java UNIX demo javac -classpath../dist/jasplot.jar:. ScatterPlot/Sample.java java -classpath../dist/jasplot.jar:. ScatterPlot.Sample 1 4.2 Jasplot MultiPlotModel ScatterPlotModel Jasplot demo/parallelcoordinateplot/sample.java
40 55 1 2007 MultiPlotModel multiplotmodel = new MultiPlotModel(dataModel); multiplotmodel.setrowcolumn(1, datamodel.getvariablenumber()); multiplotmodel.setconnect(true); multiplotmodel.setselector(new LineSelector()); for (int i = 0; i < datamodel.getvariablenumber(); i++) { ScatterPlotModel plotmodel = new ScatterPlotModel(dataModel, PlotModel.NULL, i); plotmodel.setdrawytick(false); plotmodel.setdrawxtick(false); Limits ylimits = plotmodel.getylimits(); ylimits.setmin(datamodel.getmin(i)); ylimits.setmax(datamodel.getmax(i)); plotmodel.setylimits(ylimits); plotmodel.drawstring(string.valueof(datamodel.getmin(i)), 0.5, 0.1, DrawString.CENTER, null); plotmodel.drawstring(string.valueof(datamodel.getmax(i)), 0.5, 0.9, DrawString.CENTER, null); } plotmodel.setxaxislabel(plotmodel.getyaxislabel()); plotmodel.setdrawyaxislabel(false); plotmodel.setdrawframe(false); plotmodel.setdrawxzeroline(true); multiplotmodel.setplotmodel(plotmodel); setrowcolumn setconnect(true) setselector(new LineSelector()) for new ScatterPlotModel(dataModel, PlotModel.NULL, i) x y datamodel i setdrawytick(false) y setdrawxtick(false) x setxaxislabel(plotmodel.getyaxislabel()) x y setdrawyaxislabel(false) y setdrawframe(false) setdrawxzeroline(true) x 0 setplotmodel(plotmodel) JasplotPanel Swing JScrollPanel MultiPlotModel
Java 41 MultiPlotModel 3 MultiPlotModel MultiPlotModel 1 4.3 Jasp 6 Jasp Jasplot 1 Jasp Jasp examples/jasplot.jasp iris = read("iris.jdt") data = DataTableDataModel(iris) mpm = MultiPlotModel() mpm.setrowcolumn(3, 1) model = ScatterPlotMatrixModel(data) mpm.setplotmodel(model) model = ParallelCoordinatePlotModel(data) mpm.setplotmodel(model); model = BoxPlotModel() model.setchangeaxis(true) model.setdatamodel(data) mpm.setplotmodel(model) jasplot = JasplotPanel(mpm) jasplot 6. Jasp
42 55 1 2007 iris = read("iris.jdt") iris.jdt DataTable- DataModel data data 3 MultiPlotModel 1 MultiPlotModel setrowcolumn(3, 1) 3 1 setplotmodel ScatterPlotMatrixModel ParallelCoordinatePlotModel BoxPlotModel Jasp Java Jasplot Jasp Java 4.4 R 7 R Jasplot R library(rjava) source("jasplot.r") datamodel <- jasplotdatamodel(iris) jasplotscatterplotmatrix(datamodel) jasplotparallelcoordinateplot(datamodel) Jasplot R rjava library(rjava) rjava jasplot.r R jasplot.r Jasplot demo/r jasplot.r Jasplot rjava Jasplot R rjava Jasplot rjava.jinit Jasplot.jar Jasplot.jar Jasplot dist Jasplot jasplotdatamodel jasplot- ScatterPlotMatrix jasplotparallelcoordinateplot jasplotdatamodel Jasplot RDataModel jasplotdatamodel jasplotscatterplotmatrixmodel jasplotparallel- CoordinatePlot Jasplot R Jasplot R getselectedobservation true false 5. Java Jasplot Jasplot Jasp R Java Jasplot
Java 43 7. R Jasplot 3 Gamma, E., Helm, R., Johonson, R. and Vlissides, J. 1995. Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, Reading 1999 Hunt, J. 2003. Guide to the Unified Process Featuring UML, Java and Design PatternsR Graphics,
44 55 1 2007 Springer, London, Berlin, Heidelberg. Krasner, G. and Pope, S. 1988. A description of the Model-View-Controller user interface paradigm in the Smalltalk-80 system, Journal of Object Oriented Programming, 1, 26 49. Martin, R. 2003. Agile Software Development: Principles, Patterns, and Practices, PrenticeHall PTR, Upper Saddle River, New Jersey 2004 Murrell, P. 2005. R Graphics, Chapman & Hall/CRC, Boca Raton. Nakano, J., Fujiwara, T., Yamamoto, Y. and Kobayashi, I. 2000. A statistical package based on Pnuts, COMPSTAT2000 Proceedings in Computational Statistics eds. J. G. Bethlehem and P. G. M. van der Heijden, 361 366, Physica, Heidelberg. Nakano, J., Huh, M. Y., Yamamoto, Y., Fujiwara, T. and Kobayashi, I. 2004. Adding visualization functions of DAVIS to Jasp: Mixing two Java-based statistical systems, Computational Statistics, 19, 137 146. Symanzik, J. 2004. Interactive and dynamic graphics, Handbook of Computational Statistics eds. J. E. Genyle, W. Härdle and Y. Mori, 293 336, Springer, Berlin, Heidelberg. Urbanek, S. and Theus, M. 2003. iplots high interaction graphics for R, International Workshop on Distributed Statistical Computing DSC 2003 eds. K. Hornik, F. Leisch and A. Zeileis http://www.ci.tuwien.ac.at/conferences/dsc-2003.
Proceedings of the Institute of Statistical Mathematics Vol. 55, No. 1, 27 45 (2007) 45 A Java Library for Statistical Graphs Using Design Patterns Yoshikazu Yamamoto 1, Junji Nakano 2,3 and Keisuke Honda 3 1 Faculty of Engineering, Tokushima Bunri University 2 The Institute of Statistical Mathematics 3 School of Multidisciplinary Sciences, The Graduate University for Advanced Studies This paper describes the design and the implementation of a Java library for statistical graphs. First, we consider the required functions for a modern interactive statistical graph library. Then we explain our statistical graph library, called Jasplot (Java statistical plot), as an example. Jasplot has functions for interactive operations on graphs, such as brushing and linked views. We can build new statistical graphs by combining several basic graphs and/or components such as an axis and data input functions. We can easily use Jasplot from other statistical analysis software products such as Jasp and R. We adopt design pattern software technology to realize such functions effectively. Key words: Java, linked views, interactive operation, statistical graph library.