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

@logicflow/layout

v2.1.4

Published

LogicFlow layout

Readme

layout

@logicflow/layout 提供 LogicFlow 自动布局能力,包含 DagreElkLayout 两个插件。

安装

pnpm add @logicflow/core @logicflow/layout

基本使用

import LogicFlow from '@logicflow/core'
import { Dagre, ElkLayout } from '@logicflow/layout'

const lf = new LogicFlow({
  container: '#app',
  plugins: [Dagre, ElkLayout],
})

lf.extension.dagre.layout({ rankdir: 'LR' })
lf.extension.elkLayout.layout({ rankdir: 'TB' })

分组布局(GroupLayoutOption)

Dagre / ElkLayout 共用以下参数(完整说明见文档站 Layout API):

| 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | groupId | string | — | 不传:全图布局;传:仅布局该分组内部 | | resizeGroup | false \| 'grow-only' \| 'fit' | false | 布局后是否调整分组尺寸 | | groupPadding | number | 40 | 计算分组包围盒时的内边距 |

// 仅布局组内,不改分组框(默认)
lf.extension.dagre.layout({ groupId: 'group_1', rankdir: 'LR' })

// 组内布局并扩大分组框
lf.extension.dagre.layout({
  groupId: 'group_1',
  resizeGroup: 'grow-only',
  groupPadding: 24,
})

告警(console.warn):

  • 子节点超出分组边界
  • 实际调整了分组尺寸
  • resizeGroup 覆盖了 group.resizable === false

通用布局参数

| 参数 | 默认值 | 说明 | | --- | --- | --- | | rankdir | 'LR' | LR / TB / BT / RL | | align | 'UL' | UL / UR / DL / DR | | nodesep | 100 | 同层节点间距 | | ranksep | 150 | 层级间距 | | isDefaultAnchor | false | 是否重算默认锚点与折线路径 |

ElkLayout 另支持 elkOption 透传 ELK 原生配置。

架构

ARCHITECTURE.md