Fossil SCM

Further minor tweaks to the graph drawing javascript. New graph test cases added.

drh 2010-12-30 21:03 trunk
Commit ddc3d3d19cf3b30f07e5dc09db4b4e432aa9776c
+5 -5
--- src/timeline.c
+++ src/timeline.c
@@ -362,13 +362,13 @@
362362
** bg: The background color for this row
363363
** r: The "rail" that the node for this row sits on. The left-most
364364
** rail is 0 and the number increases to the right.
365365
** d: True if there is a "descender" - an arrow coming from the bottom
366366
** of the page straight up to this node.
367
- ** mo: "merge-out". If non-negative, this is a rail number on which
367
+ ** mo: "merge-out". If non-zero, this is one more than the rail on which
368368
** a merge arrow travels upward. The merge arrow is drawn upwards
369
- ** to the row identified by mu:. This value is negative then
369
+ ** to the row identified by mu:. If this value is zero then
370370
** node has no merge children and no merge-out line is drawn.
371371
** mu: The id of the row which is the top of the merge-out arrow.
372372
** md: A bitmask of rails on which merge-arrow descenders should be
373373
** drawn from this row to the bottom of the page. The least
374374
** significant bit (1) corresponds to rail 0. The 2-bit corresponds
@@ -389,11 +389,11 @@
389389
cgi_printf("{id:%d,bg:\"%s\",r:%d,d:%d,mo:%d,mu:%d,md:%u,u:%d,au:",
390390
pRow->idx,
391391
pRow->zBgClr,
392392
pRow->iRail,
393393
pRow->bDescender,
394
- pRow->mergeOut,
394
+ pRow->mergeOut+1,
395395
pRow->mergeUpto,
396396
pRow->mergeDown,
397397
pRow->aiRiser[pRow->iRail]
398398
);
399399
cSep = '[';
@@ -489,12 +489,12 @@
489489
@ drawUpArrow(p.x, u.y+6, p.y-5);
490490
@ }
491491
@ if( p.d ){
492492
@ drawUpArrow(p.x, p.y+6, btm);
493493
@ }
494
- @ if( p.mo>=0 ){
495
- @ var x1 = p.mo*20 + left;
494
+ @ if( p.mo>0 ){
495
+ @ var x1 = (p.mo-1)*20 + left;
496496
@ var y1 = p.y-3;
497497
@ var x0 = x1>p.x ? p.x+7 : p.x-6;
498498
@ var u = rowinfo[p.mu-1];
499499
@ var y0 = u.y+5;
500500
@ if( x1==p.x ){
501501
--- src/timeline.c
+++ src/timeline.c
@@ -362,13 +362,13 @@
362 ** bg: The background color for this row
363 ** r: The "rail" that the node for this row sits on. The left-most
364 ** rail is 0 and the number increases to the right.
365 ** d: True if there is a "descender" - an arrow coming from the bottom
366 ** of the page straight up to this node.
367 ** mo: "merge-out". If non-negative, this is a rail number on which
368 ** a merge arrow travels upward. The merge arrow is drawn upwards
369 ** to the row identified by mu:. This value is negative then
370 ** node has no merge children and no merge-out line is drawn.
371 ** mu: The id of the row which is the top of the merge-out arrow.
372 ** md: A bitmask of rails on which merge-arrow descenders should be
373 ** drawn from this row to the bottom of the page. The least
374 ** significant bit (1) corresponds to rail 0. The 2-bit corresponds
@@ -389,11 +389,11 @@
389 cgi_printf("{id:%d,bg:\"%s\",r:%d,d:%d,mo:%d,mu:%d,md:%u,u:%d,au:",
390 pRow->idx,
391 pRow->zBgClr,
392 pRow->iRail,
393 pRow->bDescender,
394 pRow->mergeOut,
395 pRow->mergeUpto,
396 pRow->mergeDown,
397 pRow->aiRiser[pRow->iRail]
398 );
399 cSep = '[';
@@ -489,12 +489,12 @@
489 @ drawUpArrow(p.x, u.y+6, p.y-5);
490 @ }
491 @ if( p.d ){
492 @ drawUpArrow(p.x, p.y+6, btm);
493 @ }
494 @ if( p.mo>=0 ){
495 @ var x1 = p.mo*20 + left;
496 @ var y1 = p.y-3;
497 @ var x0 = x1>p.x ? p.x+7 : p.x-6;
498 @ var u = rowinfo[p.mu-1];
499 @ var y0 = u.y+5;
500 @ if( x1==p.x ){
501
--- src/timeline.c
+++ src/timeline.c
@@ -362,13 +362,13 @@
362 ** bg: The background color for this row
363 ** r: The "rail" that the node for this row sits on. The left-most
364 ** rail is 0 and the number increases to the right.
365 ** d: True if there is a "descender" - an arrow coming from the bottom
366 ** of the page straight up to this node.
367 ** mo: "merge-out". If non-zero, this is one more than the rail on which
368 ** a merge arrow travels upward. The merge arrow is drawn upwards
369 ** to the row identified by mu:. If this value is zero then
370 ** node has no merge children and no merge-out line is drawn.
371 ** mu: The id of the row which is the top of the merge-out arrow.
372 ** md: A bitmask of rails on which merge-arrow descenders should be
373 ** drawn from this row to the bottom of the page. The least
374 ** significant bit (1) corresponds to rail 0. The 2-bit corresponds
@@ -389,11 +389,11 @@
389 cgi_printf("{id:%d,bg:\"%s\",r:%d,d:%d,mo:%d,mu:%d,md:%u,u:%d,au:",
390 pRow->idx,
391 pRow->zBgClr,
392 pRow->iRail,
393 pRow->bDescender,
394 pRow->mergeOut+1,
395 pRow->mergeUpto,
396 pRow->mergeDown,
397 pRow->aiRiser[pRow->iRail]
398 );
399 cSep = '[';
@@ -489,12 +489,12 @@
489 @ drawUpArrow(p.x, u.y+6, p.y-5);
490 @ }
491 @ if( p.d ){
492 @ drawUpArrow(p.x, p.y+6, btm);
493 @ }
494 @ if( p.mo>0 ){
495 @ var x1 = (p.mo-1)*20 + left;
496 @ var y1 = p.y-3;
497 @ var x0 = x1>p.x ? p.x+7 : p.x-6;
498 @ var u = rowinfo[p.mu-1];
499 @ var y0 = u.y+5;
500 @ if( x1==p.x ){
501
--- test/graph-test-1.wiki
+++ test/graph-test-1.wiki
@@ -6,10 +6,15 @@
66
77
* [/timeline?n=20&y=ci&b=2010-11-08]
88
* [/timeline?n=40&y=ci&b=2010-11-08]
99
* [/timeline?n=1000&y=ci&b=2010-11-08]
1010
* [/timeline?f=3ea66260b5555d2e]
11
+ * [/timeline?d=e5fe4164f74a7576&p=e5fe4164f74a7576&n=3] -
12
+ multiple merge descenders from the penultimate node.
13
+ * [/timeline?y=ci&a=2010-12-20] - multiple branch risers.
14
+ * [/timeline?y=ci&a=2010-12-20&n=18]
15
+ * [/timeline?y=ci&a=2010-12-20&n=9]
1116
* [/timeline?r=experimental]
1217
* [/timeline?r=experimental&n=1000]
1318
* [/timeline?r=creole]
1419
* [/timeline?t=creole]
1520
* [/timeline?t=release]
1621
--- test/graph-test-1.wiki
+++ test/graph-test-1.wiki
@@ -6,10 +6,15 @@
6
7 * [/timeline?n=20&y=ci&b=2010-11-08]
8 * [/timeline?n=40&y=ci&b=2010-11-08]
9 * [/timeline?n=1000&y=ci&b=2010-11-08]
10 * [/timeline?f=3ea66260b5555d2e]
 
 
 
 
 
11 * [/timeline?r=experimental]
12 * [/timeline?r=experimental&n=1000]
13 * [/timeline?r=creole]
14 * [/timeline?t=creole]
15 * [/timeline?t=release]
16
--- test/graph-test-1.wiki
+++ test/graph-test-1.wiki
@@ -6,10 +6,15 @@
6
7 * [/timeline?n=20&y=ci&b=2010-11-08]
8 * [/timeline?n=40&y=ci&b=2010-11-08]
9 * [/timeline?n=1000&y=ci&b=2010-11-08]
10 * [/timeline?f=3ea66260b5555d2e]
11 * [/timeline?d=e5fe4164f74a7576&p=e5fe4164f74a7576&n=3] -
12 multiple merge descenders from the penultimate node.
13 * [/timeline?y=ci&a=2010-12-20] - multiple branch risers.
14 * [/timeline?y=ci&a=2010-12-20&n=18]
15 * [/timeline?y=ci&a=2010-12-20&n=9]
16 * [/timeline?r=experimental]
17 * [/timeline?r=experimental&n=1000]
18 * [/timeline?r=creole]
19 * [/timeline?t=creole]
20 * [/timeline?t=release]
21

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button