Skip to content

Commit

Permalink
v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
entronad committed Jul 9, 2024
1 parent 3ae7136 commit b3328da
Show file tree
Hide file tree
Showing 16 changed files with 371 additions and 364 deletions.
14 changes: 13 additions & 1 deletion .pubignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Pub
DEVLOG.md
devdoc/
example/
example/android
example/ios
example/web
example/windows
example/linux
example/macos
example/fuchsia
example/lib
example/test
example/gitignore
example/pubspec.yaml
example/.metadata
example/analysis_options.yaml

# Miscellaneous
*.class
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.3.0

**2024-07-09**

- Add `AxisGuide.labelBackground` and `AxisGuid.labelBackgroundMapper`: https://github.com/entronad/graphic/pull/301
- 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.

## 2.2.1

**2023-09-26**
Expand Down
329 changes: 2 additions & 327 deletions LICENSE

Large diffs are not rendered by default.

321 changes: 321 additions & 0 deletions LICENSE_APPENDIX

Large diffs are not rendered by default.

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

## What's new in v2.0

- 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

- Update terminology to keep same with modern mainstream data visualization libraries. Some class names have changed:

`GeomElement -> Mark`

`Attr -> Encode`

`Signal -> Event`

`Channel -> Stream`

`Figure -> MarkElement`

And thus some properties related are also changed, like `elements -> marks`.

## Documentation

See in the [documentation](https://pub.dev/documentation/graphic/latest/graphic/graphic-library.html).
Expand Down
2 changes: 1 addition & 1 deletion example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 1 addition & 0 deletions lib/src/dataflow/tuple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Attributes {
/// The index of the tuple in all tuples list.
final int index;

/// The tag of the tuple.
final String? tag;

/// Position points of the tuple.
Expand Down
1 change: 1 addition & 0 deletions lib/src/graffiti/element/element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ abstract class BlockElement<S extends BlockStyle> extends MarkElement<S> {
/// anchor position.
painting.Alignment defaultAlign;

/// The real painting offset point of this block.
@protected
late final Offset paintPoint;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/graffiti/element/label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class LabelElement extends BlockElement<LabelStyle> {
bool operator ==(Object other) =>
other is LabelElement && super == other && text == other.text;

Rect getTextRect() {
Rect getBlock() {
const horizontalSpacing = 1;
final left = paintPoint.dx - horizontalSpacing;
final top = paintPoint.dy - 1;
Expand Down
6 changes: 3 additions & 3 deletions lib/src/guide/axis/circular.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ List<MarkElement>? renderCircularAxis(
) *
flipSign;

final lineElement = LabelElement(
final label = LabelElement(
text: tick.text!,
anchor: labelAnchor,
defaultAlign: defaultAlign,
style: tick.label!);

if (tick.haveLabelBackground) {
rst.add(RectElement(
rect: lineElement.getTextRect(),
rect: label.getBlock(),
style: tick.labelBackground!,
));
}

rst.add(lineElement);
rst.add(label);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/guide/axis/horizontal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ List<MarkElement>? renderHorizontalAxis(
style: tick.tickLine!.style));
}
if (tick.haveLabel) {
final lineElement = LabelElement(
final babel = LabelElement(
text: tick.text!,
anchor: Offset(x, y),
defaultAlign: flip ? Alignment.topCenter : Alignment.bottomCenter,
style: tick.label!);

if (tick.haveLabelBackground) {
rst.add(RectElement(
rect: lineElement.getTextRect(),
rect: babel.getBlock(),
style: tick.labelBackground!,
));
}

rst.add(lineElement);
rst.add(babel);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/guide/axis/radial.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ List<MarkElement>? renderRadialAxis(
final labelAlign = radialLabelAlign(featureOffset) * flipSign;
for (var index in labelAnchors.keys) {
final tick = ticks[index];
final lineElement = LabelElement(
final babel = LabelElement(
text: tick.text!,
anchor: labelAnchors[index]!,
defaultAlign: labelAlign,
style: tick.label!);

if (tick.haveLabelBackground) {
rst.add(RectElement(
rect: lineElement.getTextRect(),
rect: babel.getBlock(),
style: tick.labelBackground!,
));
}

rst.add(lineElement);
rst.add(babel);
}

return rst.isEmpty ? null : rst;
Expand Down
6 changes: 3 additions & 3 deletions lib/src/guide/axis/vertical.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ List<MarkElement>? renderVerticalAxis(
style: tick.tickLine!.style));
}
if (tick.haveLabel) {
final lineElement = LabelElement(
final babel = LabelElement(
text: tick.text!,
anchor: Offset(x, y),
defaultAlign: flip ? Alignment.centerRight : Alignment.centerLeft,
style: tick.label!);

if (tick.haveLabelBackground) {
rst.add(RectElement(
rect: lineElement.getTextRect(),
rect: babel.getBlock(),
style: tick.labelBackground!,
));
}

rst.add(lineElement);
rst.add(babel);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/shape/point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ abstract class PointShape extends FunctionShape {
hollow == other.hollow &&
strokeWidth == other.strokeWidth;

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

@override
Expand Down
13 changes: 10 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: graphic
description: A grammar of data visualization and Flutter charting library.
version: 2.2.1
version: 2.3.0
homepage: https://github.com/entronad/graphic

topics:
- chart
- charts
- visualization
- diagram
- plot

environment:
sdk: '>=2.13.0 <4.0.0'
flutter: '>=3.16.0'

dependencies:
collection: ^1.15.0
collection: ^1.18.0
flutter:
sdk: flutter
vector_math: ^2.1.0
Expand All @@ -17,4 +24,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.1
flutter_lints: ^4.0.0

0 comments on commit b3328da

Please sign in to comment.