![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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 | - |
BaseGraph 以树、图为基础数据结构,规范数据定义并提供基础操作库。
更多详细BaseGraph API
BaseLayout 主要处理树图布局集成
import { ReLayout } from 'regraph-next';
const { DAGAIU } = ReLayout;
interface MyRelation {
sourceId: number;
targetId: number;
periodDiff: number;
}
interface MyNode {
id: number;
downRelations: MyRelation[];
upRelations: MyRelation[];
name: string;
desc: string;
nodeWidth?: number;
nodeHeight?: number;
}
// 生成dag图
const dag = new DAGAIU<MyNode, MyRelation>({
isTransverse: true,
padding: 20,
});
dag.getSingleDAG(data)
dag.getMultiDAG(data)
this.groupLayout = new GroupGraphLayout(nodes, links, groups, groupLinks, config);
this.groupLayout.layout();
FAQs
ReGraph
The npm package regraph-next receives a total of 0 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.