![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.
@byai/topology
Advanced tools
yarn add @byai/topology
yarn
yarn start
yarn test
见demo
name | type | default | description |
---|---|---|---|
data | object | { nodes: []; lines: [] } | 数据 |
lineColor | object | {} | 线条颜色映射对象 eg: {'锚点1': '#82BEFF', '锚点2': '#FFA39E'} |
lineOffsetY | number | 0 | 线条起始点向上偏移量 |
showBar | bool | true | 是否显示工具栏 |
canConnectMultiLines | bool | false | 控制一个锚点是否可以连接多条线 |
readOnly | bool | false | 只读模式,为true时不可编辑 |
autoLayout | bool | false | 自动布局,当数据中没有position属性时将自动计算布局。 |
renderTreeNode | (node,decorators) => ReactNode | - | 子节点render方法,接收节点数据,返回JSX。 |
getInstance | (instance: Topology) => void | - | 返回组件实例,用于调用组件内部的方法。 |
onChange | (data, changeType) => void | - | 数据发成改变时触发,changeType为改变的类型 |
onSelect | (data) => void | - | 选中数据时触发,返回当前选中的数据(包含节点、线段) |
sortChildren | (parent, children) => sortedChildren | - | 子节点排序回调,可选,默认无。 |
返回topology组件的实例,可通过实例调用组件内部的方法:
移动到中心,当所有节点都有位置数据(positions)时,移动的中心点为内容的中心,否则为画布的中心。
自动计算布局
renderTreeNode的第二个参数,包含以下装饰器函数:
anchorDecorator是一个高阶函数,经过 anchorDecorator 包装的控件将变成一个锚点。
anchorDecorator(options)(ReactNode)
name | type | default | description |
---|---|---|---|
anchorId | string | - | 锚点唯一id,如果不传将默认生成一个自增的id |
模板装饰器,用于包装模板组件
<TemplateWrapper generator={this.generatorNodeData}>
<div>模板节点</div>
</TemplateWrapper>
name | type | default | description |
---|---|---|---|
data | () => nodeData | - | 数据生成器,用于产生节点数据 |
FAQs
We found that @byai/topology demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.