File tree Expand file tree Collapse file tree 3 files changed +21
-10
lines changed
src/components/DataStructures/Graph Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change 131
131
.edge {
132
132
.line {
133
133
stroke : var (--graph-edge-line-stroke );
134
- stroke-width : 2.5 ;
134
+ // For various trees we don't care much about edges so having them
135
+ // thin is fine but for some graph algorithms in particular we
136
+ // want to highlight edges and change their color to we want
137
+ // reasonable thick edges; this is a compromise (maybe we could
138
+ // add an interface to adjust it for different algorithms XXX)
139
+ stroke-width : 7 ; // width of edges in graphs
135
140
fill : none ;
136
141
137
142
& .directed {
143
148
fill : var (--graph-edge-line-weight-fill );
144
149
alignment-baseline : baseline ;
145
150
text-anchor : middle ;
151
+ // font size for labels in nodes - should be linked to node radius
152
+ // XXX but currently isn't. Another difficulty was node sizes
153
+ // were adjusted depending on coordinate list - now deleted.
146
154
// font-size: 15px;
147
155
font-size : 35px ;
148
156
}
Original file line number Diff line number Diff line change @@ -125,14 +125,14 @@ class GraphRenderer extends Renderer {
125
125
}
126
126
127
127
/**
128
- * Add scales to the axis
128
+ * Add scale tick marks to the axis
129
129
*/
130
130
computeScales (
131
131
min ,
132
132
max ,
133
133
center ,
134
134
stepSize = 30 ,
135
- stepHeight = 5 ,
135
+ stepHeight = 15 , // size of scale mark tick on axes
136
136
increment = 1
137
137
) {
138
138
const scales = [ ] ;
@@ -273,14 +273,14 @@ class GraphRenderer extends Renderer {
273
273
const axisArrowX = this . computeArrows (
274
274
'x' ,
275
275
{ x : axisEndPoint , y : axisCenter . y } ,
276
- 8 ,
277
- 8
276
+ 18 ,
277
+ 18
278
278
) ; // list containing fragments to form arrow on x
279
279
const axisArrowY = this . computeArrows (
280
280
'y' ,
281
281
{ x : axisCenter . x , y : axisEndPoint } ,
282
- 8 ,
283
- 8
282
+ 18 ,
283
+ 18
284
284
) ; // list containing fragments to form arrow on y
285
285
286
286
const labelPadding = 20 ;
@@ -383,7 +383,7 @@ class GraphRenderer extends Renderer {
383
383
/>
384
384
< text
385
385
x = { scale . x1 }
386
- y = { originCoords . y + 20 }
386
+ y = { originCoords . y + 30 }
387
387
textAnchor = "middle"
388
388
className = { styles . axisLabel }
389
389
>
@@ -403,7 +403,7 @@ class GraphRenderer extends Renderer {
403
403
className = { styles . axis }
404
404
/>
405
405
< text
406
- x = { originCoords . x - 15 }
406
+ x = { originCoords . x - 25 }
407
407
y = { scale . y1 + 6 }
408
408
textAnchor = "middle"
409
409
className = { styles . axisLabel }
Original file line number Diff line number Diff line change @@ -93,11 +93,14 @@ class GraphTracer extends Tracer {
93
93
if ( maxCoord < ( i + 1 ) * 10 )
94
94
{
95
95
const radiusIncrease = ( i - 1 ) * 6
96
- this . dimensions . nodeRadius = this . dimensions . defaultNodeRadius + radiusIncrease ;
96
+ // XXX makes graph nodes rather fat compared with tree nodes
97
+ // with default values so I've deleted it for now
98
+ // this.dimensions.nodeRadius = this.dimensions.defaultNodeRadius + radiusIncrease;
97
99
return ;
98
100
}
99
101
}
100
102
103
+ // XXX
101
104
// SHOULD ALSO SET LABEL SIZE OF NODE HERE !!!
102
105
// ALTERNATIVELY LABEL SIZE SHOULD BE CALCULATED ELSEWHERE DEPENDANT ON NODE RADIUS!!!
103
106
}
You can’t perform that action at this time.
0 commit comments