You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am using GraphView to paint a directed graph and want to specify all Edge to be grey at one time, however I found I can only specify each edge paint style every time I add edge to graph.
voidaddEdge(String a, String b) {
a =Uri.decodeComponent(a);
b =Uri.decodeComponent(b);
if(a == b){
return;
}
if((a.endsWith('/') || a.endsWith('.html')) && (b.endsWith('/') || b.endsWith('.html'))){
graph.addEdge(
_nodes.putIfAbsent(a, () =>Node.Id(a)),
_nodes.putIfAbsent(b, () =>Node.Id(b)),
paint:Paint()
..color =Colors.grey
..strokeWidth =0.2
..style =PaintingStyle.stroke
);
notifyListeners();
}
}
Then I read the source code and found that GrapView Widget doesn't use paint parameter at all !
here is my code
returnGraphView(
graph: notifier.graph,
algorithm:FruchtermanReingoldAlgorithm(
attractionRate:0.014,
repulsionRate:1,
repulsionPercentage:1,
iterations:1000,
),
paint:Paint()
..color =Colors.grey
..strokeWidth =0.2
..style =PaintingStyle.stroke,
builder: (Node node) {
// I can decide what widget should be shown here based on the idvar a = node.key?.value asString;
returnrectangleWidget(a);
},
);
paint goes down to GraphView then _GraphViewState, _GraphViewAnimated, finally _GraphViewAnimatedState. _GraphViewAnimatedState doesn't use paint that I specified. Instead, In _GraphViewAnimatedState’s build method, I found this
Hi, I am using GraphView to paint a directed graph and want to specify all Edge to be grey at one time, however I found I can only specify each edge paint style every time I add edge to graph.
Then I read the source code and found that GrapView Widget doesn't use
paint
parameter at all !here is my code
paint
goes down toGraphView
then_GraphViewState
,_GraphViewAnimated
, finally_GraphViewAnimatedState
._GraphViewAnimatedState
doesn't usepaint
that I specified. Instead, In_GraphViewAnimatedState
’sbuild
method, I found thisIn
EdgeRender
'spaint
method, it just constructs a newpaint
with some configurationSo I think the
paint
parameter ofGraphView
widget has no meaning, could you please fix it?The text was updated successfully, but these errors were encountered: