@yuntu/utils

1.0.0 • Public • Published

安装

yarn add @yuntu/utils
// or
npm install @yuntu/utils

API

通用

getStrLen(String)

获取文本的字符长度,中午占两个字符。一般用于计算文本的宽度。

randomCode(Number=8)

生成随机字符串,可传入字符长度。

safeParseJSON(String)

JSON 数据格式化。

图相关

图分析

fullPath({ nodes, edges, start, end, step, pathNum })

全路径分析

shortestPath({ edges, start, end, pathNum })

最短路径分析

getGraphByPaths({ nodes: gNodes, edges: gEdges }, paths)

根据路径获取图数据

点图形

边路径

业务处理

formatGraphData()

云图接口返回图数据格式化

formatSchema()

云图接口返回图 schema 格式化

formatProps({ value, properties })

属性值格式化,value 为具体的属性值,properties 为属性对应的 schema

Readme

Keywords

none

Package Sidebar

Install

npm i @yuntu/utils

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

145 kB

Total Files

50

Last publish

Collaborators

  • xiaofei.wang
  • ezios