![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.
@rescriptbr/react-flow
Advanced tools
React Flow bindings for ReScript.
rescript-react-flow
using npm:npm install --save @rescripbr/react-flow
or yarn:
yarn add @rescriptbr/react-flow
rescript-react-flow
as dependency to your bsconfig.json
:{
"name": "your-project",
"bs-dependencies": ["@rescriptbr/react-flow"]
}
Check the code below for fast basic examples:
ReactFlow.Types.Node(
ReactFlow.Node.makeNode(
~id="1",
~position={x: 250, y: 0},
~data=ReactFlow.Node.toData({"label": React.string("test")}),
~type_="input",
(),
),
),
ReactFlow.Types.Edge(
ReactFlow.Edge.makeEdge(
~id="e1-2",
~source="1",
~target="2",
~label="this is an edge label",
~data=ReactFlow.Edge.toData("some other data"),
(),
),
),
let elements = [
ReactFlow.Types.Edge(
ReactFlow.Edge.makeEdge(
~id="e1-2",
~source="1",
~target="2",
~label="this is an edge label",
~data=ReactFlow.Edge.toData("some other data"),
(),
),
),
ReactFlow.Types.Node(
ReactFlow.Node.makeNode(
~id="1",
~position={x: 250, y: 0},
~data=ReactFlow.Node.toData({"label": React.string("test")}),
~type_="input",
(),
),
),
]
@react.component
let make = () => {
let (elems, setElems) = React.useState(() => elements)
let onElementsRemove = elementsToRemove => {
setElems(elems => ReactFlow.Utils.removeElements(elementsToRemove, elems))
}
let onConnect = newEdgeParams => {
setElems(elems => ReactFlow.Utils.addEdge(newEdgeParams, elems))
}
<div className="App" style={ReactDOM.Style.make(~height="800px", ~width="1200px", ())}>
<ReactFlow
elements={elems->ReactFlow.Utils.elementsToRaw}
onElementsRemove
onConnect
onLoad
snapToGrid=true
snapGrid=(15, 15)>
<ReactFlow.Controls />
<ReactFlow.Background variant=#lines color="#aaa" gap={16} />
<ReactFlow.MiniMap
nodeColor={n => {
switch ReactFlow.Node.type_Get(n) {
| Some("input") => "#0041d0"
| Some("output") => "#ff0072"
| Some("default") => "#1a192b"
| _ => "#eee"
}
}}
nodeStrokeColor={_ => "#fff"}
nodeBorderRadius={2}
/>
</ReactFlow>
</div>
}
Please look at the example folder for more advanced implementations.
If you'd like to contribute, you can follow the instructions below to get things working locally.
npm install
npm start
FAQs
Easily use React Flow with ReScript
The npm package @rescriptbr/react-flow receives a total of 10 weekly downloads. As such, @rescriptbr/react-flow popularity was classified as not popular.
We found that @rescriptbr/react-flow demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.