![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.
@nodl/react
Advanced tools
A React-implementation of the Nodl framework.
This library is powered by MobX under the hood; and may be observed by an external MobX-instance for UI reactivity.
# Using NPM
npm install @nodl/core @nodl/react
# Using Yarn
yarn add @nodl/core @nodl/react
# Using Bun
bun install @nodl/core @nodl/react
Make sure to also install the following packages:
# Using NPM
npm install react react-dom rxjs zod
# Using Yarn
yarn add react react-dom rxjs zod
# Using Bun
bun install react react-dom rxjs zod
The fundamental piece which renders a surface with fully interactive Nodes & Connections.
Supports the following props:
store: CircuitStore
A Circuit store which holds the internal circuit state along with associated nodes.className?: string
An optional className to assign the Circuit.onConnection?(connection: Connection<unknown>)
An optional callback which fires when new connections are made.onConnectionRemoval?(connection: Connection<unknown>)
An optional callback which fires when connections are removed.onNodeRemoval?(node: Node)
An optional callback which fires when nodes are removed.onSelectionChanged?(nodes: Node[])
An optional callback which fires when selected nodes changes.export const App = () => {
const store = new CircuitStore();
React.useEffect(() => {
store.setNodes([
[additionNode1, { x: -220, y: 100 }],
[additionNode2, { x: -220, y: -100 }],
[additionNode3, { x: 220, y: 0 }]
]);
return () => {
store.dispose();
};
}, []);
return (
<Circuit
store={store}
onConnection={connection => console.log('NEW CONNECTION', connection)}
onConnectionRemoval={connection => console.log('REMOVED CONNECTION', connection)}
onNodeRemoval={node => console.log('REMOVED NODE', node)}
onSelectionChanged={nodes => console.log('SELECTION CHANGED', nodes)}
/>
);
};
The manager which is responsible for the circuit state.
nodes: Node[]
The associated nodes.selectedNodes: Node[]
The currently selected nodes.selectionBounds: Bounds | null
The current selected area's bounds.mousePosition: MousePosition
Current mouse position within the Circuit surface.setNodes(nodesWithPosition: [Node, {x: number, y: number}][])
Used to initialize the store with nodes along with their position.removeNode(nodeId: Node['id'])
Removes a node from the store.selectNodes(nodes: Node[])
Selects the given nodes.dispose()
Disposes the store and its internal reactions.import { Node, Input, Output } from '@nodl/core';
import { Circuit, CircuitStore } from '@nodl/react';
import * as React from 'react';
import { combineLatest, map } from 'rxjs';
import { z } from 'zod';
/** Declare a zod schema for value validation */
const NumberSchema = z.number();
class Addition extends Node {
inputs = {
a: new Input({ name: 'A', type: NumberSchema, defaultValue: 0 }),
b: new Input({ name: 'B', type: NumberSchema, defaultValue: 0 })
};
outputs = {
output: new Output({
name: 'Output',
type: NumberSchema,
observable: combineLatest([this.inputs.a, this.inputs.b]).pipe(
map(inputs => inputs.reduce((sum, value) => sum + value), 0)
)
})
};
}
/** Declare 3 addition nodes */
const additionNode1 = new Addition();
const additionNode2 = new Addition();
const additionNode3 = new Addition();
/** Connect them together */
additionNode1.outputs.output.connect(additionNode3.inputs.a);
additionNode2.outputs.output.connect(additionNode3.inputs.b);
export const App = () => {
const store = new CircuitStore();
React.useEffect(() => {
store.setNodes([
[additionNode1, { x: -220, y: 100 }],
[additionNode2, { x: -220, y: -100 }],
[additionNode3, { x: 220, y: 0 }]
]);
return () => {
store.dispose();
};
}, []);
return (
<Circuit
store={store}
onConnection={c => console.log('NEW CONNECTION', c)}
onConnectionRemoval={c => console.log('REMOVED CONNECTION', c)}
onNodeRemoval={n => console.log('REMOVED NODE', n)}
onSelectionChanged={s => console.log('SELECTION CHANGED', s)}
/>
);
};
FAQs
React implementation of the Nodl framework
The npm package @nodl/react receives a total of 0 weekly downloads. As such, @nodl/react popularity was classified as not popular.
We found that @nodl/react 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.