@@ -76,7 +76,9 @@ class AnimationPageState extends State<AnimationPage> {
76
76
{'genre' : 'Other' , 'sold' : rdm.nextInt (300 )},
77
77
];
78
78
79
- scatterAnimData = scatterAnimData.map ((d) => [d[0 ], d[1 ], d[2 ], d[3 ], - 1 * d[4 ]]).toList ();
79
+ scatterAnimData = scatterAnimData
80
+ .map ((d) => [d[0 ], d[1 ], d[2 ], d[3 ], - 1 * d[4 ]])
81
+ .toList ();
80
82
});
81
83
});
82
84
@@ -97,7 +99,12 @@ class AnimationPageState extends State<AnimationPage> {
97
99
title: const Text ('Animation' ),
98
100
),
99
101
backgroundColor: Colors .white,
100
- floatingActionButton: FloatingActionButton (onPressed: () => setState (() {rebuild = true ;}), child: Icon (Icons .refresh),),
102
+ floatingActionButton: FloatingActionButton (
103
+ onPressed: () => setState (() {
104
+ rebuild = true ;
105
+ }),
106
+ child: Icon (Icons .refresh),
107
+ ),
101
108
body: SingleChildScrollView (
102
109
child: Center (
103
110
child: Column (
@@ -132,13 +139,18 @@ class AnimationPageState extends State<AnimationPage> {
132
139
scale: LinearScale (min: 0 ),
133
140
),
134
141
},
135
- transforms: [Sort (compare: (tuple1, tuple2) => tuple1['sold' ] - tuple2['sold' ])],
142
+ transforms: [
143
+ Sort (
144
+ compare: (tuple1, tuple2) =>
145
+ tuple1['sold' ] - tuple2['sold' ])
146
+ ],
136
147
marks: [
137
148
IntervalMark (
138
- transition: Transition (duration: Duration (seconds: 1 )),
139
- entrance: {MarkEntrance .y},
140
- label: LabelEncode (encoder: (tuple) => Label (tuple['sold' ].toString ())),
141
- tag: (tuple) => tuple['genre' ].toString (),
149
+ transition: Transition (duration: Duration (seconds: 1 )),
150
+ entrance: {MarkEntrance .y},
151
+ label: LabelEncode (
152
+ encoder: (tuple) => Label (tuple['sold' ].toString ())),
153
+ tag: (tuple) => tuple['genre' ].toString (),
142
154
)
143
155
],
144
156
axes: [
@@ -147,8 +159,6 @@ class AnimationPageState extends State<AnimationPage> {
147
159
],
148
160
),
149
161
),
150
-
151
-
152
162
Container (
153
163
padding: const EdgeInsets .fromLTRB (20 , 40 , 20 , 5 ),
154
164
child: const Text (
@@ -198,14 +208,15 @@ class AnimationPageState extends State<AnimationPage> {
198
208
color: ColorEncode (
199
209
variable: 'name' , values: Defaults .colors10),
200
210
elevation: ElevationEncode (value: 5 ),
201
- transition: Transition (duration: Duration (seconds: 2 ), curve: Curves .elasticOut),
211
+ transition: Transition (
212
+ duration: Duration (seconds: 2 ),
213
+ curve: Curves .elasticOut),
202
214
entrance: {MarkEntrance .y},
203
215
)
204
216
],
205
217
coord: PolarCoord (startRadius: 0.15 ),
206
218
),
207
219
),
208
-
209
220
Container (
210
221
padding: const EdgeInsets .fromLTRB (20 , 40 , 20 , 5 ),
211
222
child: const Text (
@@ -231,9 +242,8 @@ class AnimationPageState extends State<AnimationPage> {
231
242
accessor: (List datum) => datum[2 ] as num ,
232
243
),
233
244
'4' : Variable (
234
- accessor: (List datum) => datum[4 ].toString (),
235
- scale: OrdinalScale (values: ['-1' , '1' ])
236
- ),
245
+ accessor: (List datum) => datum[4 ].toString (),
246
+ scale: OrdinalScale (values: ['-1' , '1' ])),
237
247
},
238
248
marks: [
239
249
PointMark (
@@ -273,7 +283,6 @@ class AnimationPageState extends State<AnimationPage> {
273
283
coord: PolarCoord (),
274
284
),
275
285
),
276
-
277
286
Container (
278
287
padding: const EdgeInsets .fromLTRB (20 , 40 , 20 , 5 ),
279
288
child: const Text (
@@ -368,18 +377,27 @@ class AnimationPageState extends State<AnimationPage> {
368
377
marks: [
369
378
AreaMark (
370
379
shape: ShapeEncode (value: BasicAreaShape (smooth: true )),
371
- gradient: GradientEncode (value: LinearGradient (colors: [
380
+ gradient: GradientEncode (
381
+ value: LinearGradient (colors: [
372
382
Defaults .colors10.first.withAlpha (80 ),
373
383
Defaults .colors10.first.withAlpha (10 ),
374
384
])),
375
385
transition: Transition (duration: Duration (seconds: 2 )),
376
- entrance: {MarkEntrance .x, MarkEntrance .y, MarkEntrance .opacity},
386
+ entrance: {
387
+ MarkEntrance .x,
388
+ MarkEntrance .y,
389
+ MarkEntrance .opacity
390
+ },
377
391
),
378
392
LineMark (
379
393
shape: ShapeEncode (value: BasicLineShape (smooth: true )),
380
394
size: SizeEncode (value: 0.5 ),
381
395
transition: Transition (duration: Duration (seconds: 2 )),
382
- entrance: {MarkEntrance .x, MarkEntrance .y, MarkEntrance .opacity},
396
+ entrance: {
397
+ MarkEntrance .x,
398
+ MarkEntrance .y,
399
+ MarkEntrance .opacity
400
+ },
383
401
),
384
402
],
385
403
axes: [
0 commit comments