
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
circuit-json-to-connectivity-map
Advanced tools
This library provides utilities to generate connectivity maps from circuit JSON data. It's designed to work with the `@tscircuit/soup` library and offers functionality to find connected networks and create connectivity maps.
This library provides utilities to generate connectivity maps from circuit JSON data. It's designed to work with the @tscircuit/soup
library and offers functionality to find connected networks and create connectivity maps.
To install the library, use npm or bun:
npm add circuit-json-to-connectivity-map
import { findConnectedNetworks } from "circuit-json-to-connectivity-map"
const connections = [
["A", "B"],
["B", "C"],
["D", "E"],
]
const result = findConnectedNetworks(connections)
console.log(result)
// Output:
// {
// connectivity_net0: ["A", "B", "C"],
// connectivity_net3: ["D", "E"],
// }
import { getSourcePortConnectivityMapFromCircuitJson } from "circuit-json-to-connectivity-map"
import type { AnyCircuitElement } from "circuit-json"
const circuitJson: AnyCircuitElement[] = [
// Your circuit JSON data here
]
const connectivityMap = getSourcePortConnectivityMapFromCircuitJson(circuitJson)
// Check if two IDs are connected
console.log(connectivityMap.areIdsConnected("port1", "port2"))
// Get all IDs connected to a specific net
console.log(connectivityMap.getIdsConnectedToNet("net1"))
// Get the net connected to a specific ID
console.log(connectivityMap.getNetConnectedToId("port1"))
import { getFullConnectivityMapFromCircuitJson } from "circuit-json-to-connectivity-map"
import type { AnyCircuitElement } from "circuit-json"
const circuitJson: AnyCircuitElement[] = [
// Your circuit JSON data here
]
const fullConnectivityMap = getFullConnectivityMapFromCircuitJson(circuitJson)
// Check if two IDs are connected (including PCB elements)
console.log(fullConnectivityMap.areIdsConnected("smtpad1", "port1"))
// Get all IDs connected to a specific net
console.log(fullConnectivityMap.getIdsConnectedToNet("net1"))
// Get the net connected to a specific ID
console.log(fullConnectivityMap.getNetConnectedToId("pcb_port1"))
findConnectedNetworks(connections: Array<string[]>): Record<string, string[]>
Finds connected networks from a list of connections.
getSourcePortConnectivityMapFromCircuitJson(circuitJson: AnyCircuitElement[]): ConnectivityMap
Generates a source port connectivity map from circuit JSON data.
getFullConnectivityMapFromCircuitJson(circuitJson: AnyCircuitElement[]): ConnectivityMap
Generates a full connectivity map from circuit JSON data, including PCB elements.
ConnectivityMap
A class representing the connectivity map with methods:
areIdsConnected(id1: string, id2: string): boolean
getIdsConnectedToNet(netId: string): string[]
getNetConnectedToId(id: string): string | undefined
This project uses Bun as its JavaScript runtime.
To start development:
bun install
to install dependenciesbun test
to ensure all tests passContributions are welcome! Please feel free to submit a Pull Request.
FAQs
This library provides utilities to generate connectivity maps from circuit JSON data. It's designed to work with the `@tscircuit/soup` library and offers functionality to find connected networks and create connectivity maps.
The npm package circuit-json-to-connectivity-map receives a total of 11,354 weekly downloads. As such, circuit-json-to-connectivity-map popularity was classified as popular.
We found that circuit-json-to-connectivity-map 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.