# npm - 能源流向图
**Repository Path**: ljs-plug-in/energy-flow-chart
## Basic Information
- **Project Name**: npm - 能源流向图
- **Description**: 能源流向图:树形数据表达「层级 + 流量」,适合能耗监测、资金流向等大屏
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: https://www.npmjs.com/package/energy-flow-chart
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-02-02
- **Last Updated**: 2026-11-04
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 简介
能源流向图。
# 平台兼容性
兼容主流浏览器。
# 快速开始
```
npm i energy-flow-chart -S
```
### 快速应用
###### 全局注入
```
import EnergyFlowChart from 'energy-flow-chart';
import 'energy-flow-chart/lib/energy-flow-chart.css';
Vue.use(EnergyFlowChart);
```
###### 局部注入
```
import EnergyFlowChart from 'energy-flow-chart/packages/energy-flow-chart';
export default {
name: 'App',
components: {
EnergyFlowChart
}
}
```
### 主参数
参数 | 类型| 必填项 | 默认值 | 说明
---- | ----- | ------ | ------ | :------
data | Array | √ | | 能源流向图数据,树形结构。
bg-color | String | × | #07364B | 背景颜色。
line-color | Array | × | | 流向箭头不同层级不同颜色,n层数据需传n个颜色数据集,缺省将使用默认颜色。例如:['#014EB5', '#A800FF']。
develop | Boolean | × | false | 是否展开,默认false。
###### tree数据解析:
参数 | 类型| 解释
---- | ----- | :------
id | String| 节点ID。
label | String | 节点名称。
level | Number | 节点层级。
open | Boolean | 是否展开。
dataVal1 | String | 数据1,单位与数据一体,暂支持最多两个数据(固定参数,接受的参数为:空字符串、null、undefined、键值对缺省)。
dataVal2 | String | 数据2,单位与数据一体,暂支持最多两个数据(固定参数,接受的参数为:空字符串、null、undefined、键值对缺省)。
icoUrl | String | 图标图片,如果不存在则使用默认图片(surfaceType配置的默认类型图片)。
surfaceType | String | 能源表类型,接口返回。1.电表;2.水表;3.气表;4.热表;。
children | Array | 子节点集合。
### 方法
参数 | 类型| 解释
---- | ----- | :------
energyClick | 回调函数 | Function(node) 返回节点数据对象
###### 示例
```
```
# 贡献代码
龙九山。有任何问题,请在平台留言,在手头宽裕得情况下,我会尽快修复问题。
# 创作不易,在您方便之际,赞赏作者,我们会更有动力继续下去。
