Changeset 38770

Aug 19, 2007, 9:06:26 PM (11 years ago)

Added documentation dealing with stylesheets

10 added
1 edited


  • sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk

    r38640 r38770  
    572572[section:2d_special Tutorial: 2D Special Features]
    574 [header Y Axis Grid Lines]
     574[heading Y Axis Grid Lines]
    576576If you would like grid lines that go across the graph, you can make the
    591 [header External Y Axis Style]
     591[heading External Y Axis Style]
    593593For an alternate way to display a regular axis, you can use an external style:
    601 [header Fill the area between the plot and the axis]
     601[heading Fill the area between the plot and the axis]
    603603When there is a call to the plot() method, define `_area_fill_color`
    614 [header Curve Interpolation]
     614[heading Curve Interpolation]
    616616If you would like an interpolated curve shown over your data, simply use the following command:
    626626[endsect] [/2d_special Tutorial: 2D Special Features]
    627627[endsect] [/2d_tutorial]
    628 [section:svg_boxplot_tutorial Boxplot]
     628[section:svg_boxplot_tutorial Tutorial: Boxplot]
    629629[section:svg_boxplot_tutorial_simple Simple Example]
    726726[section:svg_boxplot_tutorial_full_layout Full Layout]
    728 [endsect]
    729 [endsect] [/svg_boxplot_tutorial Boxplot]
     728[endsect][/svg_boxplot_tutorial Boxplot]
     731[section:tutorial_stylesheet Stylesheet Tutorial]
     733To 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:
     735        my_plot.load_stylesheet("./style.css");
     737There are a few instances when a `std::runtime_error` exception may be thrown.
     739* If the filename is incorrect
     740* If the file does not pass the parsing phase
     742[heading Using the stylesheet]
     743Here is the output file for the simple 1D example, used before:
     747Here it is with a simple stylesheet applied (from $PROJECT_ROOT/libs/svg_plot/example/style.css):
     749[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)]
     752[endsect][/stylesheet tutorial]
    730753[section:behavior Behavior]
    731754[section:behavior_limits Numerical Limits]
    737760This will become customizable.
    739 [header NaN]
     762[heading NaN]
    740763Any double precision floating point numbers that return a nonzero value for the
    741764function `_isnan(double)` is considered to be a NaN value. When plotted, the
    742765number will appear in the user-defined coordinates as 0.
    744 [header Infinity]
     767[heading Infinity]
    746769Any double precision floating point number that is equal to either of the
    754777the graph.
    756 [header Negative Infinity]
     779[heading Negative Infinity]
    758781Any double precision floating point number that is equal to either of the
     796[section:behavior_stylesheets Stylesheets]
     797Stylesheets 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.
     799* Both of the files now need to be transported with the produced document
     800* 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.
     802When 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:
     804        #Background
     805        {
     806                fill : #FFF;
     807                stroke : #041010 ;
     808        }
     810why shouldn't
     812        my_plot.background_color(black);
     813        my_plot.background_border_color(svg_color(4, 16, 16));
     815be called?
     817[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:
     819rect, circle
     821        fill : #00FF00;
     822        stroke : #000000;
     826But the following is:
     831        fill : #00FF00;
     832        stroke : #00FF00;
     837        fill : #00FF00;
     838        stroke : #00FF00;
     842None of the power of CSS is compromised (or at least, I hope not), but it becomes more verbose.
    773846[endsect][/section:behavior Behavior]
    10601133(Note: Getters omitted for now)
    1062 [header The `plot()` Method]
     1135[heading The `plot()` Method]
    10631136The `plot()` method is defined using Boost.Parameter. As such, it supports a
    10641137few extra named parameters, as well as a deduced parameter.
Note: See TracChangeset for help on using the changeset viewer.