Merge lp:~benm/gnuclad/yearinterval into lp:gnuclad

Proposed by Ben Moss
Status: Merged
Approved by: Donjan Rodic
Approved revision: 99
Merge reported by: Donjan Rodic
Merged at revision: not available
Proposed branch: lp:~benm/gnuclad/yearinterval
Merge into: lp:gnuclad
Diff against target: 675 lines (+235/-202)
7 files modified
doc/src/gnuclad-config.texi (+12/-6)
doc/src/gnuclad.html/Config-Options.html (+197/-190)
example/example.conf (+5/-2)
src/generator/conf.cpp (+6/-0)
src/generator/svg.cpp (+9/-4)
src/gnuclad-cladogram.cpp (+4/-0)
src/gnuclad.h (+2/-0)
To merge this branch: bzr merge lp:~benm/gnuclad/yearinterval
Reviewer Review Type Date Requested Status
Donjan Rodic Approve
Review via email: mp+86185@code.launchpad.net

Commit message

Merged year label interval branch from Ben Moss.
Merged conf file fixes from Ben Moss.

Description of the change

I am editing a book of memoirs and I used gnuclad to generate a family tree. The family tree spans over two centures, and having a label for every year was wasting too much space on the page.

I added a 'yearLabelInterval' parameter to the .conf file. Setting 'yearLabelInterval = 1' (the default) makes gnuclad behave as it did before, with a label for every year on the ruler. Setting 'yearLabelInterval = 10' makes a year label only once each decade. I also added a second parameter to the .conf file, 'rulerUnlabeledYearWidth'. This parameter sets the width of the line for years that are not labeled, i.e. a year in the middle of a decade.

To test, please run example.conf in the example/ directory (yearLabelInterval = 3):

> gnuclad example.csv example.svg example.conf

I tested this code on the GLDT diagram and the changes do not appear to affect that project.

To post a comment you must log in.
Revision history for this message
Donjan Rodic (bryonak) wrote :

On 19/12/11 02:08, Ben Moss wrote:
> Ben Moss has proposed merging lp:~benm/gnuclad/yearinterval into lp:gnuclad.
>
> Requested reviews:
> Donjan Rodic (bryonak)
>
> For more details, see:
> https://code.launchpad.net/~benm/gnuclad/yearinterval/+merge/86185
>
> I am editing a book of memoirs and I used gnuclad to generate a family tree. The family tree spans over two centures, and having a label for every year was wasting too much space on the page.
>
> I added a 'yearLabelInterval' parameter to the .conf file. Setting 'yearLabelInterval = 1' (the default) makes gnuclad behave as it did before, with a label for every year on the ruler. Setting 'yearLabelInterval = 10' makes a year label only once each decade. I also added a second parameter to the .conf file, 'rulerUnlabeledYearWidth'. This parameter sets the width of the line for years that are not labeled, i.e. a year in the middle of a decade.
>
> To test, please run example.conf in the example/ directory (yearLabelInterval = 3):
>
>> gnuclad example.csv example.svg example.conf
> I tested this code on the GLDT diagram and the changes do not appear to affect that project.

Hey Ben

Thanks for the pull request! I've been busy with lots of other stuff
lately, so gnuclad is not among the top priorities right now, but I'll
merge it within the next few days.

Wish you a happy new year

cheers
Donjan

Revision history for this message
Donjan Rodic (bryonak) :
review: Approve
Revision history for this message
Donjan Rodic (bryonak) wrote :

Merged with tiny change.
Thanks, also for the conf file fixes!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore' (properties changed: -x to +x)
2=== modified file 'AUTHORS' (properties changed: -x to +x)
3=== modified file 'COPYING' (properties changed: -x to +x)
4=== modified file 'ChangeLog' (properties changed: -x to +x)
5=== modified file 'INSTALL' (properties changed: -x to +x)
6=== modified file 'Makefile.am' (properties changed: -x to +x)
7=== modified file 'Makefile.in' (properties changed: -x to +x)
8=== modified file 'NEWS' (properties changed: -x to +x)
9=== modified file 'README' (properties changed: -x to +x)
10=== modified file 'ToDo' (properties changed: -x to +x)
11=== modified file 'aclocal.m4' (properties changed: -x to +x)
12=== modified file 'build-aux/texinfo.tex' (properties changed: -x to +x)
13=== modified file 'config.h.in' (properties changed: -x to +x)
14=== modified file 'configure.ac' (properties changed: -x to +x)
15=== modified file 'doc/index.html' (properties changed: -x to +x)
16=== modified file 'doc/man/gnuclad.1' (properties changed: -x to +x)
17=== modified file 'doc/src/Makefile' (properties changed: -x to +x)
18=== modified file 'doc/src/Makefile.am' (properties changed: -x to +x)
19=== modified file 'doc/src/Makefile.in' (properties changed: -x to +x)
20=== modified file 'doc/src/fdl.texi' (properties changed: -x to +x)
21=== modified file 'doc/src/gnuclad-about.texi' (properties changed: -x to +x)
22=== modified file 'doc/src/gnuclad-config.texi' (properties changed: -x to +x)
23--- doc/src/gnuclad-config.texi 2010-08-10 15:35:10 +0000
24+++ doc/src/gnuclad-config.texi 2011-12-19 01:07:36 +0000
25@@ -31,7 +31,7 @@
26 @example
27 # gnuclad config file
28
29-# This configuration file has been generated by gnuclad 0.2.2
30+# This configuration file has been generated by gnuclad 0.2.4
31
32 # If you comment or delete an option,
33 # gnuclad will use the built-in defaults.
34@@ -107,7 +107,10 @@
35 mainBackground = #fff
36
37 # Customise the background lines separating the years and months
38+# rulerWidth is the width of a year line when a year label is present (see yearLabelInterval below)
39+# rulerUnlabeledYearWidth is the width of a year line without a year label.
40 rulerWidth = 2
41+rulerUnlabeledYearWidth = 2
42 rulerColor = #ddd
43 rulerMonthWidth = 1
44 rulerMonthColor = #eee
45@@ -188,12 +191,15 @@
46 yearLineFontSize = 28
47 yearLineFontColor = #fff
48
49-How many (empty) years to append at the end
50+# How many (empty) years to append at the end
51 appendYears = 0
52
53-How many (empty) years to prepend at the beginning
54+# How many (empty) years to prepend at the beginning
55 prependYears = 0
56
57+# How many years between year labels
58+yearLabelInterval = 1
59+
60 # Remember to adjust your input data after changing these averages.
61 daysInMonth = 30
62 monthsInYear = 12
63@@ -210,9 +216,9 @@
64 dir_showDotFiles = 0
65
66 # Color of files, directories and links
67-dir_colorFile = 0ff
68-dir_colorDir = 00f
69-dir_colorLink = 0f0
70+dir_colorFile = #0ff
71+dir_colorDir = #00f
72+dir_colorLink = #0f0
73
74 # Directories with greater than specified size will get a domain of
75 # the given intensity (0-100). Set size = 0 to turn off.
76
77=== modified file 'doc/src/gnuclad-faq.texi' (properties changed: -x to +x)
78=== modified file 'doc/src/gnuclad-programming-classes.texi' (properties changed: -x to +x)
79=== modified file 'doc/src/gnuclad-programming-config.texi' (properties changed: -x to +x)
80=== modified file 'doc/src/gnuclad-programming-generator.texi' (properties changed: -x to +x)
81=== modified file 'doc/src/gnuclad-programming-helpers.texi' (properties changed: -x to +x)
82=== modified file 'doc/src/gnuclad-programming-parser.texi' (properties changed: -x to +x)
83=== modified file 'doc/src/gnuclad-programming.texi' (properties changed: -x to +x)
84=== modified file 'doc/src/gnuclad-tips.texi' (properties changed: -x to +x)
85=== modified file 'doc/src/gnuclad-usage.texi' (properties changed: -x to +x)
86=== modified file 'doc/src/gnuclad.html/About.html' (properties changed: -x to +x)
87=== modified file 'doc/src/gnuclad.html/Classes.html' (properties changed: -x to +x)
88=== modified file 'doc/src/gnuclad.html/Config-Options.html' (properties changed: -x to +x)
89--- doc/src/gnuclad.html/Config-Options.html 2011-04-01 17:59:24 +0000
90+++ doc/src/gnuclad.html/Config-Options.html 2011-12-19 01:07:36 +0000
91@@ -68,196 +68,203 @@
92
93 <h3 class="section">4.3 Detail</h3>
94
95-<pre class="example"> # gnuclad config file
96-
97- # This configuration file has been generated by gnuclad 0.2.2
98-
99- # If you comment or delete an option,
100- # gnuclad will use the built-in defaults.
101- # Allowed syntax is:
102- # option=value
103- # option = value
104- # option= 'value'
105- # option ="value"
106- # option = three word value
107- # option = "three word value"
108- # ...
109-
110-
111- # Show debug information when running gnuclad. (0 = off, 1 = on)
112- debug = 0
113-
114- # Modify the appearance of your info box
115- # To disable the box:
116- # Set both font size parameters to 0, set the width and height to 0
117- infoBoxTitle = Title
118- infoBoxTitleSize = 18
119- infoBoxText = Lorem ipsum dolor sit amet,
120- infoBoxText = consectetuer adipiscing elit
121- infoBoxTextSize = 12
122- infoBoxFont = Liberation Sans, Arial, Helvetica
123- infoBoxFontColor = #000
124- infoBoxColor1 = #51b1f1
125- infoBoxColor2 = #3181f1
126- infoBoxX = 10
127- infoBoxY = 45
128- infoBoxWidth = 166
129- infoBoxHeight = 60
130-
131- # Slice one node name with children, ignore the rest.
132- slice =
133-
134- # Correction factor for font pixel width/height.
135- # It is normalised for Liberation Sans (= Arial) and will
136- # affect the alignment of all text in your output. Since this
137- # one option affects all text instances, it's recommended
138- # to use 'similarly spaced' fonts throughout your settings.
139- fontCorrectionFactor = 1
140-
141- # Orientation of the timeline
142- # 0 = left to right, 1 = top to bottom
143- # 2 = right to left, 3 = bottom to top
144- orientation = 0
145-
146- # The layout of the tree
147- # 0 = branch to both sides
148- # 1 = branch only on lower side
149- # 2 = branch only on lower side, inverse (good for CSV output)
150- treeMode = 0
151-
152- # Chose: 0 = don't presort, 1 = by name, 2 = by date
153- sortKey = 0
154-
155- # Set optimisation between 0 and 99. See manual for details.
156- # First digit: isolated nodes. Second digit: trees.
157- optimise = 99
158-
159- # This guesses if optimisation should overlap in some rare cases
160- # 1 = forbid overlaps, 0 = allow overlaps (better optimisation)
161- strictOverlaps = 0
162-
163- # How much space (in offsets) to add before/after trees
164- treeSpacing = 1
165-
166- # How big (total children) a tree has to be before it gets spaced
167- treeSpacingBiggerThan = 5
168-
169- # Background color in hexadecimal RGB (#abc or #abcdef)
170- mainBackground = #fff
171-
172- # Customise the background lines separating the years and months
173- rulerWidth = 2
174- rulerColor = #ddd
175- rulerMonthWidth = 1
176- rulerMonthColor = #eee
177-
178- # Width of all node lines
179- lineWidth = 2
180-
181- # Number of pixels between node lines (== 1 offset)
182- offsetPX = 20
183-
184- # Set to 0 if you want 'dying' lines to stop abruptly
185- stopFadeOutPX = 30
186-
187- # When optimising, gnuclad will inline nodes if possible. This sets
188- # the minimum time distance between the stop of one node and the
189- # start of another which will allow the latter to get appended.
190- # Format: 'y.m.d' or 'y.m' or 'y' (year, month, day)
191- stopSpacing = 0.2
192-
193- # How many pixels one year should have
194- yearPX = 100
195-
196- # Customise the node labels
197- labelFont = Liberation Sans, Arial, Helvetica
198- labelFontSize = 16
199- labelFontColor = #000
200-
201- # An experimental feature you might want to use with derivType &gt; 1
202- # Opacity takes values between 0 (transparent) and 100 (opaque).
203- # It DOES NOT work flawlessly with SVG 1.1 output.
204- # (hoping for v1.2 or CSS3 ...)
205- labelBGOpacity = 0
206-
207- # This sets the heuristic used for determining label background width
208- # 0 = standard, will sometimes generate suboptimal width values
209- # 1 = improved, but only if the majority of your characters fall into
210- # the ASCII charset and you use a fairly standard font
211- # playing around with fontCorrectionFactor might help
212- asciiStrings = 0
213-
214- # Useful if you want to use the renames only as version bumps.
215- # 0 = rename above the dot to the right, like the first name
216- # 1 = rename centered within the dot
217- nameChangeType = 0
218-
219- # Set the way the lines should derive from the parent.
220- # 0 = orthogonal, 1 = from parent's starting point
221- # 2 = diagonal (45 degrees)
222- # 3 = curved (1 year wide curves), 4 = curved (quadratic scaling)
223- # 5 = curved (from parent's starting point)
224- derivType = 0
225-
226- # The size of the node dots
227- dotRadius = 10
228- smallDotRadius = 5
229-
230- # Determines how the dots look.
231- # 0 = full dots, 1 = circles
232- # Circles might be useful together with nameChangeType = 1
233- dotType = 0
234-
235- # Specifies the amount a node's line thickness should increase
236- # relative to the count of it's children. (recommended 0.0 - 1.0)
237- bigParent = 0
238-
239- # Adds small half-circles to connector starting points
240- connectorDots = 1
241-
242- # 1 = connectors have a dashed stroke
243- # 0 = connectors are full lines
244- connectorsDashed = 1
245-
246- # Customise the year line encompassing the cladogram.
247- yearLinePX = 40
248- yearLineColor1 = #037
249- yearLineColor2 = #37d
250- yearLineFont = Liberation Sans, Arial, Helvetica
251- yearLineFontSize = 28
252- yearLineFontColor = #fff
253-
254- How many (empty) years to append at the end
255- appendYears = 0
256-
257- How many (empty) years to prepend at the beginning
258- prependYears = 0
259-
260- # Remember to adjust your input data after changing these averages.
261- daysInMonth = 30
262- monthsInYear = 12
263-
264- # Not setting endOfTime will use the current date.
265- #endOfTime = 2012.12
266-
267- # How the description field should be used.
268- # 0 = ignore
269- # 1 = weblink URL
270- descriptionType = 0
271-
272- # When parsing direcories, show dot (hidden) files (0 = off, 1 = on)
273- dir_showDotFiles = 0
274-
275- # Color of files, directories and links
276- dir_colorFile = 0ff
277- dir_colorDir = 00f
278- dir_colorLink = 0f0
279-
280- # Directories with greater than specified size will get a domain of
281- # the given intensity (0-100). Set size = 0 to turn off.
282- dir_domainSize = 0
283- dir_domainIntensity = 3
284-
285+<pre class="example">
286+ # gnuclad config file
287+
288+ # This configuration file has been generated by gnuclad 0.2.4
289+
290+ # If you comment or delete an option,
291+ # gnuclad will use the built-in defaults.
292+ # Allowed syntax is:
293+ # option=value
294+ # option = value
295+ # option= 'value'
296+ # option ="value"
297+ # option = three word value
298+ # option = "three word value"
299+ # ...
300+
301+
302+ # Show debug information when running gnuclad. (0 = off, 1 = on)
303+ debug = 0
304+
305+ # Modify the appearance of your info box
306+ # To disable the box:
307+ # Set both font size parameters to 0, set the width and height to 0
308+ infoBoxTitle = Title
309+ infoBoxTitleSize = 18
310+ infoBoxText = Lorem ipsum dolor sit amet,
311+ infoBoxText = consectetuer adipiscing elit
312+ infoBoxTextSize = 12
313+ infoBoxFont = Liberation Sans, Arial, Helvetica
314+ infoBoxFontColor = #000
315+ infoBoxColor1 = #51b1f1
316+ infoBoxColor2 = #3181f1
317+ infoBoxX = 10
318+ infoBoxY = 45
319+ infoBoxWidth = 166
320+ infoBoxHeight = 60
321+
322+ # Slice one node name with children, ignore the rest.
323+ slice =
324+
325+ # Correction factor for font pixel width/height.
326+ # It is normalised for Liberation Sans (= Arial) and will
327+ # affect the alignment of all text in your output. Since this
328+ # one option affects all text instances, it's recommended
329+ # to use 'similarly spaced' fonts throughout your settings.
330+ fontCorrectionFactor = 1
331+
332+ # Orientation of the timeline
333+ # 0 = left to right, 1 = top to bottom
334+ # 2 = right to left, 3 = bottom to top
335+ orientation = 0
336+
337+ # The layout of the tree
338+ # 0 = branch to both sides
339+ # 1 = branch only on lower side
340+ # 2 = branch only on lower side, inverse (good for CSV output)
341+ treeMode = 0
342+
343+ # Chose: 0 = don't presort, 1 = by name, 2 = by date
344+ sortKey = 0
345+
346+ # Set optimisation between 0 and 99. See manual for details.
347+ # First digit: isolated nodes. Second digit: trees.
348+ optimise = 99
349+
350+ # This guesses if optimisation should overlap in some rare cases
351+ # 1 = forbid overlaps, 0 = allow overlaps (better optimisation)
352+ strictOverlaps = 0
353+
354+ # How much space (in offsets) to add before/after trees
355+ treeSpacing = 1
356+
357+ # How big (total children) a tree has to be before it gets spaced
358+ treeSpacingBiggerThan = 5
359+
360+ # Background color in hexadecimal RGB (#abc or #abcdef)
361+ mainBackground = #fff
362+
363+ # Customise the background lines separating the years and months
364+ # rulerWidth is the width of a year line when a year label is present (see yearLabelInterval below)
365+ # rulerUnlabeledYearWidth is the width of a year line without a year label.
366+ rulerWidth = 2
367+ rulerUnlabeledYearWidth = 2
368+ rulerColor = #ddd
369+ rulerMonthWidth = 1
370+ rulerMonthColor = #eee
371+
372+ # Width of all node lines
373+ lineWidth = 2
374+
375+ # Number of pixels between node lines (== 1 offset)
376+ offsetPX = 20
377+
378+ # Set to 0 if you want 'dying' lines to stop abruptly
379+ stopFadeOutPX = 30
380+
381+ # When optimising, gnuclad will inline nodes if possible. This sets
382+ # the minimum time distance between the stop of one node and the
383+ # start of another which will allow the latter to get appended.
384+ # Format: 'y.m.d' or 'y.m' or 'y' (year, month, day)
385+ stopSpacing = 0.2
386+
387+ # How many pixels one year should have
388+ yearPX = 100
389+
390+ # Customise the node labels
391+ labelFont = Liberation Sans, Arial, Helvetica
392+ labelFontSize = 16
393+ labelFontColor = #000
394+
395+ # An experimental feature you might want to use with derivType > 1
396+ # Opacity takes values between 0 (transparent) and 100 (opaque).
397+ # It DOES NOT work flawlessly with SVG 1.1 output.
398+ # (hoping for v1.2 or CSS3 ...)
399+ labelBGOpacity = 0
400+
401+ # This sets the heuristic used for determining label background width
402+ # 0 = standard, will sometimes generate suboptimal width values
403+ # 1 = improved, but only if the majority of your characters fall into
404+ # the ASCII charset and you use a fairly standard font
405+ # playing around with fontCorrectionFactor might help
406+ asciiStrings = 0
407+
408+ # Useful if you want to use the renames only as version bumps.
409+ # 0 = rename above the dot to the right, like the first name
410+ # 1 = rename centered within the dot
411+ nameChangeType = 0
412+
413+ # Set the way the lines should derive from the parent.
414+ # 0 = orthogonal, 1 = from parent's starting point
415+ # 2 = diagonal (45 degrees)
416+ # 3 = curved (1 year wide curves), 4 = curved (quadratic scaling)
417+ # 5 = curved (from parent's starting point)
418+ derivType = 0
419+
420+ # The size of the node dots
421+ dotRadius = 10
422+ smallDotRadius = 5
423+
424+ # Determines how the dots look.
425+ # 0 = full dots, 1 = circles
426+ # Circles might be useful together with nameChangeType = 1
427+ dotType = 0
428+
429+ # Specifies the amount a node's line thickness should increase
430+ # relative to the count of it's children. (recommended 0.0 - 1.0)
431+ bigParent = 0
432+
433+ # Adds small half-circles to connector starting points
434+ connectorDots = 1
435+
436+ # 1 = connectors have a dashed stroke
437+ # 0 = connectors are full lines
438+ connectorsDashed = 1
439+
440+ # Customise the year line encompassing the cladogram.
441+ yearLinePX = 40
442+ yearLineColor1 = #037
443+ yearLineColor2 = #37d
444+ yearLineFont = Liberation Sans, Arial, Helvetica
445+ yearLineFontSize = 28
446+ yearLineFontColor = #fff
447+
448+ # How many (empty) years to append at the end
449+ appendYears = 0
450+
451+ # How many (empty) years to prepend at the beginning
452+ prependYears = 0
453+
454+ # How many years between year labels
455+ yearLabelInterval = 1
456+
457+ # Remember to adjust your input data after changing these averages.
458+ daysInMonth = 30
459+ monthsInYear = 12
460+
461+ # Not setting endOfTime will use the current date.
462+ #endOfTime = 2012.12
463+
464+ # How the description field should be used.
465+ # 0 = ignore
466+ # 1 = weblink URL
467+ descriptionType = 0
468+
469+ # When parsing direcories, show dot (hidden) files (0 = off, 1 = on)
470+ dir_showDotFiles = 0
471+
472+ # Color of files, directories and links
473+ dir_colorFile = #0ff
474+ dir_colorDir = #00f
475+ dir_colorLink = #0f0
476+
477+ # Directories with greater than specified size will get a domain of
478+ # the given intensity (0-100). Set size = 0 to turn off.
479+ dir_domainSize = 0
480+ dir_domainIntensity = 3
481+
482 </pre>
483 <!-- Part of the gnuclad texinfo manual -->
484 </body></html>
485
486=== modified file 'doc/src/gnuclad.html/Configuration-Options.html' (properties changed: -x to +x)
487=== modified file 'doc/src/gnuclad.html/FAQ.html' (properties changed: -x to +x)
488=== modified file 'doc/src/gnuclad.html/GNU-Free-Documentation-License.html' (properties changed: -x to +x)
489=== modified file 'doc/src/gnuclad.html/Helpers-and-Utilities.html' (properties changed: -x to +x)
490=== modified file 'doc/src/gnuclad.html/Index.html' (properties changed: -x to +x)
491=== modified file 'doc/src/gnuclad.html/Programming.html' (properties changed: -x to +x)
492=== modified file 'doc/src/gnuclad.html/Usage-Tips.html' (properties changed: -x to +x)
493=== modified file 'doc/src/gnuclad.html/Usage.html' (properties changed: -x to +x)
494=== modified file 'doc/src/gnuclad.html/Writing-a-generator.html' (properties changed: -x to +x)
495=== modified file 'doc/src/gnuclad.html/Writing-a-parser.html' (properties changed: -x to +x)
496=== modified file 'doc/src/gnuclad.html/index.html' (properties changed: -x to +x)
497=== modified file 'doc/src/gnuclad.info' (properties changed: -x to +x)
498=== modified file 'doc/src/gnuclad.texi' (properties changed: -x to +x)
499=== modified file 'doc/src/stamp-vti' (properties changed: -x to +x)
500=== modified file 'doc/src/version.texi' (properties changed: -x to +x)
501=== modified file 'example/dir.conf' (properties changed: -x to +x)
502=== modified file 'example/example.conf' (properties changed: -x to +x)
503--- example/example.conf 2010-06-20 22:21:03 +0000
504+++ example/example.conf 2011-12-19 01:07:36 +0000
505@@ -36,7 +36,8 @@
506 treeMode = 0
507
508 mainBackground = #fff
509-rulerWidth = 2
510+rulerWidth = 4
511+rulerUnlabeledYearWidth = 2
512 rulerColor = #ddd
513 rulerMonthWidth = 1
514 rulerMonthColor = #eaeaea
515@@ -56,4 +57,6 @@
516 dotRadius = 10
517 smallDotRadius = 5
518
519-descriptionType = 1
520\ No newline at end of file
521+yearLabelInterval = 3
522+descriptionType = 1
523+
524
525=== modified file 'example/example.csv' (properties changed: -x to +x)
526=== modified file 'example/example2.conf' (properties changed: -x to +x)
527=== modified file 'example/images/foo.png' (properties changed: -x to +x)
528=== modified file 'example/images/foo.svg' (properties changed: -x to +x)
529=== modified file 'example/images/icon.png' (properties changed: -x to +x)
530=== modified file 'example/images/icon.svg' (properties changed: -x to +x)
531=== modified file 'src/.deps/gnuclad-gnuclad-cladogram.Po' (properties changed: -x to +x)
532=== modified file 'src/.deps/gnuclad-gnuclad-helpers.Po' (properties changed: -x to +x)
533=== modified file 'src/.deps/gnuclad-gnuclad-portability.Po' (properties changed: -x to +x)
534=== modified file 'src/.deps/gnuclad-gnuclad.Po' (properties changed: -x to +x)
535=== modified file 'src/Makefile.am' (properties changed: -x to +x)
536=== modified file 'src/Makefile.in' (properties changed: -x to +x)
537=== modified file 'src/generator/.deps/.dirstamp' (properties changed: -x to +x)
538=== modified file 'src/generator/.deps/gnuclad-conf.Po' (properties changed: -x to +x)
539=== modified file 'src/generator/.deps/gnuclad-csv.Po' (properties changed: -x to +x)
540=== modified file 'src/generator/.deps/gnuclad-png.Po' (properties changed: -x to +x)
541=== modified file 'src/generator/.deps/gnuclad-svg.Po' (properties changed: -x to +x)
542=== modified file 'src/generator/.dirstamp' (properties changed: -x to +x)
543=== modified file 'src/generator/conf.cpp' (properties changed: -x to +x)
544--- src/generator/conf.cpp 2011-02-13 11:10:21 +0000
545+++ src/generator/conf.cpp 2011-12-19 01:07:36 +0000
546@@ -111,7 +111,10 @@
547 << "\nmainBackground = #" << clad->mainBackground.hex
548 << "\n"
549 << "\n# Customise the background lines separating the years and months"
550+ << "\n# rulerWidth is the width of a year line when a year label is present (see yearLabelInterval below)"
551+ << "\n# rulerUnlabeledYearWidth is the width of a year line without a year label."
552 << "\nrulerWidth = " << clad->rulerWidth
553+ << "\nrulerUnlabeledYearWidth = " << clad->rulerUnlabeledYearWidth
554 << "\nrulerColor = #" << clad->rulerColor.hex
555 << "\nrulerMonthWidth = " << clad->rulerMonthWidth
556 << "\nrulerMonthColor = #" << clad->rulerMonthColor.hex
557@@ -198,6 +201,9 @@
558 << "\n# How many (empty) years to prepend at the beginning"
559 << "\nprependYears = " << clad->prependYears
560 << "\n"
561+ << "\n# How many years between year labels"
562+ << "\nyearLabelInterval = " << clad->yearLabelInterval
563+ << "\n"
564 << "\n# Remember to adjust your input data after changing these averages."
565 << "\ndaysInMonth = " << clad->daysInMonth
566 << "\nmonthsInYear = " << clad->monthsInYear
567
568=== modified file 'src/generator/conf.h' (properties changed: -x to +x)
569=== modified file 'src/generator/csv.cpp' (properties changed: -x to +x)
570=== modified file 'src/generator/csv.h' (properties changed: -x to +x)
571=== modified file 'src/generator/png.cpp' (properties changed: -x to +x)
572=== modified file 'src/generator/png.h' (properties changed: -x to +x)
573=== modified file 'src/generator/svg.cpp' (properties changed: -x to +x)
574--- src/generator/svg.cpp 2011-04-01 17:59:24 +0000
575+++ src/generator/svg.cpp 2011-12-19 01:07:36 +0000
576@@ -221,8 +221,13 @@
577 for(int i = 0; i <= years; ++i) {
578 int x = i * yrPX + xPX - clad->prependYears*yrPX;
579 int xm;
580- f << " <line x1='" << x << "' y1='" << topOffset - yrlinePX << "' x2='" << x << "' y2='" << height << "'"
581- << " stroke-width='" << clad->rulerWidth << "' stroke='#" << clad->rulerColor.hex << "' />\n";
582+ if(i % clad->yearLabelInterval == 0) { //This is a labeled year
583+ f << " <line x1='" << x << "' y1='" << topOffset - yrlinePX << "' x2='" << x << "' y2='" << height << "'"
584+ << " stroke-width='" << clad->rulerWidth << "' stroke='#" << clad->rulerColor.hex << "' />\n";
585+ }else{ // This is an unlabeled year
586+ f << " <line x1='" << x << "' y1='" << topOffset - yrlinePX << "' x2='" << x << "' y2='" << height << "'"
587+ << " stroke-width='" << clad->rulerUnlabeledYearWidth << "' stroke='#" << clad->rulerColor.hex << "' />\n";
588+ }
589 for(int j = 1; j < clad->monthsInYear && i < years; ++j) {
590 xm = x + j * yrPX / clad->monthsInYear;
591 f << " <line x1='" << xm << "' y1='" << topOffset - yrlinePX << "' x2='" << xm << "' y2='" << height << "' />\n";
592@@ -537,11 +542,11 @@
593 f << " <rect x='" << xPX - 10 << "' y='" << topOffset - yrlinePX - 3*oPX/2 << "' rx='5' ry='5' width='" << width - xPX + 10<< "' height='" << yrlinePX << "' />\n"
594 << " <rect x='" << xPX - 10 << "' y='" << height - yrlinePX << "' rx='5' ry='5' width='" << width - xPX + 10 << "' height='" << yrlinePX << "' />\n"
595 << " <g style='font-size:" << clad->yearLineFontSize << "px;stroke:none;fill:#" << clad->yearLineFontColor.hex << ";font-family:" << clad->yearLineFont << ";-inkscape-font-specification:" << clad->yearLineFont << ";text-anchor:middle;' >\n";
596- for(int i = 0; i <= clad->endOfTime.year - clad->beginningOfTime.year + clad->prependYears + clad->appendYears; ++i) {
597+ for(int i = 0; i <= clad->endOfTime.year - clad->beginningOfTime.year + clad->prependYears + clad->appendYears; i += clad->yearLabelInterval) { //++i) {
598 int posX = yrPX * i + yrPX / 2 + xPX;
599 int posY = topOffset - 3*oPX/2 - yrlinePX/2 + dirty_hack_ex / 2;
600 int yeartext = clad->beginningOfTime.year + i - clad->prependYears;
601- if(clad->orientation == oRL) yeartext = clad->endOfTime.year -i;
602+ if(clad->orientation == oRL) yeartext = clad->endOfTime.year - i;
603 f << " <text x='" << posX << "' y='" << posY << "'><tspan>" << yeartext << "</tspan></text>\n"
604 << " <text x='" << posX << "' y='" << height - yrlinePX/2 + dirty_hack_ex/2 << "'><tspan>" << yeartext << "</tspan></text>\n";
605 }
606
607=== modified file 'src/generator/svg.h' (properties changed: -x to +x)
608=== modified file 'src/gnuclad-cladogram.cpp' (properties changed: -x to +x)
609--- src/gnuclad-cladogram.cpp 2011-02-13 11:10:21 +0000
610+++ src/gnuclad-cladogram.cpp 2011-12-19 01:07:36 +0000
611@@ -65,6 +65,7 @@
612
613 mainBackground = Color("#fff");
614 rulerWidth = 2;
615+ rulerUnlabeledYearWidth = 2;
616 rulerColor = Color("#ddd");
617 rulerMonthWidth = 1;
618 rulerMonthColor = Color("#eee");
619@@ -99,6 +100,7 @@
620 yearLineFontColor = Color("#fff");
621 appendYears = 0;
622 prependYears = 0;
623+ yearLabelInterval = 1;
624
625 daysInMonth = 30;
626 monthsInYear = 12;
627@@ -197,6 +199,7 @@
628 else if(opt == "treeSpacingBiggerThan")treeSpacingBiggerThan=str2int(val);
629 else if(opt == "mainBackground") mainBackground = Color(val);
630 else if(opt == "rulerWidth") rulerWidth = str2int(val);
631+ else if(opt == "rulerUnlabeledYearWidth") rulerUnlabeledYearWidth = str2int(val);
632 else if(opt == "rulerColor") rulerColor = Color(val);
633 else if(opt == "rulerMonthWidth") rulerMonthWidth = str2int(val);
634 else if(opt == "rulerMonthColor") rulerMonthColor = Color(val);
635@@ -226,6 +229,7 @@
636 else if(opt == "yearLineFontColor") yearLineFontColor = Color(val);
637 else if(opt == "appendYears") appendYears = str2int(val);
638 else if(opt == "prependYears") prependYears = str2int(val);
639+ else if(opt == "yearLabelInterval") yearLabelInterval = str2int(val);
640 else if(opt == "daysInMonth") daysInMonth = str2int(val);
641 else if(opt == "monthsInYear") monthsInYear = str2int(val);
642 else if(opt == "endOfTime") endOfTime = Date(val);
643
644=== modified file 'src/gnuclad-helpers.cpp' (properties changed: -x to +x)
645=== modified file 'src/gnuclad-portability.cpp' (properties changed: -x to +x)
646=== modified file 'src/gnuclad-portability.h' (properties changed: -x to +x)
647=== modified file 'src/gnuclad.cpp' (properties changed: -x to +x)
648=== modified file 'src/gnuclad.h' (properties changed: -x to +x)
649--- src/gnuclad.h 2011-02-13 11:10:21 +0000
650+++ src/gnuclad.h 2011-12-19 01:07:36 +0000
651@@ -240,6 +240,7 @@
652
653 Color mainBackground;
654 int rulerWidth;
655+ int rulerUnlabeledYearWidth;
656 Color rulerColor;
657 int rulerMonthWidth;
658 Color rulerMonthColor;
659@@ -274,6 +275,7 @@
660 Color yearLineFontColor;
661 int appendYears;
662 int prependYears;
663+ int yearLabelInterval;
664
665 int monthsInYear;
666 int daysInMonth;
667
668=== modified file 'src/parser/.deps/.dirstamp' (properties changed: -x to +x)
669=== modified file 'src/parser/.deps/gnuclad-csv.Po' (properties changed: -x to +x)
670=== modified file 'src/parser/.deps/gnuclad-dir.Po' (properties changed: -x to +x)
671=== modified file 'src/parser/.dirstamp' (properties changed: -x to +x)
672=== modified file 'src/parser/csv.cpp' (properties changed: -x to +x)
673=== modified file 'src/parser/csv.h' (properties changed: -x to +x)
674=== modified file 'src/parser/dir.cpp' (properties changed: -x to +x)
675=== modified file 'src/parser/dir.h' (properties changed: -x to +x)

Subscribers

People subscribed via source and target branches

to all changes: