Changes between Version 15 and Version 16 of soc/2007/VisualizationOfContainers


Ignore:
Timestamp:
Jun 18, 2007, 1:51:51 AM (15 years ago)
Author:
jakevoytko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • soc/2007/VisualizationOfContainers

    v15 v16  
    22This project is focused on using STL containers in order to graph data on a one-dimensional and two-dimensional (and if time allows, 3D!) plot. The plot would be written in an `svg` image, compliant with the W3C standard. The goals of the project are as follows:
    33
    4  * To provide an easy syntax for graphing data
    54 * To let users produce a simple plot with minimal intervention by using sane defaults
    65 * To demonstrate how to incorporate SVG images into Boost documentation
     
    1514
    1615== Example ==
     16
     17== Potential example ==
    1718{{{
    1819#!cpp
    19 vector<double> data1, data2;
     20vector<double> data1;
     21deque<double> data2;
    2022
    21 // fill vectors
    2223
    23 svg_plot my_plot("./image.svg");
     24svg_plot my_plot("D:\\1D_legend_demo.svg");
    2425
    25 my_plot << image_size(500, 200) << x_scale(-7, 9) << draw_axis()
    26         << plot_range(data1.begin(), data1.end(), blue)
    27         << plot_range(data2.begin(), data2.end(), green)
    28         << write();
    29 }}}
     26// size/scale settings
     27my_plot.image_size(500, 350);
     28my_plot.x_scale(-2, 10);
     29   
     30// command settings
     31my_plot.draw_axis()
     32       .show_legend();
    3033
    31 produces the following output:
     34// color settings
     35my_plot.set_background_color(lightgray)
     36       .set_legend_background_color(whitesmoke);
    3237
    33 [[Image(http://www.tcnj.edu/~voytko2/img/1Dtwo_plots_color_demo.svg)]]
     38// drawing
     39plot_range(my_plot, data2.begin(), data2.end(), "Lions",  blue);
     40plot_range(my_plot, data1.begin(), data1.end(), "Tigers", limegreen);
    3441
    35 == Using different STL containers ==
    36 {{{
    37 #!cpp
    38 deque<double> data1;
    39 vector<double> data2;
    40 
    41 //fill vectors
    42 
    43 svg_plot my_plot("./image.svg");
    44 
    45 my_plot << image_size(500, 200) << x_scale(-7, 9) << draw_axis()
    46         << plot_range(data1.begin(), data1.end(), orange)
    47         << plot_range(data2.begin(), data2.end(), blue)
    48         << write();
     42// write to file. NOTE: Will change to write(filename) soon
     43my_plot.write();
    4944
    5045}}}
     
    5247produces the following output:
    5348
    54 [[Image(http://www.tcnj.edu/~voytko2/img/1D_containers_demo.svg)]]
     49[http://www.tcnj.edu/~voytko2/svg.htm]
    5550
    5651== Using Boost.Array ==
    57 {{{
    58 #!cpp
    5952
    60 boost::array<double, 10> arr;
    61 
    62 // fill arr
    63 
    64 my_plot << image_size(500, 200) << x_scale(-7, 9) << draw_axis()
    65         << plot_range(arr.begin(), arr.end(), orange)
    66         << write();
    67 
    68 }}}
    69 
     53Because Boost.Array supports an iterator-like interface, (`my_arr.begin()`, `my_arr.end()`), Boost.Array can freely be used with the program
    7054produces the following output:
    7155
     
    10892   {{{
    10993   #!cpp
    110    svg << plot_range( hl.begin(), hl.end(), get_age_functor() ); // fun stuff :)
     94   plot_range(svg, hl.begin(), hl.end(), get_age_functor() ); // fun stuff :)
    11195   }}}
    11296
    11397''By Paul Bristow''
    114  * Customize background color of plot
     98 * Customize background color of plot '''''Completed'''''
    11599 * Customize the background border color
    116100 * Customize the "axis area" background color
     
    132116   * Allow different data representation points
    133117   * Allow appropriate customization of data points
    134    * Consider labels for data points (combined with exploration of hover-text features of SVG mentioned above)
     118   * Consider labels for data points (combined with exploration of hover-text features of SVG mentioned above) '''''Completed in legend'''''
    135119   * Consider how to concisely represent the scale of data points
    136    * Multiple data series
     120   * Multiple data series '''''Completed'''''
    137121 * Legend
    138122   * Border
    139    * color
     123   * color '''''Partially Completed'''''
    140124   * position
    141125   * border thickness
    142    * background colors
     126   * background colors '''''Completed'''''
    143127 * Unicode strings
    144128
    145129= 4. Bugs D: =
    146  * Changing or setting the x_scale after calling my_graph<<draw_axis() makes the axis not be drawn.
     130 * Changing or setting the x_scale after calling my_graph.draw_axis() makes the axis not be drawn.
    147131   * This is caused because I store points after setting the graph. I will fix this by storing infinity as +NaN in the point, and when outputting, writing it at a location far off the graph