Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
entronad committed Nov 1, 2022
1 parent d4fbfe4 commit 17c95ae
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Pub
DEVLOG.md
devdoc/
example/

# 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 @@
## 1.0.0

**2022-11-01**

- Graphic has finished initial development and ready for production from this version. The API will be stable while a new major version begins in the design.
- Add size to tooltip renderer function: https://github.com/entronad/graphic/pull/159

## 0.10.7

**2022-09-20**
Expand Down
31 changes: 24 additions & 7 deletions DEVLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4147,15 +4147,32 @@ animation




介绍:

声明式
感觉针对数组的可定制回调函数参数还是应该带上index,这个需求挺实际的,不要信了dart的鬼

可交互
原则:减少概念,增加flexibility,无论从理论到实践,都应该把flexibility、extensive作为首要目标

问题
思考declaration和transformation的关系,D3认为专注transformation有助于提升性能。D3在底层的transformation上还有declarative的helper

1. 对nest的理解,group by
2. elevation作为一个 aes attr
d3这种称为 embedded domain-specifific language

从实践的角度讲,ticks很重要,特别是在缩放情况下



是不是可以把 shape提取出来,和geom合并?



似乎 selection updater 也应该改为和signal updater类似的多参数的



## 论文

与gg的区别:shape

interaction 和 animation

flutter的图形系统是成立的基础(见d3论文)
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ Example of charts can be seen in the [Example App](https://github.com/entronad/g

![examples](https://github.com/entronad/graphic/raw/main/devdoc/examples.jpg)

## Used by

Graphic is used by these companies:

[![rows](https://github.com/entronad/graphic/raw/main/devdoc/logo_rows.svg)](https://rows.com/)

## Tutorials

[The Versatility of the Grammar of Graphics](https://medium.com/@entronad/the-versatility-of-the-grammar-of-graphics-d1366760424d)

[How to Build Interactive Charts in Flutter](https://medium.com/@entronad/how-to-build-interactive-charts-in-flutter-e317492d5ba1)

## Reference

Besides *The Grammar of Graphics*, the API terminology also referes to [AntV](https://antv.vision/en) and [Vega](https://vega.github.io/). The dataflow structure is inspired by [Vega](https://vega.github.io/).
Expand Down
3 changes: 2 additions & 1 deletion example/lib/pages/line_area_point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class LineAreaPointPage extends StatelessWidget {
variables: {
'date': Variable(
accessor: (Map map) => map['date'] as String,
scale: OrdinalScale(tickCount: 5),
scale: OrdinalScale(tickCount: 5, inflate: true),
),
'points': Variable(
accessor: (Map map) => map['points'] as num,
Expand All @@ -230,6 +230,7 @@ class LineAreaPointPage extends StatelessWidget {
accessor: (Map map) => map['name'] as String,
),
},
coord: RectCoord(horizontalRange: [0.01, 0.99]),
elements: [
LineElement(
position:
Expand Down
1 change: 1 addition & 0 deletions lib/src/guide/interaction/crosshair.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class CrosshairRenderOp extends Render<CrosshairScene> {
}
return Offset.zero;
}

for (var index in selects) {
selectedPoint += findPoint(index);
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/guide/interaction/tooltip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ class TooltipRenderOp extends Render<TooltipScene> {
}
return Offset.zero;
}

for (var index in selects) {
selectedPoint += findPoint(index);
}
Expand Down
11 changes: 5 additions & 6 deletions lib/src/interaction/selection/selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,11 @@ class SelectorRenderOp extends Render<SelectorScene> {
final selector = selectors?[name];

if (selector is IntervalSelector) {
scene
.figures = renderIntervalSelector(
selector.points.first,
selector.points.last,
selector.color,
);
scene.figures = renderIntervalSelector(
selector.points.first,
selector.points.last,
selector.color,
);
} else {
// The point selector has no mark for now.

Expand Down
3 changes: 2 additions & 1 deletion lib/src/parse/parse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ import 'package:graphic/src/variable/transform/sort.dart';
import 'package:graphic/src/variable/variable.dart';

/// The default padding function for rectangle coordinate.
EdgeInsets _defaultRectPadding(Size _) => const EdgeInsets.fromLTRB(40, 5, 10, 20);
EdgeInsets _defaultRectPadding(Size _) =>
const EdgeInsets.fromLTRB(40, 5, 10, 20);

/// The default padding function for polar coordinate.
EdgeInsets _defaultPolarPadding(Size _) => const EdgeInsets.all(10);
Expand Down
5 changes: 3 additions & 2 deletions lib/src/scale/time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ class TimeScaleConv extends ContinuousScaleConv<DateTime> {
}

// If all data are the same, the range is 1 second.
final range =
maxTmp == minTmp ? const Duration(seconds: 1) : maxTmp.difference(minTmp);
final range = maxTmp == minTmp
? const Duration(seconds: 1)
: maxTmp.difference(minTmp);
final marginMin = range * (spec.marginMin ?? 0.1);
final marginMax = range * (spec.marginMax ?? 0.1);
min = min ?? minTmp.subtract(marginMin);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: graphic
description: A grammar of data visualization and Flutter charting library.
version: 0.10.7
version: 1.0.0
homepage: https://github.com/entronad/graphic

environment:
Expand Down

0 comments on commit 17c95ae

Please sign in to comment.