Skip to content

Commit b3328da

Browse files
committed
v2.3.0
1 parent 3ae7136 commit b3328da

File tree

16 files changed

+371
-364
lines changed

16 files changed

+371
-364
lines changed

.pubignore

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
# Pub
22
DEVLOG.md
33
devdoc/
4-
example/
4+
example/android
5+
example/ios
6+
example/web
7+
example/windows
8+
example/linux
9+
example/macos
10+
example/fuchsia
11+
example/lib
12+
example/test
13+
example/gitignore
14+
example/pubspec.yaml
15+
example/.metadata
16+
example/analysis_options.yaml
517

618
# Miscellaneous
719
*.class

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.3.0
2+
3+
**2024-07-09**
4+
5+
- Add `AxisGuide.labelBackground` and `AxisGuid.labelBackgroundMapper`: https://github.com/entronad/graphic/pull/301
6+
- Change `LabelStyle.textScaleFactor` to `LabelStyle.textScaler` to be consist with `TextPainter`: https://github.com/entronad/graphic/pull/300. Although this is a breaking change, only minor version is upgraded for this prop is rarely used.
7+
18
## 2.2.1
29

310
**2023-09-26**

LICENSE

+2-327
Large diffs are not rendered by default.

LICENSE_APPENDIX

+321
Large diffs are not rendered by default.

README.md

-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,6 @@ Graphic is a grammar of data visualization and Flutter charting library.
1111
- **Interaction**: With the *event* and *selection* definition, the chart is highly interactive, such as highlighting selected items, popping a tooltip, or scaling the coordinate.
1212
- **Animation**: Mark transition animation can be set when a chart is built or changed. The entrance animation has various forms.
1313

14-
## What's new in v2.0
15-
16-
- Add feature of transition animation, see details in `Mark.transition`. And thus the rendering engine is rewrited. The imperative `Figure` classes are changed to declarative `MarkElement` classes. See details in this folder: https://github.com/entronad/graphic/tree/main/lib/src/graffiti/element
17-
18-
- Update terminology to keep same with modern mainstream data visualization libraries. Some class names have changed:
19-
20-
`GeomElement -> Mark`
21-
22-
`Attr -> Encode`
23-
24-
`Signal -> Event`
25-
26-
`Channel -> Stream`
27-
28-
`Figure -> MarkElement`
29-
30-
And thus some properties related are also changed, like `elements -> marks`.
31-
3214
## Documentation
3315

3416
See in the [documentation](https://pub.dev/documentation/graphic/latest/graphic/graphic-library.html).

example/macos/Runner.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
isa = PBXProject;
183183
attributes = {
184184
LastSwiftUpdateCheck = 0920;
185-
LastUpgradeCheck = 1300;
185+
LastUpgradeCheck = 1510;
186186
ORGANIZATIONNAME = "";
187187
TargetAttributes = {
188188
33CC10EC2044A3C60003C045 = {

example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

lib/src/dataflow/tuple.dart

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Attributes {
4747
/// The index of the tuple in all tuples list.
4848
final int index;
4949

50+
/// The tag of the tuple.
5051
final String? tag;
5152

5253
/// Position points of the tuple.

lib/src/graffiti/element/element.dart

+1
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ abstract class BlockElement<S extends BlockStyle> extends MarkElement<S> {
434434
/// anchor position.
435435
painting.Alignment defaultAlign;
436436

437+
/// The real painting offset point of this block.
437438
@protected
438439
late final Offset paintPoint;
439440

lib/src/graffiti/element/label.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class LabelElement extends BlockElement<LabelStyle> {
227227
bool operator ==(Object other) =>
228228
other is LabelElement && super == other && text == other.text;
229229

230-
Rect getTextRect() {
230+
Rect getBlock() {
231231
const horizontalSpacing = 1;
232232
final left = paintPoint.dx - horizontalSpacing;
233233
final top = paintPoint.dy - 1;

lib/src/guide/axis/circular.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ List<MarkElement>? renderCircularAxis(
5252
) *
5353
flipSign;
5454

55-
final lineElement = LabelElement(
55+
final label = LabelElement(
5656
text: tick.text!,
5757
anchor: labelAnchor,
5858
defaultAlign: defaultAlign,
5959
style: tick.label!);
6060

6161
if (tick.haveLabelBackground) {
6262
rst.add(RectElement(
63-
rect: lineElement.getTextRect(),
63+
rect: label.getBlock(),
6464
style: tick.labelBackground!,
6565
));
6666
}
6767

68-
rst.add(lineElement);
68+
rst.add(label);
6969
}
7070
}
7171
}

lib/src/guide/axis/horizontal.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ List<MarkElement>? renderHorizontalAxis(
4040
style: tick.tickLine!.style));
4141
}
4242
if (tick.haveLabel) {
43-
final lineElement = LabelElement(
43+
final babel = LabelElement(
4444
text: tick.text!,
4545
anchor: Offset(x, y),
4646
defaultAlign: flip ? Alignment.topCenter : Alignment.bottomCenter,
4747
style: tick.label!);
4848

4949
if (tick.haveLabelBackground) {
5050
rst.add(RectElement(
51-
rect: lineElement.getTextRect(),
51+
rect: babel.getBlock(),
5252
style: tick.labelBackground!,
5353
));
5454
}
5555

56-
rst.add(lineElement);
56+
rst.add(babel);
5757
}
5858
}
5959
}

lib/src/guide/axis/radial.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,20 @@ List<MarkElement>? renderRadialAxis(
9292
final labelAlign = radialLabelAlign(featureOffset) * flipSign;
9393
for (var index in labelAnchors.keys) {
9494
final tick = ticks[index];
95-
final lineElement = LabelElement(
95+
final babel = LabelElement(
9696
text: tick.text!,
9797
anchor: labelAnchors[index]!,
9898
defaultAlign: labelAlign,
9999
style: tick.label!);
100100

101101
if (tick.haveLabelBackground) {
102102
rst.add(RectElement(
103-
rect: lineElement.getTextRect(),
103+
rect: babel.getBlock(),
104104
style: tick.labelBackground!,
105105
));
106106
}
107107

108-
rst.add(lineElement);
108+
rst.add(babel);
109109
}
110110

111111
return rst.isEmpty ? null : rst;

lib/src/guide/axis/vertical.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ List<MarkElement>? renderVerticalAxis(
4040
style: tick.tickLine!.style));
4141
}
4242
if (tick.haveLabel) {
43-
final lineElement = LabelElement(
43+
final babel = LabelElement(
4444
text: tick.text!,
4545
anchor: Offset(x, y),
4646
defaultAlign: flip ? Alignment.centerRight : Alignment.centerLeft,
4747
style: tick.label!);
4848

4949
if (tick.haveLabelBackground) {
5050
rst.add(RectElement(
51-
rect: lineElement.getTextRect(),
51+
rect: babel.getBlock(),
5252
style: tick.labelBackground!,
5353
));
5454
}
5555

56-
rst.add(lineElement);
56+
rst.add(babel);
5757
}
5858
}
5959
}

lib/src/shape/point.dart

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ abstract class PointShape extends FunctionShape {
3030
hollow == other.hollow &&
3131
strokeWidth == other.strokeWidth;
3232

33+
/// Draw each element of this point shape.
3334
MarkElement drawPoint(Attributes item, CoordConv coord);
3435

3536
@override

pubspec.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
name: graphic
22
description: A grammar of data visualization and Flutter charting library.
3-
version: 2.2.1
3+
version: 2.3.0
44
homepage: https://github.com/entronad/graphic
55

6+
topics:
7+
- chart
8+
- charts
9+
- visualization
10+
- diagram
11+
- plot
12+
613
environment:
714
sdk: '>=2.13.0 <4.0.0'
815
flutter: '>=3.16.0'
916

1017
dependencies:
11-
collection: ^1.15.0
18+
collection: ^1.18.0
1219
flutter:
1320
sdk: flutter
1421
vector_math: ^2.1.0
@@ -17,4 +24,4 @@ dependencies:
1724
dev_dependencies:
1825
flutter_test:
1926
sdk: flutter
20-
flutter_lints: ^2.0.1
27+
flutter_lints: ^4.0.0

0 commit comments

Comments
 (0)