0.0.0 • Published 2 years ago

dam-phreatic-line v0.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Dam Phreatic Line

大坝浸润线横截面展示

1. 项目说明:

  • 传入大坝高度大坝迎水面宽度大坝背水面宽度大坝坝顶宽度 等四个参数来绘制大坝形状

  • 传入渗压传感器数据绘制传感器点位及渗流面

2.使用方式

  1. 初始化大坝形状
const container = document.getElementById('container');
const instance = new DamPhreaticLine(container);
instance.initialize({
  damHeight: 100,
  damLeftWidth: 200,
  damRightWidth: 300,
  damTopWidth: 50,
});
  1. 传入传感器数据
instance.addSeaLevel(100);
instance.addSensors([
  {
    name: '#001',
    value: 30,
    distance: -10,
  },
  {
    name: '#002',
    value: 20,
    distance: 10,
  },
]);

3.API

initialize

参数说明类型默认值
damHeight大坝高度(m)number-
damLeftWidth大坝迎水面宽度(m)number-
damRightWidth大坝背水面宽度(m)number-
damTopWidth大坝坝顶宽度(m)number-
seaLevel坝外水位number-

addSensor

参数说明类型默认值
name传感器名称string-
value传感器值(m)number-
distance传感器距离闸门的距离(m), 闸门位置以迎水坡和背水坡为界。number-
  • distance: 有效值为 [-damLeftWidth, +damRightWidth]。假如迎水坡宽度为200,背水坡宽度为100, 则取值范围为[-200, 100], 0表示在闸门处。

methods

方法名称描述参数
updateSensor更新单个传感器{name, value, distance}
updateSensors全量更新传感器Array<{name, value, distance}>