• Stars
    star
    213
  • Rank 185,410 (Top 4 %)
  • Language
    C++
  • License
    MIT License
  • Created about 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📱📈An elegant, interactive and flexible native charting library for mobile.

English README

F2Native,专注于移动 Native 可视化开发,开箱即用的跨平台高性能的可视化解决方案。完美支持 Android, iOS, 和MacOS 平台,并在中低端机型具备高性能体验。完备的图形语法理论,满足你的各种可视化需求。专业的移动设计指引为你带来最佳的移动端图表体验。

在此衷心感谢《The Grammar of Graphics》的作者 Leland Wilkinson,为 F2 的图形语法提供了理论基础!

特性

专注客户端,极致体验

F2Native 支持 Android,iOS,MacOS 平台。使用跨平台语言 C++ 来生成底层绘制指令, 可以做到 跨平台,多端体验统一,高性能体验。在 Android 和 iOS 端打包后占 APK 和 IPA 大小分别为 250KB, 500KB.

轻量化植入,自然呈现

在设计上我们以人为本,追求自然简单易懂。可视化展现和人的自然行为特征有机融合,使图表展示更为自然,并且引入灵活、成本低。

图表丰富,组件完备

与传统的图表库不同,抛弃了特图特做的封装思路,基于强大的图形语法理论,以数据驱动,通过图形语法的组合灵活构建各类图表,覆盖各类场景在提供基础的图表可视化能力外,我们还提供了丰富图表功能组件,满足各种功能需求。

文档

Demos

图表实例

快速开始

iOS

CocoaPod设置

pod 'F2'

Objective-C

#import <F2/F2.h>
@interface F2Demo : UIView
@property (nonatomic, strong) F2CanvasView *canvasView;
@end
@implementation  F2Demo
-(NSString *)jsonData {
    return @"[
      {\"genre\":\"Sports\",\"sold\":275},
      {\"genre\":\"Strategy\",\"sold\":115},
      {\"genre\":\"Action\",\"sold\":120},
      {\"genre\":\"Shooter\",\"sold\":350},
      {\"genre\":\"Other\",\"sold\":150}]";
}
- (void)chartRender {
    self.chart.canvas(self.canvasView);
    self.chart.padding(10, 20, 10, 0.f);
    self.chart.source([self jsonData]);
    self.chart.interval().position(@"genre*sold").color(@"genre", @[]);
    self.chart.scale(@"sold", @{@"min": @(0)});
    self.chart.scale(@"genre", @{@"range": @[@(0.1), @(0.9)]});
    self.chart.render();
}

Swift

func chartRender() {
    self.chart!.canvas()(self.canvasView!)
    self.chart!.padding()(10, 20, 10, 0)
    self.chart!.source()(jsonData)
    self.chart!.interval()().position()("genre*sold").color()("genre", [])
    self.chart!.scale()("sold", ["min":0])
    self.chart!.scale()("genre", ["range": [0.1, 0.9]])
    self.chart!.render()();
}

Android

Gradle设置

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
      implementation 'com.github.antvis:F2Native:latest.release'
}

XML

<com.antgroup.antv.f2.F2CanvasView
    android:id="@+id/canvasView"
    android:layout_width="match_parent"
    android:layout_height="220dp"/>

Java

F2CanvasView canvasView = findViewById(R.id.canvasView);
canvasView.initCanvasContext();

canvasView.setAdapter(new F2CanvasView.Adapter() {
    private F2Chart mChart;
    @Override
    public void onCanvasDraw(F2CanvasView canvasView) {
       if (mChart == null) {
            mChart = F2Chart.create(canvasView.getContext(), "SingleIntervalChart_2", canvasView.getWidth(), canvasView.getHeight());
        }
        mChart.setCanvas(canvasView);
        mChart.padding(20, 10, 10, 10);
        mChart.source(Utils.loadAssetFile(canvasView.getContext(), "mockData_singleIntervalChart_2.json"));
        mChart.interval().position("genre*sold").color("genre");
        mChart.setScale("sold", new F2Chart.ScaleConfigBuilder().min(0));
        mChart.setScale("genre", new F2Chart.ScaleConfigBuilder().range(new double[]{0.1, 0.9}));
        mChart.render();
    }

    @Override
    public void onDestroy() {
        if (mChart != null) {
            mChart.destroy();
        }
    }
});

Kotlin

mCanvasView = findViewById(R.id.canvasView)
mCanvasView!!.initCanvasContext()

private var mChart: F2Chart? = null
    override fun onCanvasDraw(canvasView: F2CanvasView) {
        if (mChart == null) {
            mChart = F2Chart.create(
                canvasView.context,
                "SingleIntervalChart_2",
                canvasView.width.toDouble(),
                canvasView.height.toDouble()
            )
        }
        mChart!!.setCanvas(canvasView)
        mChart!!.padding(20.0, 10.0, 10.0, 10.0)
        mChart!!.source(loadAssetFile(canvasView.context, "mockData_singleIntervalChart_2.json"))
        mChart!!.interval().position("genre*sold").color("genre")
        mChart!!.setScale("sold", ScaleConfigBuilder().min(0.0))
        mChart!!.setScale("genre", ScaleConfigBuilder().range(doubleArrayOf(0.1, 0.9)))
        mChart!!.legend(
            "genre",
            LegendConfigBuild().enable(true).position("top").symbol("circle").setOption("radius", 3)
        )
        mChart!!.render()
    }

    override fun onDestroy() {
        if (mChart != null) {
            mChart!!.destroy()
        }
    }

联系我们

如何贡献

如果您在使用的过程中碰到问题,可以先通过 issues 看看有没有类似的 bug 或者建议。

如需提交代码,请遵从我们的贡献指南

License

MIT license

More Repositories

1

G2

📊 The concise and progressive visualization grammar.
TypeScript
12,061
star
2

G6

♾ A Graph Visualization Framework in JavaScript.
TypeScript
10,958
star
3

F2

📱📈An elegant, interactive and flexible charting library for mobile.
JavaScript
7,884
star
4

X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
TypeScript
5,703
star
5

L7

🌎 Large-scale WebGL-powered Geospatial Data Visualization analysis engine.
TypeScript
3,594
star
6

G2Plot

🍡 An interactive and responsive charting library based on G2.
TypeScript
2,539
star
7

S2

⚡️ A practical visualization library for tabular analysis.
TypeScript
1,470
star
8

AVA

🤖 A framework for automated visual analytics.
TypeScript
1,333
star
9

wx-f2

F2 的微信小程序
JavaScript
1,276
star
10

G

💥 A flexible rendering engine for visualization.
TypeScript
1,046
star
11

Graphin

🌌 A React toolkit for graph visualization based on G6.
TypeScript
1,002
star
12

G6VP

G6VP is an online visual analysis tool for graphs and a low-code platform for building graph applications.
TypeScript
812
star
13

XFlow

React component for building interactive diagrams.
TypeScript
588
star
14

g6-editor

JavaScript
533
star
15

antvis.github.io

🔜 AntV 新站点!
TypeScript
410
star
16

g2-react

This repo is being deprecated, check Ant Design Charts https://github.com/ant-design/ant-design-charts
JavaScript
363
star
17

gatsby-theme-antv

⚛️ Polished Gatsby theme for documentation site
TypeScript
345
star
18

hierarchy

Layout algorithms for visualizing hierarchical data.
JavaScript
249
star
19

data-set

state driven all in one data process for data visualization.
TypeScript
249
star
20

layout

Layout algorithms for graphs.
TypeScript
200
star
21

L7VP

L7VP is an geospatial intelligent visual analysis and application development tools.
TypeScript
189
star
22

my-f2

F2 的支付宝小程序版本
JavaScript
145
star
23

g-webgl-compute

A GPGPU implementation based on WebGL.
TypeScript
143
star
24

F6

F6 is a graph visualization engine which provides quick and smooth operations on mobile devices.
JavaScript
133
star
25

f2-canvas

微信小程序 F2 自定义图表组件
JavaScript
118
star
26

algorithm

常用的图算法 JS 实现,提供给 G6 及 Graphin 用于图分析场景使用。
TypeScript
99
star
27

china-geojson

This repo is being deprecated.
96
star
28

SAMJS

TypeScript
94
star
29

L7Plot

🌍 Geospatial Visualization Chart Library
TypeScript
83
star
30

util

utility library for AntV products.
TypeScript
74
star
31

LarkMap

A React toolkit for geospatial visualization based on L7.
TypeScript
71
star
32

mini-program-f2-demos

支付宝小程序小程序端的 F2 图表 demo
JavaScript
69
star
33

component

🍱 AntV UI component based on G render engine.
TypeScript
58
star
34

scale

📦 Toolkit for mapping abstract data into visual representation.
TypeScript
56
star
35

awesome-f2-charts

F2 图表可视化方案精选
HTML
46
star
36

L7Draw

L7 绘制控件
TypeScript
44
star
37

coord

Toolkit for apply point transformations for vector.
TypeScript
41
star
38

GUI

UI components for G. Merge to @antvis/component.
TypeScript
40
star
39

vis-dashboard

🎨 Awesome dashboards, built with G2 and G2Plot.
TypeScript
40
star
40

gatsby-starter-theme-antv

⚛️ Gatsby's starter of 👉
TypeScript
35
star
41

L7Editor

Geographic data editing tool based on L7
TypeScript
35
star
42

theme-set

💄 Customize theme for G2, G2Plot of AntV(孵化中)
TypeScript
35
star
43

FEngine

TypeScript
31
star
44

Dipper

下一代位置可视分析研发框架
TypeScript
28
star
45

smart-color

A JavaScript library for color computation.
TypeScript
27
star
46

g2-brush

Select a one-, two-dimensional or irregular region using the mouse.
JavaScript
24
star
47

L7-react

L7 React 版
TypeScript
23
star
48

f2-context

F2针对多端的context适配
TypeScript
22
star
49

A8

🎼 A library for audio visualization.
TypeScript
22
star
50

g2-plugin-slider

A datazoom slider plugin for G2.
JavaScript
20
star
51

dumi-theme-antv

AntV website theme based on dumi2.
TypeScript
20
star
52

L7-Leaflet

L7 leaflet 插件
19
star
53

event-emitter

Simple event emitter for @antvis
TypeScript
19
star
54

L7-boundary

行政区划围栏可视化方案
TypeScript
16
star
55

DipperMap

A tool supporting geo data visualization
TypeScript
16
star
56

vis-predict-engine

可视化预测引擎,目前只用于预测图可视化布局.布局预测的模型由本引擎内置,支持force/radial/concentric/circular的四布局分类
TypeScript
14
star
57

graphlib

A lib containing multible usages for graph structure, graph algorithm, and other graph ops.
TypeScript
13
star
58

attr

Attribute mapping module for @antvis.
TypeScript
12
star
59

antv-spec

A declarative grammar that supports various technology stacks of AntV.
TypeScript
12
star
60

geo-coord

地理坐标系
TypeScript
11
star
61

g-device-api

A Device API references WebGPU implementations
TypeScript
9
star
62

my-f2-pc

淘宝PC小程序
JavaScript
8
star
63

L7Gallery

L7 demo 案例集锦
8
star
64

stat

常用统计函数的实现
TypeScript
8
star
65

interaction

interaction bindings for G2 and F2
TypeScript
7
star
66

infinite-canvas-tutorial

An infinite canvas tutorial
TypeScript
7
star
67

g2-extensions

The one-stop shop for official @antv/g2 extensions.
TypeScript
6
star
68

adjust

Adjust module for @antvis.
TypeScript
5
star
69

graphin-studio-site

Github Page Repo for Graphin Studio
HTML
5
star
70

L7-CustomLayer-Template

TypeScript
5
star
71

g2plot-schema

Schemas of configs(options) of G2Plot chart types.
TypeScript
4
star
72

template

📃 Template repository for @antvis.
JavaScript
4
star
73

old-site

AntV 旧版本站点
HTML
4
star
74

vis-steg

Visualization Steganography: conceal information within visualization images.
TypeScript
4
star
75

AVAPy

Python Library for Automatic Visual Analytics
Python
4
star
76

g-gesture

WIP: Gesture module for @antv/g.
TypeScript
4
star
77

insight-component

Components for GI&LI
TypeScript
3
star
78

antvis-sites-data

🔢 Headless CMS data for https://antv.vision
3
star
79

g2-next-site

JavaScript
3
star
80

chart-node-g6

the Toolkit for G6 chart type nodes
TypeScript
3
star
81

color-schema

A JSON schema used to regulate semantic color assets or palettes.
TypeScript
3
star
82

autochart-config-panel

GUI config panel for the autoChart feature of AntV/AVA.
TypeScript
3
star
83

data-samples

Open data set collection for AntV products
TypeScript
3
star
84

l7-extensions

🧩 A collection of extensions for L7.
TypeScript
3
star
85

F7

L7小程序版本,支持支付宝、微信等多端小程序。
TypeScript
2
star
86

async-hook

the control flow for l7
TypeScript
2
star
87

create-antv-demo

A simple CV-dashboard framework for practicing how to use AntV.
JavaScript
2
star
88

g2-3.x-site

The site of G2 3.x version
HTML
2
star
89

thumbnails

Thumbnail images for different chart types from Chart Knowledge Base.
TypeScript
2
star
90

g6-3.2.x-site

The site for G6 3.2.x
HTML
2
star
91

gi-export

TypeScript
2
star
92

g2plot-1.x-site

The site of G2Plot 1.x version.
HTML
1
star
93

storytelling

Telling story by data visualization.
TypeScript
1
star
94

translator

A translator based on Google Translate.
JavaScript
1
star