# F6 **Repository Path**: antv/F6 ## Basic Information - **Project Name**: F6 - **Description**: F6是一款可以快速、流畅运行于移动设备中的图可视化引擎,通过丰富的布局、组件及分析能力,帮助用户落地跨平台的图可视化应用解决方案。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: http://f6.antv.vision/ - **GVP Project**: No ## Statistics - **Stars**: 56 - **Forks**: 12 - **Created**: 2021-06-10 - **Last Updated**: 2026-01-06 ## Categories & Tags **Categories**: charting-components **Tags**: 图可视化, 小程序, 移动端 ## README # F6: A Mobile Graph Visualization Framework in TypeScript. ![](https://gw.alipayobjects.com/mdn/rms_5c3b4a/afts/img/A*KV1pSIPeJPAAAAAAAAAAAAAAARQnAQ) ![typescript](https://img.shields.io/badge/language-typescript-red.svg) ![MIT](https://img.shields.io/badge/license-MIT-000000.svg) [![npm package](https://img.shields.io/npm/v/@antv/f6.svg)](https://www.npmjs.com/package/@antv/f6) [![NPM downloads](http://img.shields.io/npm/dm/@antv/f6.svg)](https://npmjs.org/package/@antv/f6) [![Percentage of issues still open](http://isitmaintained.com/badge/open/antvis/f6.svg)](http://isitmaintained.com/project/antvis/f6 "Percentage of issues still open") English | [简体中文](./README-zh-CN.md) ## What is F6 [F6](https://github.com/antvis/f6) is a mobile graph visualization engine, which provides a set of basic mechanisms, including rendering, layout, analysis, interaction, animation, and other auxiliary tools. F6 aims to simplify the relationships, and help people to obtain the insight of relational data. Developers are able to build graph visualization **analysis** applications or graph visualization **modeling** applications easily. ![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*cDzXR4jIWr8AAAAAAAAAAABkARQnAQ) > Powerful Animation and Interactions ## Features - Abundant Built-in Items: Nodes and edges with free configurations; - Steerable Interactions: More than 10 basic interaction behaviors ; - Powerful Layout: More than 10 layout algorithms; - Convenient Components: Outstanding ability and performance; - Friendly User Experience: Complete documents for different levels of user requirements. TypeScript supported. F6 concentrates on the principle of 'good by default'. In addition, the custom mechanism of the item, interation behavior, and layout satisfies the customazation requirements. > Abundant Built-in Items ## Installation ```bash $ npm install @antv/f6 ``` ## Usage - demo ```js import F6 from "@antv/f6"; import graphData from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; F6.registerLayout("dagreLayout", dagreLayout); F6.registerGraph("TreeGraph", TreeGraph); Page({ data: { width: 300, height: 400, pixelRatio: 1, }, onLoad() { const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio: pixelRatio, }); }, onCanvasInit(ctx, rect, canvas, renderer) { this.graph = new F6.TreeGraph({ context: ctx, renderer, width: this.data.width, height: this.data.height, linkCenter: true, modes: { default: ["drag-canvas", "zoom-canvas"], }, defaultNode: { size: 40, }, layout: { type: "compactBox", direction: "RL", getId: function getId(d) { return d.id; }, getHeight: () => { return 26; }, getWidth: () => { return 26; }, getVGap: () => { return 20; }, getHGap: () => { return 30; }, radial: false, }, }); this.graph.node(function (node) { return { label: node.id, }; }); this.graph.data(graphData); this.graph.render(); this.graph.fitView(); }, onTouch(e) { this.graph.emitEvent(e); }, onUnload() { this.graph?.destroy(); }, }); ``` For more information of the usage, please refer to [Getting Started](https://antv-f6.gitee.io/en/docs/manual/getting-started). ## Development ```bash $ npm install -g @microsoft/rush # update dependencies $ rush update # build the packages $ rush build # demo $ cd packages/f6 && rushx storybook ``` ## Documents - Tutorial - Middle Guides - Further Reading - API Reference ## How to Contribute Please let us know what you are you going to help. Do check out [issues](https://github.com/antvis/f6/issues) for bug reports or suggestions first. To become a contributor, please follow our [contributing guide](https://github.com/antvis/f6/blob/master/packages/f6/CONTRIBUTING.md). ## License [MIT license](./LICENSE).