Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
topology-byfe
Advanced tools
yarn add topology-byfe
yarn
yarn start
yarn test
见demo
name | type | default | description |
---|---|---|---|
data | object | { nodes: []; lines: [] } | 数据 |
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
The npm package topology-byfe receives a total of 1 weekly downloads. As such, topology-byfe popularity was classified as not popular.
We found that topology-byfe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.