source: trunk/years_ploticus.xsl

Last change on this file was 325, checked in by pinsard, 11 years ago

improvments of doc + some doctest features

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet
3version="1.0"
4xmlns:d="http://docbook.org/ns/docbook"
5xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
7<!--rst
8
9.. _year_ploticus.xsl:
10
11=================
12year_ploticus.xsl
13=================
14
15DESCRIPTION
16===========
17
18production d'un fichier de commande ploticus avec données incorporées pour
19le graphe publications/année
20
21SEE ALSO
22========
23
24alternative :ref:`years_gnuplot.xsl`  (but no histogram, only linepoints)
25
26TODO
27====
28
29voir une solution svg http://www.chez.com/xml/exemples/xslt/barchart/
30
31alternative matplotlib
32
33EVOLUTIONS
34==========
35
36$Id$
37
38- fplod 20120228
39
40  * rewrite ReST header
41  * ploticus command is now (version 2.41) pl
42  * ploticus now accept 4 digits year
43
44- fplod 2008-05-05T09:48:05Z aedon.locean-ipsl.upmc.fr (Darwin)
45
46  * force 2 digits format for years
47
48- fplod 2008-04-29T15:28:53Z aedon.locean-ipsl.upmc.fr (Darwin)
49
50  * chgt for dbk5 in years_ploticus.xsl
51
52- fplod yyymmdd?
53
54  * inspired by /sw/share/ploticus2/pltestsuite/bars3.htm
55    creation
56-->
57
58<xsl:output method="text"/>
59
60<xsl:include href="biblioentry_xml.xsl"/>
61
62<xsl:key name="key_years" match="///d:pubdate" use="."/>
63
64<xsl:template match="d:bibliography">
65#
66# .. code-block:: sh
67#
68#    pl -o years.png png years.ploticus
69#
70# FILES
71# =====
72#
73# years.ploticus
74#
75# EVOLUTIONS
76# ==========
77#
78# <xsl:value-of select="$makedate"/>
79#
80#proc getdata
81data:
82<!-- loop on years -->
83<xsl:for-each select="///d:pubdate[generate-id(.) = generate-id(key('key_years', .)[1])]">
84 <xsl:sort order="ascending" data-type="number" select="."/>
85 <xsl:call-template name="one_year">
86  <xsl:with-param name="year" select="."/>
87 </xsl:call-template>
88</xsl:for-each>
89
90#proc areadef
91  title: Nb of publications by year date : <xsl:value-of select="$makedate"/>
92  titledetails: align=center
93  xaxis.label: Year
94  xscaletype: date yyyy
95  xaxis.stubs: inc 2 year
96  xaxis.stubformat: yyyy
97  xautorange: datafield=1
98  yaxis.label: Nb of publications
99  yautorange: datafield=2
100  yaxis.stubs: inc
101  yaxis.location: min-0.25
102
103#proc bars
104  lenfield: 2
105  locfield: 1
106  color: red
107  barwidth: 0.25
108  outline: no
109
110</xsl:template>
111
112<xsl:template name="one_year">
113 <xsl:param name="year"/>
114 <xsl:value-of select="format-number(($year),'0000')"/>
115
116 <xsl:text> </xsl:text>
117 <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]) "/>
118 <xsl:text>&#xA;</xsl:text>
119</xsl:template>
120
121</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.