1 Star 0 Fork 0

openwayne / F6

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 6.29 KB
一键复制 编辑 原始数据 按行查看 历史
openwayne 提交于 2021-06-02 19:24 . fix: improve docs

F6: A Mobile Graph Visualization Framework in TypeScript.

travis-ci codecov typescript MIT npm package NPM downloads Percentage of issues still open

中文 README

What is F6

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.

Powerful Animation and Interactions

Powerful Layouts

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

$ npm install @antv/f6

Usage

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) {
    console.log(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);
  },
});

For more information of the usage, please refer to Getting Started.

Development

$ npm install

# lerna bootstrap for multiple packages
$ npm run bootstrap

# build the packages
$ npm run build:all

# if you wanna watch one of the packages, e.g. packages/core
$ cd ./packages/core
$ npm run watch

# run test case
$ npm test

# run test case in watch mode
npm test -- --watch ./tests/unit/algorithm/find-path-spec
DEBUG_MODE=1 npm test -- --watch ./tests/unit/algorithm/find-path-spec

Documents

F6 Communication Group

Welcome to join the F6 Communication Group (DingTalk groups). We also welcome the github issues.

How to Contribute

Please let us know what you are you going to help. Do check out issues for bug reports or suggestions first.

To become a contributor, please follow our contributing guide.

License

MIT license.

1
https://gitee.com/openwayne/F6.git
git@gitee.com:openwayne/F6.git
openwayne
F6
F6
master

搜索帮助