npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@u-map/pipe-analysis

v0.2.1

Published

Readme

@u-map/pipe-analysis

排水管网 GIS 分析能力包:横/纵断面 canvas 图、连通性、追踪分析(上/下游)、倒坡、大管接小管、河水淹没。 三端(池州/东台/榆中 onemap)decision_analysis 组件与分析 hooks 的唯一实现。

架构:库无后端,应用注入

库不持有任何 geoserver 地址、视图名、工程名。应用在入口(main.ts)副作用导入一个适配模块, 调用 setPipeAnalysisConfig 注入 PipeAnalysisApi(包装各自 @/api/geoserver 的 WFS 函数)与业务参数:

// src/api/pipe-analysis.ts
import { setPipeAnalysisConfig, type PipeAnalysisApi } from '@u-map/pipe-analysis';
import { connectivity, analysis_stream, /* ... */ } from './geoserver';

const api: PipeAnalysisApi = { connectivity, analysisStream: analysis_stream, /* ... */ };
setPipeAnalysisConfig({ api, riverHeight: 21, pipeColor: getPipeColor });
// main.ts
import '@/api/pipe-analysis';

PipeAnalysisApi 六个方法(详见 . 导出的类型):

| 方法 | 用途 | 三端差异点 | | --- | --- | --- | | connectivity | pgr 连通路径(连通性/纵断面共用) | 视图 connectivity_analysis,表名 viewparams | | analysisStream | 上/下游追踪 | 视图 analyze_drainage_network | | backSlope | 倒坡(可传多边形) | v_pipe_back_slope,INTERSECTS(the_geom) | | largeToSmallPipes | 大管接小管 | v_large_to_small_pipes,INTERSECTS(geom) | | submergence | 河水淹没混接点 | 池州 v_yw_mixed_point_h(h>0),东台/榆中 vw_ywmixedpoint_h(h>0.1) | | crossPipes | 划线相交管线(横断面) | 池州独立函数;东台硬编码;榆中 app_config 参数化 |

应用 geoserver 函数的要素几何泛型通常是宽 GeoJSON.Geometry,适配层需按领域断言 (追踪/倒坡/大管接小管为 LineString、淹没为 Point)。

可配置业务参数(PipeAnalysisConfig,除 api 与启用追踪分析时的 flowLayerId 外均可选): pipeColor、flowLayerId(追踪分析绑定的管线图层 id,未配置时调用 initPipeEvent 显式抛错)、 flowTexture、riverHeight(默认 1,池州 21)、overflowWellLayer(默认 '溢流井' 为东台图层名,null 关闭联动)、 submergenceIcon、submergencePopupFields(后两项缺省值耦合东台数据字典/资产名,其它项目显式传入)。

组件(子路径导出,defineAsyncComponent 按需分包)

  • @u-map/pipe-analysis/cross-section 横断面
  • @u-map/pipe-analysis/vertical-section 纵断面
  • @u-map/pipe-analysis/connectivity-analysis 连通性
  • @u-map/pipe-analysis/pipe-flow 追踪分析
  • @u-map/pipe-analysis/back-slope 倒坡
  • @u-map/pipe-analysis/large-to-small-pipes 大管接小管
  • @u-map/pipe-analysis/submergence-analysis 河水淹没

组件无 props(全部经配置单例取依赖)。主入口 . 导出 6 个 hooks(useCrossSection 等)、 flyToFeature、toGraphic、配置 API 与类型。

关键约定

  • 样式全部内联,不用 UnoCSS 原子类:应用 uno.config 的 content pipeline 只扫应用源码, 链接包 SFC 内的原子类不会被生成。共享面板样式见 src/components/panel-style.ts。
  • 贴图走 public 运行时路径(assets/imgs/line-arrow-blue.png、assets/imgs/雨污混接点.svg), 三端 public 下均有同文件,库不打包资产。
  • GeoJSON 类型库内自定义(src/types.ts 的 Point/LineString/Polygon/Feature/FeatureCollection), 与 @types/geojson 结构兼容(TS 结构类型双向可赋值),避免产物 d.ts 内联 @types/geojson。
  • 跨 vue 小版本 link 兼容:hooks 的响应式 state 一律显式标注普通对象类型,抹掉 ShallowReactive/Ref 的 unique symbol marker;列表状态用 reactive 对象(result.list) 而非 shallowRef——否则消费端模板的 ref 自动解包按其 vue 声明副本识别会失败。
  • SectionChart 为纯 canvas 手绘(非 echarts):hooks 产出瘦身后的 SectionChartOption = { kind, data }, 原 echarts 风格 option 中 tooltip/xAxis/yAxis 等字段从未被消费,已删除。横/纵断面两套重复绘制逻辑 已合并为单组件,以 kind 分支;组件用 ref 持有容器,原版全局 #echartsContent DOM id 多实例冲突已修。
  • peerDeps:vue、mars3d/mars3d-cesium、element-plus、@turf/bbox、@turf/helpers、 @turf/length、@turf/line-intersect(均 ^7,子包精确导入避免 @turf/turf 全家桶进 bundle)、 @u-map/common、@u-map/map-mars3d。

未收编内容

  • 榆中 section/Chartv1.vue:零引用备份文件,留项目内。
  • 应用 src/api/geoserver.ts 中 QueryEntity 大类、upstream/downstream 等与分析无关的 WFS 能力不迁移。