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

@flow3d/preset-industrial

v0.1.0

Published

Industrial domain preset for Flow3D — node kinds, styles and labels for plant / process flow scenes.

Readme

@flow3d/preset-industrial

Flow3D 的工业领域预设(M4 交付)。提供一套面向工厂 / 工艺流程图的节点词汇、流词汇与运行状态样式。

本包是唯一被允许出现行业术语的包(见 docs/03 ADR-001)。core 的 ESLint 规则 flow3d/no-domain-terms 在此不生效——本包的存在正是为了承载这些词汇,并向使用者示范 「如何为自己的行业写一套 preset」。预设只产出纯数据DomainPreset),不引入任何 three 依赖;渲染由 FlowScene 在应用层完成。

安装

pnpm add @flow3d/preset-industrial

快速开始

import { createDefaultRegistry, FlowScene } from '@flow3d/core';
import { installIndustrial } from '@flow3d/preset-industrial';

const reg = createDefaultRegistry();
installIndustrial(reg); // 注册 nodeKinds / flowKinds / states

const scene = new FlowScene({ registry: reg });
await scene.load({
  version: '1.0',
  presets: ['industrial'], // 文档引用已注册的预设
  nodes: [
    { id: 't1', kind: 'tank' },
    { id: 'p1', kind: 'pump' },
  ],
  flows: [{ from: 't1', to: 'p1', kind: 'process' }],
});

installIndustrial(reg, options?) 是推荐入口;若只想读取纯数据,也可直接导入 industrialPreset 对象自行处理。

节点词汇(nodeKinds

| kind | label | 默认几何 | 端口(anchor) | | --------------- | ------ | ------------------ | --------------------------------------------------- | | tank | 储罐 | 圆柱 r1.2×h2.4 | inlet(top) / outlet(bottom) | | reactor | 反应釜 | 圆柱 r1.4×h2.8 | feed(top) / product(bottom) | | pump | 泵 | 方体 1³ | inlet(-x) / outlet(+x) | | valve | 阀门 | 扁方体 0.6³ | inlet(-x) / outlet(+x) | | sensor | 传感器 | 小方体 0.5³ | probe(+y) | | heatExchanger | 换热器 | 长方体 1.6×1.2×1.2 | in-a(-x) / out-a(+x) / in-b(-z) / out-b(+z) | | compressor | 压缩机 | 方体 1.4×1×1 | suction(-x) / discharge(+x) | | pipe | 管段 | 长条盒 2×0.3×0.3 | inlet(-x) / outlet(+x) |

kind 且未显式给 source 的节点,会回退到 defaults.node.source(一个灰色 1³ 方体), 不会触发 E_NODE_SOURCE_MISSING

流词汇(flowKinds

| kind | label | 渲染 | 动画 | | --------- | -------- | ------------------- | -------------- | | process | 工艺流 | tube 蓝 #2e86de | speed 1.2 | | steam | 蒸汽 | tube 浅灰 #bdc3c7 | speed 0.9 | | gas | 气体 | tube 青绿 #1abc9c | speed 1.6 | | control | 控制信号 | line 琥珀 #f39c12 | 无(静态细线) |

流的默认渲染(无 kind 时)来自 defaults.flow.render:tube,width 0.12。

状态样式(states

状态名可用于节点 / 流的 state 字段,由渲染层映射为颜色(与发光)。

| state | nodeColor | 说明 | | ------------- | --------- | ---------------- | | running | #27ae60 | 运行 | | warning | #f39c12 | 告警 | | fault | #e74c3c | 故障(带自发光) | | idle | #95a5a6 | 停机 | | maintenance | #2980b9 | 维护中 |

设计依据

见仓库 docs/01-Flow3D-技术设计文档.md §5.13 与 docs/03-Flow3D-实现确定性附录.md §2.21。 任何实现细节以这两份文档为准。本包单测位于 packages/preset-industrial/test/unit

License

MIT