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

@caoguo/maplibre-compute

v0.0.9

Published

草果地图算力网组件包 - 数据中心 / 边缘节点 / 光缆路由 / 延迟热力 / 供需预测

Readme

@caoguo/maplibre-compute

草果地图算力网组件包 — 数据中心 / 边缘节点 / 光缆路由 / 延迟热力 / 供需预测

npm version license

安装

npm install @caoguo/maplibre-compute

Peer:maplibre-gl@^4.7.1

功能模块

| 模块 | 导出 | 说明 | |------|------|------| | 节点 | ComputeNodes | 数据中心/边缘节点地图 + 光缆路由可视化 | | 延迟 | LatencyMap | 延迟热力 + 最优接入推荐 + 告警 | | 预测 | supplyDemand | 算力供需预测(缺口分析) | | NLPG | computeNlp | 算力查询意图识别 | | 图算法 | 图邻接表 + 最低延迟路径 + 路由分析 + 最优接入 | | | 样式 | computeTheme / COMPUTE_GPU_COLORS / computeLegend | GPU 利用率/光缆利用率配色 | | 数据 | ComputeNode / FiberLink / LatencyRecord | 数据模型 |

快速开始

延迟热力 + 最优接入

import { LatencyMap } from '@caoguo/maplibre-compute/latency';

const lm = new LatencyMap({ dataset, userLocation: { lng: 114.3, lat: 30.6 } });
const result = lm.findOptimalEdge({ maxLatencyMs: 20 });
console.log('推荐边缘节点', result.recommended);
console.log('预估延迟', result.estimatedLatencyMs);

供需预测

import { supplyDemand } from '@caoguo/maplibre-compute/predict';

const forecast = supplyDemand.forecast({
  historyDays: 30,
  horizonDays: 7,
});
console.log('未来 7 天 GPU 缺口', forecast.gapByDay);

节点地图

import { ComputeNodes } from '@caoguo/maplibre-compute/nodes';

const nodes = new ComputeNodes({ dataset });
nodes.render(map.instance);

子入口

@caoguo/maplibre-compute/graph
@caoguo/maplibre-compute/nodes
@caoguo/maplibre-compute/latency
@caoguo/maplibre-compute/predict
@caoguo/maplibre-compute/nlpg
@caoguo/maplibre-compute/style
@caoguo/maplibre-compute/types

设计原则

  1. 算法纯函数:供需预测、延迟分析、路由分析均为纯函数。
  2. 可插拔:每个组件独立可用。
  3. 离线友好:所有计算在前端完成。

浏览器 / 环境要求

  • 现代浏览器(Chrome 90+)
  • 核心算法在 Node.js 可测(已含 8 个 vitest 用例)

许可

Apache-2.0