@antv/f2
A canvas library which providing 2d draw for G2.
Last updated 7 years ago by simaq .
Repository · Bugs · Original npm · Tarball · package.json
$ npm install @antv/f2 
SYNC missed versions from official npm registry.

npm package NPM downloads Percentage of issues still open

中文 README

F2 is born for mobile, developed for developers as well as designers. It is Html5 Canvas-based, and is also compatible with Node.js, Weex and React Native. Based on the grammar of graphics, F2 provides all the chart types you'll need. Our mobile design guidelines enable better user experience in mobile visualzation projects.

Special thanks to Leland Wilkinson, the author of The Grammar Of Graphics, whose book served as the foundation for F2 and G2.

Installation

$ npm install @antv/f2

Features

Born for mobile

  • Design for mobile: make data more alive and chart interactions more natural.

  • Performance: small package size(version without interaction is 44k after gzip) with great rendering performance.

  • Compatibility: multi-end, Multi-runtime support. Besides H5 env, F2 can also run in Node.js, Weex rendering and React Native, also 支付宝小程序 and 微信小程序.

All the chart types you want

With the power of grammar of graphics, F2 supports data-driven 50+ chart types(the amount can be even more, which is depended on you) including classical charts such as line, column/bar chart, pie chart, scatter plot, gauges, etc. Additionally, F2 also provides feature-riched chart components, such as Tooltip, Legend and Guide.

Flexible and Interactive

We also provide developers with flexible extension mechanisms, including shape, animation, and interactive customization capabilities, as well as flexible styling to meet a variety of personalized charting requirements.

Links

Other libraries base on F2

  • ant-design-mobile-chart: Ant Design Mobile Chart based on F2. (React).
  • BizGoblin:Data visualization library based F2 and React.
  • VChart: Mobile Chart Components based on vux and F2. (Vue).
  • weex-chart: Chart components based on Weex and F2.

Demos

Chart Demos

Or just scan the below qrcode to see demos in mobile:

Getting Started

<canvas id="mountNode"></canvas>
// F2 对数据源格式的要求,仅仅是 JSON 数组,数组的每个元素是一个标准 JSON 对象。
const data = [
  { genre: 'Sports', sold: 275 },
  { genre: 'Strategy', sold: 115 },
  { genre: 'Action', sold: 120 },
  { genre: 'Shooter', sold: 350 },
  { genre: 'Other', sold: 150 },
];

// 获取 canvas context
const context = document.getElementById('mountNode').getContext('2d');
const { props } = (
  <Canvas context={context} pixelRatio={window.devicePixelRatio}>
    <Chart data={data}>
      <Axis field="genre" />
      <Axis field="sold" />
      <Interval x="genre" y="sold" color="genre" />
      <Tooltip />
    </Chart>
  </Canvas>
);

const canvas = new Canvas(props);
await canvas.render();

Development

$ npm install

# setup
$ npm run bootstrap

# run test case
$ npm run test-watch

How to Contribute

Please let us know how can we help. Do check out issues for bug reports or suggestions first.

To become a contributor, please follow our contributing guide.

Experience Improvement Program Description

Since version 3.1.12 (released on 2018-06-20), we add F2.track(true) method for our user experience improvement program. But now the program has finish, so we remove the method from F2 since version 3.3.4. We are very sorry if it has caused trouble for you.

License

MIT license.

Current Tags

  • 5.0.0-beta.12                                ...           beta (2 years ago)
  • 5.0.0-beta.12                                ...           canary (2 years ago)
  • 5.5.2                                ...           latest (5 months ago)
  • 5.0.34                                ...           next (a year ago)

329 Versions

  • 5.5.2                                ...           5 months ago
  • 5.5.1                                ...           6 months ago
  • 5.5.0                                ...           7 months ago
  • 5.4.5                                ...           9 months ago
  • 5.4.4                                ...           9 months ago
  • 5.4.3                                ...           9 months ago
  • 5.4.2                                ...           9 months ago
  • 5.4.1                                ...           10 months ago
  • 5.4.0                                ...           10 months ago
  • 5.3.0                                ...           10 months ago
  • 5.2.2                                ...           a year ago
  • 5.2.1                                ...           a year ago
  • 5.2.0                                ...           a year ago
  • 5.1.0                                ...           a year ago
  • 5.0.39                                ...           a year ago
  • 5.0.38                                ...           a year ago
  • 5.0.37                                ...           a year ago
  • 5.0.36                                ...           a year ago
  • 5.0.35                                ...           a year ago
  • 5.0.34                                ...           a year ago
  • 4.0.51                                ...           a year ago
  • 5.0.33                                ...           a year ago
  • 4.0.50                                ...           a year ago
  • 4.0.49                                ...           a year ago
  • 5.0.32                                ...           a year ago
  • 4.0.48                                ...           a year ago
  • 5.0.31                                ...           a year ago
  • 4.0.47                                ...           a year ago
  • 5.0.30                                ...           a year ago
  • 5.0.29                                ...           a year ago
  • 5.0.28                                ...           a year ago
  • 5.0.27                                ...           a year ago
  • 5.0.26                                ...           2 years ago
  • 5.0.25                                ...           2 years ago
  • 4.0.46                                ...           2 years ago
  • 4.0.45                                ...           2 years ago
  • 5.0.24                                ...           2 years ago
  • 5.0.23                                ...           2 years ago
  • 5.0.22                                ...           2 years ago
  • 4.0.44                                ...           2 years ago
  • 4.0.43                                ...           2 years ago
  • 5.0.21                                ...           2 years ago
  • 4.0.42                                ...           2 years ago
  • 5.0.20                                ...           2 years ago
  • 5.0.19                                ...           2 years ago
  • 5.0.18                                ...           2 years ago
  • 5.0.17                                ...           2 years ago
  • 5.0.16                                ...           2 years ago
  • 5.0.16-alpha.7                                ...           2 years ago
  • 5.0.15                                ...           2 years ago
  • 4.0.41                                ...           2 years ago
  • 4.0.40                                ...           2 years ago
  • 5.0.14                                ...           2 years ago
  • 5.0.13                                ...           2 years ago
  • 4.0.39                                ...           2 years ago
  • 5.0.12                                ...           2 years ago
  • 5.0.11                                ...           2 years ago
  • 5.0.10                                ...           2 years ago
  • 5.0.9                                ...           2 years ago
  • 3.8.13                                ...           2 years ago
  • 5.0.8                                ...           2 years ago
  • 5.0.7                                ...           2 years ago
  • 5.0.6                                ...           2 years ago
  • 3.8.12                                ...           2 years ago
  • 5.0.5                                ...           2 years ago
  • 5.0.4                                ...           2 years ago
  • 4.0.38                                ...           2 years ago
  • 5.0.4-beta.0                                ...           2 years ago
  • 5.0.3-beta.0                                ...           2 years ago
  • 5.0.2-beta.0                                ...           2 years ago
  • 5.0.0-beta.12                                ...           2 years ago
  • 4.0.37                                ...           2 years ago
  • 4.0.36                                ...           2 years ago
  • 4.0.35                                ...           2 years ago
  • 4.0.34                                ...           2 years ago
  • 4.0.33                                ...           2 years ago
  • 4.0.32                                ...           2 years ago
  • 4.0.31                                ...           2 years ago
  • 4.0.30                                ...           2 years ago
  • 4.0.29                                ...           2 years ago
  • 4.0.29-beta.5                                ...           2 years ago
  • 4.0.29-beta.16                                ...           2 years ago
  • 4.0.28                                ...           2 years ago
  • 4.0.27-beta.9                                ...           2 years ago
  • 4.0.27                                ...           2 years ago
  • 4.0.26                                ...           2 years ago
  • 5.0.0-alpha.1                                ...           2 years ago
  • 4.0.25                                ...           3 years ago
  • 4.0.24                                ...           3 years ago
  • 4.0.23                                ...           3 years ago
  • 4.0.22                                ...           3 years ago
  • 4.0.21                                ...           3 years ago
  • 4.0.20                                ...           3 years ago
  • 4.0.19                                ...           3 years ago
  • 4.0.18                                ...           3 years ago
  • 4.0.17                                ...           3 years ago
  • 4.0.16                                ...           3 years ago
  • 3.8.11                                ...           3 years ago
  • 4.0.15                                ...           3 years ago
  • 4.0.14                                ...           3 years ago
  • 4.0.13                                ...           3 years ago
  • 4.0.12                                ...           3 years ago
  • 4.0.11                                ...           3 years ago
  • 4.0.10                                ...           3 years ago
  • 4.0.9                                ...           3 years ago
  • 4.0.8                                ...           3 years ago
  • 4.0.7                                ...           3 years ago
  • 4.0.6                                ...           3 years ago
  • 4.0.5                                ...           3 years ago
  • 4.0.4                                ...           3 years ago
  • 3.8.10                                ...           3 years ago
  • 4.0.3                                ...           3 years ago
  • 4.0.2                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 4.0.0-alpha.9                                ...           3 years ago
  • 4.0.0-alpha.8                                ...           3 years ago
  • 4.0.0-alpha.7                                ...           3 years ago
  • 4.0.0-alpha.6                                ...           3 years ago
  • 4.0.0-alpha.5                                ...           3 years ago
  • 4.0.0-alpha.4                                ...           3 years ago
  • 4.0.0-alpha.3                                ...           3 years ago
  • 4.0.0-alpha.2                                ...           3 years ago
  • 4.0.0-alpha.1                                ...           3 years ago
  • 3.8.10-beta.1                                ...           3 years ago
  • 3.8.9                                ...           4 years ago
  • 3.8.8                                ...           4 years ago
  • 3.8.7                                ...           4 years ago
  • 3.8.6                                ...           4 years ago
  • 3.8.5                                ...           4 years ago
  • 3.8.4                                ...           4 years ago
  • 3.8.3                                ...           4 years ago
  • 3.8.2                                ...           4 years ago
  • 3.8.1                                ...           4 years ago
  • 3.8.0                                ...           4 years ago
  • 3.8.0-alpha.2                                ...           4 years ago
  • 3.8.0-alpha.1                                ...           4 years ago
  • 3.7.8                                ...           4 years ago
  • 3.7.7                                ...           4 years ago
  • 3.7.6                                ...           4 years ago
  • 3.7.5                                ...           4 years ago
  • 3.7.4                                ...           4 years ago
  • 3.7.3                                ...           4 years ago
  • 3.7.2                                ...           4 years ago
  • 3.7.1                                ...           4 years ago
  • 3.7.1-beta.2                                ...           4 years ago
  • 3.7.1-beta.1                                ...           4 years ago
  • 3.7.0                                ...           4 years ago
  • 3.7.0-alpha.7                                ...           4 years ago
  • 3.7.0-alpha.6                                ...           4 years ago
  • 3.7.0-alpha.5                                ...           4 years ago
  • 3.6.4                                ...           4 years ago
  • 3.7.0-alpha.4                                ...           4 years ago
  • 3.7.0-alpha.3                                ...           4 years ago
  • 3.6.4-beta.8                                ...           5 years ago
  • 3.6.4-beta.7                                ...           5 years ago
  • 3.7.0-alpha.2                                ...           5 years ago
  • 3.6.4-beta.6                                ...           5 years ago
  • 3.6.4-beta.5                                ...           5 years ago
  • 3.7.0-alpha.1                                ...           5 years ago
  • 3.7.0-alpha.0                                ...           5 years ago
  • 3.6.4-beta.4                                ...           5 years ago
  • 3.6.4-beta.3                                ...           5 years ago
  • 3.6.4-beta.2                                ...           5 years ago
  • 3.6.4-beta.1                                ...           5 years ago
  • 3.6.3                                ...           5 years ago
  • 3.6.2                                ...           5 years ago
  • 3.6.1                                ...           5 years ago
  • 3.6.0                                ...           5 years ago
  • 3.6.0-alpha.6                                ...           5 years ago
  • 3.6.0-alpha.5                                ...           5 years ago
  • 3.6.0-alpha.4                                ...           5 years ago
  • 3.6.0-alpha.3                                ...           5 years ago
  • 3.6.0-alpha.2                                ...           5 years ago
  • 3.6.0-alpha.1                                ...           5 years ago
  • 3.5.0                                ...           5 years ago
  • 3.5.0-beta.6                                ...           5 years ago
  • 3.5.0-beta.5                                ...           5 years ago
  • 3.5.0-beta.4                                ...           5 years ago
  • 3.5.0-beta.3                                ...           5 years ago
  • 3.5.0-beta.2                                ...           5 years ago
  • 3.5.0-beta.1                                ...           5 years ago
  • 3.5.0-beta.0                                ...           5 years ago
  • 3.4.4                                ...           5 years ago
  • 3.4.3                                ...           5 years ago
  • 3.4.2                                ...           5 years ago
  • 3.4.1                                ...           5 years ago
  • 3.4.0                                ...           5 years ago
  • 3.3.9                                ...           6 years ago
  • 3.3.8                                ...           6 years ago
  • 3.3.7                                ...           6 years ago
  • 3.3.7-beta.1                                ...           6 years ago
  • 3.3.6-beta.2                                ...           6 years ago
  • 3.3.6-beta.1                                ...           6 years ago
  • 3.3.5                                ...           6 years ago
  • 3.3.4                                ...           6 years ago
  • 3.3.3                                ...           6 years ago
  • 3.3.3-beta.1                                ...           6 years ago
  • 3.3.2                                ...           6 years ago
  • 3.3.2-beta.2                                ...           6 years ago
  • 3.3.2-beta.1                                ...           6 years ago
  • 3.3.1                                ...           6 years ago
  • 3.3.0                                ...           6 years ago
  • 3.3.0-beta.4                                ...           6 years ago
  • 3.1.22                                ...           6 years ago
  • 3.3.0-beta.3                                ...           6 years ago
  • 3.3.0-beta.2                                ...           6 years ago
  • 3.3.0-beta.1                                ...           6 years ago
  • 3.2.4                                ...           6 years ago
  • 3.2.4-beta.4                                ...           6 years ago
  • 3.2.4-beta.3                                ...           6 years ago
  • 3.2.4-beta.2                                ...           6 years ago
  • 3.2.4-beta.1                                ...           6 years ago
  • 3.2.3                                ...           6 years ago
  • 3.2.3-beta.5                                ...           6 years ago
  • 3.2.3-beta.4                                ...           6 years ago
  • 3.2.3-beta.3                                ...           6 years ago
  • 3.2.3-beta.2                                ...           6 years ago
  • 3.2.3-beta.1                                ...           6 years ago
  • 3.2.2                                ...           6 years ago
  • 3.2.2-beta.4                                ...           6 years ago
  • 3.2.2-beta.3                                ...           6 years ago
  • 3.2.2-beta.2                                ...           6 years ago
  • 3.2.2-beta.1                                ...           6 years ago
  • 3.2.1                                ...           6 years ago
  • 3.2.1-beta.3                                ...           6 years ago
  • 3.1.21                                ...           6 years ago
  • 3.2.1-beta.2                                ...           6 years ago
  • 3.2.1-beta.1                                ...           6 years ago
  • 3.2.0                                ...           6 years ago
  • 3.2.0-beta.23                                ...           6 years ago
  • 3.2.0-beta.22                                ...           6 years ago
  • 3.2.0-beta.21                                ...           6 years ago
  • 3.1.20                                ...           6 years ago
  • 3.2.0-beta.20                                ...           6 years ago
  • 3.1.19                                ...           6 years ago
  • 3.2.0-beta.19                                ...           6 years ago
  • 3.2.0-beta.18                                ...           6 years ago
  • 3.2.0-beta.17                                ...           6 years ago
  • 3.1.19-beta.1                                ...           6 years ago
  • 3.2.0-beta.16                                ...           6 years ago
  • 3.1.18                                ...           6 years ago
  • 3.2.0-beta.15                                ...           6 years ago
  • 3.2.0-beta.14                                ...           6 years ago
  • 3.2.0-beta.13                                ...           6 years ago
  • 3.2.0-beta.12                                ...           6 years ago
  • 3.1.17                                ...           6 years ago
  • 3.1.17-beta.5                                ...           6 years ago
  • 3.1.17-beta.4                                ...           6 years ago
  • 3.1.17-beta.3                                ...           6 years ago
  • 3.1.17-beta.2                                ...           6 years ago
  • 3.2.0-beta.11                                ...           6 years ago
  • 3.1.17-beta.1                                ...           6 years ago
  • 3.2.0-beta.10                                ...           6 years ago
  • 3.1.16                                ...           6 years ago
  • 3.2.0-beta.9                                ...           6 years ago
  • 3.2.0-beta.8                                ...           6 years ago
  • 3.2.0-beta.7                                ...           6 years ago
  • 3.1.15                                ...           6 years ago
  • 3.1.14                                ...           6 years ago
  • 3.1.14-beta.1                                ...           6 years ago
  • 3.2.0-beta.6                                ...           6 years ago
  • 3.1.13                                ...           6 years ago
  • 3.1.13-beta.1                                ...           6 years ago
  • 3.2.0-beta.5                                ...           7 years ago
  • 3.1.12                                ...           7 years ago
  • 3.2.0-beta.3                                ...           7 years ago
  • 3.2.0-beta.2                                ...           7 years ago
  • 3.2.0-beta.1                                ...           7 years ago
  • 3.1.10                                ...           7 years ago
  • 3.1.10-beta.3                                ...           7 years ago
  • 3.1.10-beta.2                                ...           7 years ago
  • 3.1.10-beta.1                                ...           7 years ago
  • 3.1.10-beat.1                                ...           7 years ago
  • 3.1.9                                ...           7 years ago
  • 3.1.9-beta.3                                ...           7 years ago
  • 3.1.9-beta.2                                ...           7 years ago
  • 3.1.9-beta.1                                ...           7 years ago
  • 3.1.8                                ...           7 years ago
  • 3.1.8-beta.1                                ...           7 years ago
  • 3.1.7                                ...           7 years ago
  • 3.1.6                                ...           7 years ago
  • 3.1.6-beta.3                                ...           7 years ago
  • 3.1.6-beta.2                                ...           7 years ago
  • 3.1.6-beta.1                                ...           7 years ago
  • 3.1.5                                ...           7 years ago
  • 3.1.5-beta.5                                ...           7 years ago
  • 3.1.5-beta.4                                ...           7 years ago
  • 3.1.4                                ...           7 years ago
  • 3.1.4-beta.2                                ...           7 years ago
  • 3.1.4-beta.1                                ...           7 years ago
  • 3.1.3                                ...           7 years ago
  • 3.1.3-beta.2                                ...           7 years ago
  • 3.1.3-beta.1                                ...           7 years ago
  • 3.1.2                                ...           7 years ago
  • 3.1.1                                ...           7 years ago
  • 3.1.1-beta.13                                ...           7 years ago
  • 3.1.1-beta.12                                ...           7 years ago
  • 3.1.1-beta.11                                ...           7 years ago
  • 3.1.1-beta.10                                ...           7 years ago
  • 3.1.1-beta.9                                ...           7 years ago
  • 3.1.1-beta.8                                ...           7 years ago
  • 3.1.1-beta.7                                ...           7 years ago
  • 3.1.1-beta.6                                ...           7 years ago
  • 3.1.1-beta.5                                ...           7 years ago
  • 3.1.1-beta.4                                ...           7 years ago
  • 3.1.1-beta.3                                ...           7 years ago
  • 3.1.1-beta.2                                ...           7 years ago
  • 3.1.1-beta.1                                ...           7 years ago
  • 3.1.0                                ...           7 years ago
  • 3.1.0-beta.2                                ...           7 years ago
  • 3.1.0-beta.1                                ...           7 years ago
  • 3.1.0-beta                                ...           7 years ago
  • 3.0.3                                ...           7 years ago
  • 3.0.3-beta                                ...           7 years ago
  • 3.0.2                                ...           7 years ago
  • 3.0.2-beta                                ...           7 years ago
  • 3.0.1                                ...           7 years ago
  • 3.0.1-beta.1                                ...           7 years ago
  • 3.0.1-beta                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 3.0.0-rc1.8                                ...           7 years ago
  • 3.0.0-rc1.7                                ...           7 years ago
  • 3.0.0-rc1.6                                ...           7 years ago
  • 3.0.0-rc1.5                                ...           7 years ago
  • 3.0.0-rc1.4                                ...           7 years ago
  • 3.0.0-rc1.3                                ...           7 years ago
  • 3.0.0-rc1.1                                ...           7 years ago
  • 3.0.0-rc1                                ...           7 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE