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