Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit de8985a

Browse files
committedJan 25, 2023
v0.0.1+6
Fixed: components overflow game window. Fixed: `Options.vertexPanelBuilder` nullable as expected.
1 parent dee0320 commit de8985a

File tree

8 files changed

+178
-100
lines changed

8 files changed

+178
-100
lines changed
 

‎CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## 0.0.1+6
22
- Data panel embedding. ( For edge )
3+
- Fixed: components overflow game window.
4+
- Fixed: `Options.vertexPanelBuilder` nullable as expected.
35

46
## 0.0.1+5
57
- Keep children vertexes around the parent vertex.

‎README-CN.md

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Flutter Graph View
99
致力于图数据的可视化组件
1010

11-
![image](https://foruda.gitee.com/images/1674072032729548735/1e629f03_1043207.png)
11+
![demo](https://foruda.gitee.com/images/1674684822685415888/5033481e_1043207.png)
1212

1313
## Features
1414

@@ -83,38 +83,58 @@ void main() {
8383
algorithm: ForceDirected(),
8484
convertor: MapConvertor(),
8585
options: Options()
86-
..vertexPanelBuilder = (hoverVertex) {
87-
if (hoverVertex == null) {
88-
return Container();
89-
}
90-
return Stack(
91-
children: [
92-
Positioned(
93-
left:
94-
hoverVertex.cpn!.position.x + hoverVertex.cpn!.radius + 5,
95-
top: hoverVertex.cpn!.position.y - 20,
96-
child: SizedBox(
97-
width: 120,
98-
child: ColoredBox(
99-
color: Colors.white,
100-
child: ListTile(
101-
title: Text(
102-
'Id: ${hoverVertex.id}',
103-
),
104-
subtitle: Text(
105-
'Tag: ${hoverVertex.data['tag']}\nDegree: ${hoverVertex.degree}'),
106-
),
107-
),
108-
),
109-
)
110-
],
111-
);
112-
},
86+
..edgePanelBuilder = edgePanelBuilder
87+
..vertexPanelBuilder = vertexPanelBuilder,
11388
),
11489
),
11590
));
11691
}
11792
93+
Widget edgePanelBuilder(Edge edge) {
94+
var c = (edge.start.cpn!.position + edge.end!.cpn!.position) / 2;
95+
return Stack(
96+
children: [
97+
Positioned(
98+
left: c.x + 5,
99+
top: c.y,
100+
child: SizedBox(
101+
width: 150,
102+
child: ColoredBox(
103+
color: Colors.white,
104+
child: ListTile(
105+
title: Text('${edge.edgeName} @${edge.ranking}'),
106+
),
107+
),
108+
),
109+
)
110+
],
111+
);
112+
}
113+
114+
Widget vertexPanelBuilder(hoverVertex) {
115+
return Stack(
116+
children: [
117+
Positioned(
118+
left: hoverVertex.cpn!.position.x + hoverVertex.cpn!.radius + 5,
119+
top: hoverVertex.cpn!.position.y - 20,
120+
child: SizedBox(
121+
width: 120,
122+
child: ColoredBox(
123+
color: Colors.white,
124+
child: ListTile(
125+
title: Text(
126+
'Id: ${hoverVertex.id}',
127+
),
128+
subtitle: Text(
129+
'Tag: ${hoverVertex.data['tag']}\nDegree: ${hoverVertex.degree}'),
130+
),
131+
),
132+
),
133+
)
134+
],
135+
);
136+
}
137+
118138
```
119139

120140
## Licence

‎README.md

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# Flutter Graph View
88
Widgets for beautiful graphic data structures, such as force-oriented diagrams. (Under development.)
99

10+
![image](https://user-images.githubusercontent.com/15630211/214703510-17ccfe4d-e3f6-49b9-9bc1-6ce84bd825a8.png)
11+
1012
https://user-images.githubusercontent.com/15630211/214360687-93a3683c-0935-46bd-9584-5cb997d518b8.mp4
1113

1214
## Features
@@ -81,38 +83,58 @@ void main() {
8183
algorithm: ForceDirected(),
8284
convertor: MapConvertor(),
8385
options: Options()
84-
..vertexPanelBuilder = (hoverVertex) {
85-
if (hoverVertex == null) {
86-
return Container();
87-
}
88-
return Stack(
89-
children: [
90-
Positioned(
91-
left:
92-
hoverVertex.cpn!.position.x + hoverVertex.cpn!.radius + 5,
93-
top: hoverVertex.cpn!.position.y - 20,
94-
child: SizedBox(
95-
width: 120,
96-
child: ColoredBox(
97-
color: Colors.white,
98-
child: ListTile(
99-
title: Text(
100-
'Id: ${hoverVertex.id}',
101-
),
102-
subtitle: Text(
103-
'Tag: ${hoverVertex.data['tag']}\nDegree: ${hoverVertex.degree}'),
104-
),
105-
),
106-
),
107-
)
108-
],
109-
);
110-
},
86+
..edgePanelBuilder = edgePanelBuilder
87+
..vertexPanelBuilder = vertexPanelBuilder,
11188
),
11289
),
11390
));
11491
}
11592
93+
Widget edgePanelBuilder(Edge edge) {
94+
var c = (edge.start.cpn!.position + edge.end!.cpn!.position) / 2;
95+
return Stack(
96+
children: [
97+
Positioned(
98+
left: c.x + 5,
99+
top: c.y,
100+
child: SizedBox(
101+
width: 150,
102+
child: ColoredBox(
103+
color: Colors.white,
104+
child: ListTile(
105+
title: Text('${edge.edgeName} @${edge.ranking}'),
106+
),
107+
),
108+
),
109+
)
110+
],
111+
);
112+
}
113+
114+
Widget vertexPanelBuilder(hoverVertex) {
115+
return Stack(
116+
children: [
117+
Positioned(
118+
left: hoverVertex.cpn!.position.x + hoverVertex.cpn!.radius + 5,
119+
top: hoverVertex.cpn!.position.y - 20,
120+
child: SizedBox(
121+
width: 120,
122+
child: ColoredBox(
123+
color: Colors.white,
124+
child: ListTile(
125+
title: Text(
126+
'Id: ${hoverVertex.id}',
127+
),
128+
subtitle: Text(
129+
'Tag: ${hoverVertex.data['tag']}\nDegree: ${hoverVertex.degree}'),
130+
),
131+
),
132+
),
133+
)
134+
],
135+
);
136+
}
137+
116138
```
117139

118140
## Licence
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Please sign in to comment.