![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
regraph-next
Advanced tools
数据领域图表定义:以树、图为基础数据结构,带有数据业务属性与特征的图表
现状与痛点
ReGraph针对以上痛点,打造了基础操作层、渲染交互层、布局算法层三层结构。
ReGraph = 计算(布局插件)+ 底层操作(树图基础库)+ 渲染(交互的统一封装)
yarn add regraph-next
ReScreen 组件统一封装了画布的操作和缩略图功能,支持对画布的全屏、复位、显示所有、重置、平移缩放等常见功能。
import { ReScreen } from 'regraph-next';
<ReScreen
height = {500}
width = {500}
mapWidth = {200}
mapHeight = {200}
mapPosition = "RT-IN" >
<svg>
<g>
<circle cx={0} cy={0} r={500} fill="yellow" />
<circle cx={cx} cy={cy} r={250} fill="red" />
</g>
</svg>
</ReScreen>
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- | --- |
| type | 画布内容的类型 | 枚举值,可选值(SVG
,DOM
) | SVG |
| width | 组件整体的尺寸,支持传入百分数 | number/string | - |
| height | 组件整体的尺寸,支持传入百分数 | number/string | - |
| zoomEnabled | 是否启动鼠标滚动缩放画布 | boolean | true |
| focusEnabled | 是否启动聚焦功能,0表示不启动,1表示单击触发,2表示双击触发 | number | 0 |
| minZoom | 缩放范围,最小值 | number | - |
| maxZoom | 缩放范围,最大值 | number | - |
| dragDirection | ALL
,HOR
, VER
| 拖拽方向的锁定 | ALL
|
| needMinimap | 是否需要缩略图 | boolean | true |
| minimap | React.ReactElement | 支持自定义传入缩略图组件 | - |
| mapPosition | RT
, RB
, LT
, LB
, RT-IN
, RB-IN
, LT-IN
, LB-IN
| 缩略图位置,右上角;-IN表示在画布的内部 | 默认为RT
|
| mapPadding | 缩略图和原图之间的大小 | number | 20|
| mapWidth | 缩略图大小 | number | 100px |
| mapHeight | 缩略图大小 | number | 100px |
| mapRectStyle | 缩略图矩形的样式 | object | - |
| Buttons | 按钮组件 | React.ReactElement | - |
| needRefresh | 由于画布元素的变化而引起的视图变化 | boolean | - |
| resetNeedRefresh | 通知外层重置needRefresh为false | function | - |
| onScreenChange | 画布发生变化时的回调,对外暴露当前的缩放信息 | (transform: ZoomTransform) => void | - |
| getScreenHandler | 对外暴露画布操作函数 | any | - |
完善中,敬请期待
完善中,敬请期待
FAQs
ReGraph
The npm package regraph-next receives a total of 1 weekly downloads. As such, regraph-next popularity was classified as not popular.
We found that regraph-next demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.