Boost logo

Boost-Commit :

From: JakeVoytko_at_[hidden]
Date: 2007-08-19 17:06:28


Author: jakevoytko
Date: 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
New Revision: 38770
URL: http://svn.boost.org/trac/boost/changeset/38770

Log:
Added documentation dealing with stylesheets
Added:
   sandbox/SOC/2007/visualization/libs/svg_plot/doc/.svg_plot.qbk.swp (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/behavior/behavior_stylesheets.html (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/svg_boxplot_tutorial/tutorial_stylesheet.html (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/tutorial_stylesheet.html (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_simple_style.cpp (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/example/a.out (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/example/boxplot_full.cpp (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/example/boxplot_simple.cpp (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/example/style.css (contents, props changed)
   sandbox/SOC/2007/visualization/libs/svg_plot/example/svg_plot.xml (contents, props changed)
Text files modified:
   sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk | 95 +++++++++++++++++++++++++++++++++++----
   1 files changed, 84 insertions(+), 11 deletions(-)

Added: sandbox/SOC/2007/visualization/libs/svg_plot/doc/.svg_plot.qbk.swp
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/behavior/behavior_stylesheets.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/behavior/behavior_stylesheets.html 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -0,0 +1,139 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Stylesheets</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../../index.html" title="SVG_Plot">
+<link rel="up" href="../behavior.html" title=" Behavior">
+<link rel="prev" href="behavior_limits.html" title=" Numerical Limits">
+<link rel="next" href="../plot_defaults.html" title=" Defaults">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%">
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="behavior_limits.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../behavior.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../plot_defaults.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="svg_plot.behavior.behavior_stylesheets"></a> Stylesheets
+</h3></div></div></div>
+<p>
+ Stylesheets currently have only a single way of being used with the program:
+ they are parsed by the <code class="computeroutput"><span class="identifier">svg</span></code>
+ class, and if the stylesheet parses correctly, they are loaded directly into
+ the SVG file. I recognize that it may also be desired to link to an external
+ stylesheet, but this presents a few problems.
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Both of the files now need to be transported with the produced document
+ </li>
+<li>
+ Any user-provided function object that is used to convert between image
+ formats now suddenly needs to be able to load the image format from an
+ external source.
+ </li>
+</ul></div>
+<p>
+ When the image converter portion of the project is completed, the image format
+ function object will not be forced to deal with CSS. This is primarily a
+ practical matter, and keeps simple an already difficult task. This will not
+ preclude a method that extracts appropriate data from the CSS file and calls
+ the appropriate functions. For example, if the user provides the following:
+ </p>
+<pre class="programlisting">
+<span class="preprocessor">#Background</span>
+<span class="special">{</span>
+ <span class="identifier">fill</span> <span class="special">:</span> <span class="preprocessor">#FFF</span><span class="special">;</span>
+ <span class="identifier">stroke</span> <span class="special">:</span> #<span class="number">041010</span> <span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ why shouldn't
+ </p>
+<pre class="programlisting">
+<span class="identifier">my_plot</span><span class="special">.</span><span class="identifier">background_color</span><span class="special">(</span><span class="identifier">black</span><span class="special">);</span>
+<span class="identifier">my_plot</span><span class="special">.</span><span class="identifier">background_border_color</span><span class="special">(</span><span class="identifier">svg_color</span><span class="special">(</span><span class="number">4</span><span class="special">,</span> <span class="number">16</span><span class="special">,</span> <span class="number">16</span><span class="special">));</span>
+</pre>
+<p>
+ be called?
+ </p>
+<div class="caution"><table border="0" summary="Caution">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../images/caution.png"></td>
+<th align="left">Caution</th>
+</tr>
+<tr><td colspan="2" align="left" valign="top">
+<p>
+ </p>
+<p>
+ Please note that the language that is accepted by the parser is actually
+ stricter than the real CSS standard allows for. Following GSoC, the parser
+ will be reimplemented to reflect the parser suggested by the CSS standard.
+ All identifiers (class, ID, or otherwise), must be the only identifier
+ on the line. The following is not accepted:
+</p>
+<pre class="programlisting">
+<span class="identifier">rect</span><span class="special">,</span> <span class="identifier">circle</span>
+<span class="special">{</span>
+ <span class="identifier">fill</span> <span class="special">:</span> #<span class="number">00FF</span><span class="number">00</span><span class="special">;</span>
+ <span class="identifier">stroke</span> <span class="special">:</span> #<span class="number">000000</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ But the following is:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting">
+<span class="identifier">rect</span>
+<span class="special">{</span>
+ <span class="identifier">fill</span> <span class="special">:</span> #<span class="number">00FF</span><span class="number">00</span><span class="special">;</span>
+ <span class="identifier">stroke</span> <span class="special">:</span> #<span class="number">00FF</span><span class="number">00</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="identifier">circle</span>
+<span class="special">{</span>
+ <span class="identifier">fill</span> <span class="special">:</span> #<span class="number">00FF</span><span class="number">00</span><span class="special">;</span>
+ <span class="identifier">stroke</span> <span class="special">:</span> #<span class="number">00FF</span><span class="number">00</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ None of the power of CSS is compromised (or at least, I hope not), but
+ it becomes more verbose.
+ </p>
+<p>
+ </p>
+</td></tr>
+</table></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><small>Copyright © 2007 Jake Voytko</small></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="behavior_limits.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../behavior.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../plot_defaults.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/svg_boxplot_tutorial/tutorial_stylesheet.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/svg_boxplot_tutorial/tutorial_stylesheet.html 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -0,0 +1,79 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Stylesheet
+ Tutorial</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../../index.html" title="SVG_Plot">
+<link rel="up" href="../svg_boxplot_tutorial.html" title=" Tutorial: Boxplot">
+<link rel="prev" href="svg_boxplot_tutorial_full_layout.html" title="
+ Full Layout">
+<link rel="next" href="../behavior.html" title=" Behavior">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%">
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="svg_boxplot_tutorial_full_layout.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../svg_boxplot_tutorial.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../behavior.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="svg_plot.svg_boxplot_tutorial.tutorial_stylesheet"></a><a href="tutorial_stylesheet.html" title=" Stylesheet
+ Tutorial"> Stylesheet
+ Tutorial</a>
+</h3></div></div></div>
+<p>
+ To include a stylesheet into a program with any plot, simply use the <code class="computeroutput"><span class="identifier">load_stylesheet</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">filename</span><span class="special">)</span></code> method to load an external stylesheet. To
+ load the file ./style.css, for instance, we would call:
+ </p>
+<pre class="programlisting">
+<span class="identifier">my_plot</span><span class="special">.</span><span class="identifier">load_stylesheet</span><span class="special">(</span><span class="string">"./style.css"</span><span class="special">);</span>
+</pre>
+<p>
+ There are a few instances when a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code>
+ exception may be thrown.
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ If the filename is incorrect
+ </li>
+<li>
+ If the file does not pass the parsing phase
+ </li>
+</ul></div>
+<a name="svg_plot.svg_boxplot_tutorial.tutorial_stylesheet.using_the_stylesheet"></a><h4>
+<a name="id339172"></a>
+ <a href="tutorial_stylesheet.html#svg_plot.svg_boxplot_tutorial.tutorial_stylesheet.using_the_stylesheet">Using
+ the stylesheet</a>
+ </h4>
+<p>
+ Here is the output file for the simple 1D example, used before:
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../../images/1d_simple.png" alt="1d_simple"></span>
+ </p>
+<p>
+ Here it is with a simple stylesheet applied (from $PROJECT_ROOT/libs/svg_plot/example/style.css):
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../../images/1d_simple_stylesheet.png" alt="1d_simple_stylesheet"></span>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><small>Copyright © 2007 Jake Voytko</small></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="svg_boxplot_tutorial_full_layout.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../svg_boxplot_tutorial.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../behavior.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/tutorial_stylesheet.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/svg_plot/tutorial_stylesheet.html 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -0,0 +1,95 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Stylesheet Tutorial</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../index.html" title="SVG_Plot">
+<link rel="up" href="../index.html" title="SVG_Plot">
+<link rel="prev" href="svg_boxplot_tutorial/svg_boxplot_tutorial_full_layout.html" title="
+ Full Layout">
+<link rel="next" href="behavior.html" title=" Behavior">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%">
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="svg_boxplot_tutorial/svg_boxplot_tutorial_full_layout.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="behavior.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="svg_plot.tutorial_stylesheet"></a> Stylesheet Tutorial
+</h2></div></div></div>
+<p>
+ To include a stylesheet into a program with any plot, simply use the <code class="computeroutput"><span class="identifier">load_stylesheet</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">filename</span><span class="special">)</span></code> method to load an external stylesheet. To
+ load the file ./style.css, for instance, we would call:
+ </p>
+<pre class="programlisting">
+<span class="identifier">my_plot</span><span class="special">.</span><span class="identifier">load_stylesheet</span><span class="special">(</span><span class="string">"./style.css"</span><span class="special">);</span>
+</pre>
+<p>
+ There are a few instances when a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code>
+ exception may be thrown.
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ If the filename is incorrect
+ </li>
+<li>
+ If the file does not pass the parsing phase
+ </li>
+</ul></div>
+<a name="svg_plot.tutorial_stylesheet.using_the_stylesheet"></a><h3>
+<a name="id339172"></a>
+ <a href="tutorial_stylesheet.html#svg_plot.tutorial_stylesheet.using_the_stylesheet">Using the
+ stylesheet</a>
+ </h3>
+<p>
+ Here is the output file for the simple 1D example, used before:
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../images/1d_simple.png" alt="1d_simple"></span>
+ </p>
+<p>
+ Here it is with a simple stylesheet applied (from $PROJECT_ROOT/libs/svg_plot/example/style.css):
+ </p>
+<div class="caution"><table border="0" summary="Caution">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../images/caution.png"></td>
+<th align="left">Caution</th>
+</tr>
+<tr><td colspan="2" align="left" valign="top">
+<p>
+ </p>
+<p>
+ When the user will have the option to convert the graph to another image
+ format, the stylesheets will be ignored. These would provide the user with
+ an even more complex function object that they would need to implement.
+ If you provide a stylesheet, make sure you know what will not be converted.
+ (Currently, that is everything in the stylesheets)
+ </p>
+<p>
+ </p>
+</td></tr>
+</table></div>
+<p>
+ <span class="inlinemediaobject"><img src="../images/1d_simple_style.png" alt="1d_simple_style"></span>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><small>Copyright © 2007 Jake Voytko</small></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="svg_boxplot_tutorial/svg_boxplot_tutorial_full_layout.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="behavior.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -571,7 +571,7 @@
 
 [section:2d_special Tutorial: 2D Special Features]
 
-[header Y Axis Grid Lines]
+[heading Y Axis Grid Lines]
 
 If you would like grid lines that go across the graph, you can make the
 following call to `svg_1d_plot`:
@@ -588,7 +588,7 @@
 
 [$images/2d_y_grid.png]
 
-[header External Y Axis Style]
+[heading External Y Axis Style]
 
 For an alternate way to display a regular axis, you can use an external style:
 
@@ -598,7 +598,7 @@
 turn the axis back on. To do that, you must call `axis_on(true)`]
 
 
-[header Fill the area between the plot and the axis]
+[heading Fill the area between the plot and the axis]
 
 When there is a call to the plot() method, define `_area_fill_color`
 
@@ -611,7 +611,7 @@
 
 [$images/2d_area_fill.png]
 
-[header Curve Interpolation]
+[heading Curve Interpolation]
 
 If you would like an interpolated curve shown over your data, simply use the following command:
 
@@ -625,7 +625,7 @@
 
 [endsect] [/2d_special Tutorial: 2D Special Features]
 [endsect] [/2d_tutorial]
-[section:svg_boxplot_tutorial Boxplot]
+[section:svg_boxplot_tutorial Tutorial: Boxplot]
 [section:svg_boxplot_tutorial_simple Simple Example]
 
         // Functions we are using to simulate distributions.
@@ -725,8 +725,31 @@
 [endsect][/section:svg_boxplot_tutorial_simple]
 [section:svg_boxplot_tutorial_full_layout Full Layout]
 
-[endsect]
-[endsect] [/svg_boxplot_tutorial Boxplot]
+[endsect][/svg_boxplot_tutorial Boxplot]
+
+[endsect][/section:tutorial]
+[section:tutorial_stylesheet Stylesheet Tutorial]
+
+To include a stylesheet into a program with any plot, simply use the `load_stylesheet(const std::string& filename)` method to load an external stylesheet. To load the file ./style.css, for instance, we would call:
+
+ my_plot.load_stylesheet("./style.css");
+
+There are a few instances when a `std::runtime_error` exception may be thrown.
+
+* If the filename is incorrect
+* If the file does not pass the parsing phase
+
+[heading Using the stylesheet]
+Here is the output file for the simple 1D example, used before:
+
+[$images/1d_simple.png]
+
+Here it is with a simple stylesheet applied (from $PROJECT_ROOT/libs/svg_plot/example/style.css):
+
+[caution When the user will have the option to convert the graph to another image format, the stylesheets will be ignored. These would provide the user with an even more complex function object that they would need to implement. If you provide a stylesheet, make sure you know what will not be converted. (Currently, that is everything in the stylesheets)]
+[$images/1d_simple_style.png]
+
+[endsect][/stylesheet tutorial]
 [section:behavior Behavior]
 [section:behavior_limits Numerical Limits]
 All limits that are dealt with are double precision floating point limits.
@@ -736,12 +759,12 @@
 `_stroke_color = lightgray` and `_fill_color = whitesmoke`.
 This will become customizable.
 
-[header NaN]
+[heading NaN]
 Any double precision floating point numbers that return a nonzero value for the
 function `_isnan(double)` is considered to be a NaN value. When plotted, the
 number will appear in the user-defined coordinates as 0.
 
-[header Infinity]
+[heading Infinity]
 
 Any double precision floating point number that is equal to either of the
 following is considered to be Infinity:
@@ -753,7 +776,7 @@
 the plot window is not turned on, these points will appear at the top of
 the graph.
 
-[header Negative Infinity]
+[heading Negative Infinity]
 
 Any double precision floating point number that is equal to either of the
 following is considered to be Negative Infinity:
@@ -770,6 +793,56 @@
 
 [$images/2d_limit.png]
 [endsect][/section:numerical_limits]
+[section:behavior_stylesheets Stylesheets]
+Stylesheets currently have only a single way of being used with the program: they are parsed by the `svg` class, and if the stylesheet parses correctly, they are loaded directly into the SVG file. I recognize that it may also be desired to link to an external stylesheet, but this presents a few problems.
+
+* Both of the files now need to be transported with the produced document
+* Any user-provided function object that is used to convert between image formats now suddenly needs to be able to load the image format from an external source.
+
+When the image converter portion of the project is completed, the image format function object will not be forced to deal with CSS. This is primarily a practical matter, and keeps simple an already difficult task. This will not preclude a method that extracts appropriate data from the CSS file and calls the appropriate functions. For example, if the user provides the following:
+
+ #Background
+ {
+ fill : #FFF;
+ stroke : #041010 ;
+ }
+
+why shouldn't
+
+ my_plot.background_color(black);
+ my_plot.background_border_color(svg_color(4, 16, 16));
+
+be called?
+
+[caution Please note that the language that is accepted by the parser is actually stricter than the real CSS standard allows for. Following GSoC, the parser will be reimplemented to reflect the parser suggested by the CSS standard. All identifiers (class, ID, or otherwise), must be the only identifier on the line. The following is not accepted:
+``
+rect, circle
+{
+ fill : #00FF00;
+ stroke : #000000;
+}
+``
+
+But the following is:
+
+``
+rect
+{
+ fill : #00FF00;
+ stroke : #00FF00;
+}
+
+circle
+{
+ fill : #00FF00;
+ stroke : #00FF00;
+}
+``
+
+None of the power of CSS is compromised (or at least, I hope not), but it becomes more verbose.
+][/caution]
+
+[endsect][/section:behavior_stylesheets]
 [endsect][/section:behavior Behavior]
 
 [section:plot_defaults Defaults]
@@ -1059,7 +1132,7 @@
 
 (Note: Getters omitted for now)
 
-[header The `plot()` Method]
+[heading The `plot()` Method]
 The `plot()` method is defined using Boost.Parameter. As such, it supports a
 few extra named parameters, as well as a deduced parameter.
 

Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_simple_style.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_simple_style.cpp 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -0,0 +1,37 @@
+// 1d_simple_example.cpp
+// Copyright (C) Jacob Voytko 2007
+// Distributed under the Boost Software License, Version 1.0.
+// For more information, see http://www.boost.org
+// -----------------------------------------------------------------
+
+#include <boost/svg_plot/svg_1d_plot.hpp>
+#include <vector>
+
+using std::vector;
+using namespace boost::svg;
+
+int main()
+{
+ vector<double> dan_times;
+ vector<double> elaine_times;
+
+ dan_times.push_back(3.1);
+ dan_times.push_back(4.2);
+ elaine_times.push_back(2.1);
+ elaine_times.push_back(7.8);
+
+ svg_1d_plot my_plot;
+
+ my_plot.background_border_color(black)
+ .legend_on(true)
+ .title("Race Times")
+ .x_range(-1, 11);
+
+ my_plot.plot(dan_times, "Dan", blue);
+ my_plot.plot(elaine_times, "Elaine", orange);
+
+ my_plot.load_stylesheet("./style.css");
+
+ my_plot.write("./1d_simple_style.svg");
+ return 0;
+}

Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/a.out
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/boxplot_full.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/boxplot_full.cpp 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -0,0 +1,64 @@
+// boxplot_full.cpp
+// Copyright (C) Jacob Voytko 2007
+// Distributed under the Boost Software License, Version 1.0.
+// For more information, see http://www.boost.org
+// -----------------------------------------------------------------
+
+#include <vector>
+#include <cmath>
+
+#include <boost/svg_plot/svg_boxplot.hpp>
+
+using std::vector;
+
+// Functions we are using to simulate distributions.
+double f(double x)
+{
+ return 50 / x;
+}
+
+double g(double x)
+{
+ return 40 + 25 * sin(x * 50);
+}
+
+int main()
+{
+ using namespace boost::svg;
+ std::vector<double> data1, data2;
+
+ // Fill our vectors;
+ for(double i = .1; i < 10; i+=.1)
+ {
+ data1.push_back(f(i));
+ data2.push_back(g(i));
+ }
+
+ // Initialize a new plot.
+ svg_boxplot my_plot;
+
+ // Color information.
+ my_plot.background_border_color(black)
+ .background_color(svg_color(67, 111, 69))
+ .plot_background_color(svg_color(136, 188, 126))
+ .title_color(white)
+ .x_label_color(white)
+ .y_label_color(white);
+
+ // String information.
+ my_plot.title("Boxplots of Common Functions")
+ .x_label("Functions")
+ .y_label("Population Size");
+
+ // Axis information.
+ my_plot.y_range(0, 100)
+ .y_minor_tick_length(20)
+ .y_major_interval(20);
+
+ // Write data.
+ my_plot.plot(data1, "[50 / x]");
+ my_plot.plot(data2, "[40 + 25 * sin(x * 50)]");
+
+ my_plot.write("boxplot_full.svg");
+ return 0;
+}

Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/boxplot_simple.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/boxplot_simple.cpp 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -0,0 +1,59 @@
+// boxplot_simple.cpp
+// Copyright (C) Jacob Voytko 2007
+// Distributed under the Boost Software License, Version 1.0.
+// For more information, see http://www.boost.org
+// -----------------------------------------------------------------
+
+#include <vector>
+#include <cmath>
+
+#include <boost/svg_plot/svg_boxplot.hpp>
+
+using std::vector;
+
+// Functions we are using to simulate distributions.
+double f(double x)
+{
+ return 50 / x;
+}
+
+double g(double x)
+{
+ return 40 + 25 * sin(x * 50);
+}
+
+int main()
+{
+ using namespace boost::svg;
+ std::vector<double> data1, data2;
+
+ // Fill our vectors;
+ for(double i = .1; i < 10; i+=.1)
+ {
+ data1.push_back(f(i));
+ data2.push_back(g(i));
+ }
+
+ // Initialize a new plot.
+ svg_boxplot my_plot;
+
+ // Color information.
+ my_plot.background_border_color(black);
+
+ // String information.
+ my_plot.title("Boxplots of Common Functions")
+ .x_label("Functions")
+ .y_label("Population Size");
+
+ // Axis information.
+ my_plot.y_range(0, 100)
+ .y_minor_tick_length(20)
+ .y_major_interval(20);
+
+ // Write data.
+ my_plot.plot(data1, "[50 / x]");
+ my_plot.plot(data2, "[40 + 25 * sin(x * 50)]");
+
+ my_plot.write("boxplot_simple.svg");
+ return 0;
+}

Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/style.css
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/style.css 2007-08-19 17:06:26 EDT (Sun, 19 Aug 2007)
@@ -0,0 +1,15 @@
+#background
+{
+ fill : #888;
+ stroke : #888;
+}
+
+#title
+{
+ fill : #FFF;
+}
+
+#legendBackground
+{
+ fill : #DDD;
+}

Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/svg_plot.xml
==============================================================================


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk