
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
A flexible, type-safe, and interactive node-based editor library built with React, TypeScript, and modern design principles.
A powerful React TypeScript library for creating interactive flow diagrams with draggable nodes, connectable edges, and advanced features like panning, zooming, and a minimap.
npm install flux-node
import React, { useState, useCallback } from 'react';
import FluxNode, {
Node,
Edge,
NodeChange,
EdgeChange,
Connection,
applyNodeChanges,
applyEdgeChanges,
addEdge
} from 'flux-node';
const initialNodes: Node[] = [
{
id: '1',
position: { x: 100, y: 100 },
data: { label: 'Node 1' },
},
{
id: '2',
position: { x: 300, y: 100 },
data: { label: 'Node 2' },
},
];
const initialEdges: Edge[] = [];
function App() {
const [nodes, setNodes] = useState<Node[]>(initialNodes);
const [edges, setEdges] = useState<Edge[]>(initialEdges);
const onNodesChange = useCallback(
(changes: NodeChange[]) => setNodes((nds) => applyNodeChanges(changes, nds)),
[]
);
const onEdgesChange = useCallback(
(changes: EdgeChange[]) => setEdges((eds) => applyEdgeChanges(changes, eds)),
[]
);
const onConnect = useCallback(
(params: Connection) => setEdges((eds) => addEdge(params, eds)),
[]
);
return (
<div style={{ width: '100%', height: '500px' }}>
<FluxNode
nodes={nodes}
edges={edges}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
onConnect={onConnect}
fitView
/>
</div>
);
}
export default App;
| Prop | Type | Description |
|---|---|---|
nodes | Node[] | Array of nodes to display |
edges | Edge[] | Array of edges connecting nodes |
onNodesChange | (changes: NodeChange[]) => void | Callback for node changes (position, removal, etc.) |
onEdgesChange | (changes: EdgeChange[]) => void | Callback for edge changes (removal, selection, etc.) |
onConnect | (params: Connection) => void | Callback when nodes are connected |
fitView? | boolean | Whether to fit all nodes in view on mount |
interface Node {
id: string;
position: Position;
data: {
label: string;
};
type?: string;
}
interface Edge {
id: string;
source: string;
target: string;
type?: string;
}
interface Position {
x: number;
y: number;
}
interface Connection {
source: string;
target: string;
sourceHandle?: string;
targetHandle?: string;
}
applyNodeChanges(changes: NodeChange[], nodes: Node[]): Node[]Applies an array of node changes to the nodes array. Handles position updates, removals, and other node modifications.
applyEdgeChanges(changes: EdgeChange[], edges: Edge[]): Edge[]Applies an array of edge changes to the edges array. Handles edge removals and other edge modifications.
addEdge(connection: Connection, edges: Edge[]): Edge[]Creates a new edge from a connection and adds it to the edges array. Prevents duplicate edges.
The component uses inline styles for maximum compatibility. You can customize the appearance by modifying the component or extending it with your own styling system.
Check out the complete example in the example/App.tsx file. This shows a full implementation with:
The example demonstrates:
# Install dependencies
npm install
# Build the library
npm run build
# Watch mode for development
npm run dev
MIT
FAQs
A flexible, type-safe, and interactive node-based editor library built with React, TypeScript, and modern design principles.
The npm package flux-node receives a total of 3 weekly downloads. As such, flux-node popularity was classified as not popular.
We found that flux-node demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.