New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

datag-graph

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datag-graph

dataq-component 模板

  • 0.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by14.29%
Maintainers
1
Weekly downloads
 
Created
Source

DataG-Graph

前端图形渲染组件

特性

  • 自定义节点渲染样式
  • 网状节点渲染
  • 节点事件响应
  • 小地图
  • 自动布局
    • 力导向布局
    • 环形布局
    • 重力布局

例子

  • React:参见目录下 example
  • Vue: 参见目录下 vue-example

Props

属性名属性类型默认值说明
dataIData{}定义往下看
layoutObject{type: 'concentric'}布局类型参见下方表格
minimapBooleantrue是否打开小地图
dragbleBooleantrue节点是否可拖拽
moveableBooleantrue画布是否可移动
onNodeClickFunctionnoop节点点击函数
onCanvasClickFunctionnoop画布点击函数
onEdgeClickFunctionnoop边点击函数
onNodeDragFunctionnoop节点拖动函数
graphRefObject{ updateItem: (item, cfg) => {} }graph实例引用
minimapTopRightObject{ top: 0, right: 0 }控制小地图的位置
didMountFunction获取Graph内部的graph用来操作node节点与edges线条的样式
themeObject设置主题 https://graphin.antv.vision/graphin/render/theme
    // 数据类型
    interface IData {
        nodes: {
            id: string;         // 节点ID
            label: string;      // 节点文字
            type: string;       // 节点类型: graphin-circle(圆形) 
            style: IStyle       // graphin-circle(原型) rect(方形)
        }[],
        edges: {
            target: string;     // 目标节点ID
            source: string;     // 源节点ID
            style: IStyle       // 边类型
        }[]
    }

    interface IStyle {
        keyshape: {
            stroke: string; // 边颜色
            fill: string;   // 填充颜色
        },
        label: {
            value: string;  // 文字内容
            stroke: string; // 文字颜色
        }
    }

布局取值

取值含义其他
concentric同心圆布局
graphin-force重力布局
radial辐射布局
dagre分层布局
circular环形布局

开发

$ make install && npm start # 这个命令帮助启动 vite

构建

$  npm run build

FAQs

Package last updated on 14 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc