|
1 |
| -**Graphic is now under a total refactoring. The prior available version code is here: [v0.3.0](https://github.com/entronad/graphic/tree/v0.3.0) .** |
| 1 | + |
2 | 2 |
|
3 |
| - |
| 3 | +# [Graphic](https://pub.dev/packages/graphic) |
4 | 4 |
|
| 5 | +Graphic is a declarative, interactive grammar of data visualization. It provides a Flutter charting library. |
5 | 6 |
|
| 7 | +- **A Grammar of Graphics**: Graphic derives from Leland Wilkinson's book *The Grammar of Graphics*, and tries to balance between theoretical beauty and practicability. It inherits most concepts, like the graphic algebra. |
| 8 | +- **Declarative and Reactive**: As is encouraged in Flutter, the chart widget of Graphic is declarative and reactive. The grammar of data visualization is implemented by a declarative specification and the chart will reevaluate automatically on widget update. |
| 9 | +- **Interactive**: With the *signal* and *selection* mechanism, the chart is highly interactive. It is easy to pop a tooltip or scale the coordinate. |
| 10 | +- **Customizable**: With the *shape* and *figure* classes, it's easy to custom your own element, tooltip, annotation, etc. |
| 11 | +- **Dataflow Graph and Operators**: Graphic has a internal structure of a dataflow graph and operators. That is how the reactive reevaluation and interaction is implemented. |
6 | 12 |
|
7 |
| -*A Flutter data visualization library based on Grammar of Graphics.* |
| 13 | +## Installation |
8 | 14 |
|
| 15 | +Install from the [pub.dev](https://pub.dev/packages/graphic/install). |
9 | 16 |
|
| 17 | +## Documentation |
10 | 18 |
|
11 |
| -# Usage |
| 19 | +See in the [documentation](https://pub.dev/documentation/graphic/latest/graphic/graphic-library.html) written in dart-doc. |
12 | 20 |
|
13 |
| -**Installing** |
| 21 | +## Examples |
14 | 22 |
|
15 |
| -[pub.dev](https://pub.dev/packages/graphic/install) |
| 23 | +Example of charts can be seen in the [Example App](https://github.com/entronad/graphic/tree/main/example). |
16 | 24 |
|
17 |
| -**Basic example** |
| 25 | +## Reference |
18 | 26 |
|
19 |
| -```dart |
20 |
| -graphic.Chart( |
21 |
| - data: [ |
22 |
| - { 'genre': 'Sports', 'sold': 275 }, |
23 |
| - { 'genre': 'Strategy', 'sold': 115 }, |
24 |
| - { 'genre': 'Action', 'sold': 120 }, |
25 |
| - { 'genre': 'Shooter', 'sold': 350 }, |
26 |
| - { 'genre': 'Other', 'sold': 150 }, |
27 |
| - ], |
28 |
| - scales: { |
29 |
| - 'genre': graphic.CatScale( |
30 |
| - accessor: (map) => map['genre'] as String, |
31 |
| - ), |
32 |
| - 'sold': graphic.LinearScale( |
33 |
| - accessor: (map) => map['sold'] as num, |
34 |
| - nice: true, |
35 |
| - ) |
36 |
| - }, |
37 |
| - geoms: [graphic.IntervalGeom( |
38 |
| - position: graphic.PositionAttr(field: 'genre*sold'), |
39 |
| - )], |
40 |
| - axes: { |
41 |
| - 'genre': graphic.Defaults.horizontalAxis, |
42 |
| - 'sold': graphic.Defaults.verticalAxis, |
43 |
| - }, |
44 |
| -) |
45 |
| -``` |
| 27 | +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/). |
46 | 28 |
|
47 |
| -**Document** |
| 29 | +## License |
48 | 30 |
|
49 |
| -If you have ever used data visualization libs based on Grammar of Graphics, such as [AntV](https://antv.vision/en) , [ggplot2](https://ggplot2.tidyverse.org/), you can be quite familiar with these concepts. |
| 31 | +Graphic is [MIT License](https://github.com/entronad/graphic/blob/main/LICENSE). |
| 32 | + |
| 33 | +## Keep Informed |
| 34 | + |
| 35 | +[Twitter](https://twitter.com/entronad_viz) |
| 36 | + |
| 37 | +[Medium](https://medium.com/@entronad) |
| 38 | + |
| 39 | +[Zhihu](https://www.zhihu.com/people/entronad) |
50 | 40 |
|
51 |
| -The document has not been written yet, but by referring to the [Example App](https://github.com/entronad/graphic/tree/master/example) , I believe you can be smart enough to build your charts :) |
0 commit comments