Copyright © 2021 by K4.org
  (v.0.48.124)

PointLineGraph is an extension of NodeGraph with the following additional characteristics: 1. It is geometric; the nodes are Points and the edges are Lines, with default weight of their length.

Index

Rules

DisplayEdges

DisplayEdges: Child

no doc

Design: LineSegments

allEdges

allEdges: Array

no doc

Flags : cached

Expression : `const g = this.getGraph(); const allEdges = g.edges(); let source = ""; let target = ""; let sourcePoint; let targetPoint; let result = [];

for (let j = 0; j < allEdges.length; j++) { edge = allEdges[j]; source = g.source(edge); target = g.target(edge); if(source != target){ sourcePoint = g.getNodeAttribute(g.source(edge),'data'); targetPoint = g.getNodeAttribute(g.target(edge),'data'); result.push({"edge": edge, "source": source, "target": target, "sourcePoint": sourcePoint, "targetPoint": targetPoint}); } } result = R.removeDuplicates(result); return result;`

graphInstance

graphInstance: Any

The graph object, an instance of a Graphology graph.

Flags : cached

Expression : const Graph = require('graphology'); const graph = new Graph(); this.resetNodeID(); const nodes = this.nodeData.map(n => { const id = this.nextNodeID(); return graph.addNode(id, { data: n }); }); this.buildEdges(graph); return graph;

vertexEquivalenceTolerance

vertexEquivalenceTolerance: Number

The distance below which two vertices are considered equivalent.

Flags : cached, parameter

Default expression : 0.001

Methods

addBranch

  • addBranch(): Array
  • Adds a sequence of points to the current graph. Takes care of inserting the last point into any existing edge it falls on.

    Flags : method (Note this is uncached)

    Returns Array

addEdge

  • addEdge(): String
  • Adds an undirected edge between source and target, with optional associated data. Returns the edge name. If data is not supplied, then this calls buildEdgeAttributes to create the default data.

    Flags : method (Note this is uncached)

    Returns String

buildEdgeAttributes

  • buildEdgeAttributes(): Any
  • no doc

    Flags : method (Note this is uncached)

    Returns Any

buildEdges

  • buildEdges(): Any
  • This processes the raw edge connectivity, and adds the line and weight attributes.

    Flags : method (Note this is uncached)

    Returns Any

connectOrphanedNodes

  • connectOrphanedNodes(): Boolean
  • no doc

    Flags : method (Note this is uncached)

    Returns Boolean

findNodeByVertex

  • findNodeByVertex(): Any
  • Finds a node given a location. Returns undefined if not found.

    Flags : method (Note this is uncached)

    Returns Any

getIDHolder

  • getIDHolder(): Any
  • Internal Use Only

    Flags : method (Note this is uncached)

    Returns Any

importGraph

  • importGraph(): Integer
  • Copy a graph into this one, including all attributes.

    Flags : method (Note this is uncached)

    Returns Integer

nearestPoint

  • nearestPoint(): Any
  • Returns an object of the form {dist: mindist, index: 0, nearPoint: p<x,y,z>, edgeName: "foo"} Where index is the index into the points input.

    Flags : method (Note this is uncached)

    Returns Any

nextNodeID

  • nextNodeID(): String
  • Internal Use Only

    Flags : method (Note this is uncached)

    Returns String

pathLength

  • pathLength(): Number
  • Returns the length of the given path.

    Flags : method (Note this is uncached)

    Returns Number

resetNodeID

  • resetNodeID(): Number
  • Internal Use Only

    Flags : method (Note this is uncached)

    Returns Number