Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@syntsugar/cc-graph

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syntsugar/cc-graph

Data Structure Serial - Graph

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cc-graph

Data Structure Serial - Graph

  • written in Typescript
  • fully tested

Installation

Node.js / Browserify

npm install cc-graph --save
var {Graph, GraphEdge, GraphVertex} = require('cc-graph');

Global object

Include the pre-built script.

<script src="./dist/index.umd.min.js"></script>

usage

const graph = new Graph();

const vertexA = new GraphVertex('A');
const vertexB = new GraphVertex('B');
const vertexC = new GraphVertex('C');
const vertexD = new GraphVertex('D');

const edgeAB = new GraphEdge(vertexA, vertexB, 1);
const edgeBC = new GraphEdge(vertexB, vertexC, 2);
const edgeCD = new GraphEdge(vertexC, vertexD, 3);
const edgeAD = new GraphEdge(vertexA, vertexD, 4);

graph
    .addEdge(edgeAB)
    .addEdge(edgeBC)
    .addEdge(edgeCD)
    .addEdge(edgeAD);

expect(graph.getWeight()).toBe(10);

Build & test

npm run build
npm test

Document

npm run doc

then open the generated out/index.html file in your browser.

Why cc-graph

There is a redundant debugger in the graph.ts. It's seriously affect the normal use, i submit one PR but nobody reply me. So i fork a new repo and renamed cc-graph.

License

MIT.

FAQs

Package last updated on 13 Apr 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc