repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
msaglJS/msagl-js
src/routing/visibility/UnimodalSequence.ts
// following https://dl.acm.org/doi/pdf/10.1145/7531.24036?casa_token=<PASSWORD> // 'Intersection of Convex Objects in Two and Three Dimensions' by Chazelle, and Dobkin enum Behavior { Increasing, Decreasing, Extremum, } // A real valued function f defined on // the integers 0, 1, . . . , n-1 is said to be un...
msaglJS/msagl-js
src/math/geometry/compassVector.ts
import {PointComparer} from '../../routing/rectilinear/PointComparer' import {Direction} from './direction' import {Point} from './point' export class CompassVector { Dir: Direction constructor(direction: Direction) { this.Dir = direction } get Right(): CompassVector { return new CompassVector(Compas...
msaglJS/msagl-js
src/routing/spline/bundling/LinearMetroMapOrdering.ts
// using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; // using Microsoft.Msagl.DebugHelpers; // ...
msaglJS/msagl-js
src/routing/rectilinear/ScanSegmentVector.ts
// This forms the vector of ScanSegments for the sparse VisibilityGraph. import {Point} from '../../math/geometry/point' // import {Assert} from '../../utils/assert' import {VisibilityGraph} from '../visibility/VisibilityGraph' import {PointAndCrossingsList} from './PointAndCrossingsList' import {ScanSegment} from '....
msaglJS/msagl-js
src/layout/layered/anchor.ts
<reponame>msaglJS/msagl-js // Defines the anchors for a node; anchors can be not symmetrical in general // // |TopAnchor //Left anchor| // ======Origin==================RightAnchor // | // | // |BottomAnchor import {Point, TriangleOrientation} from './../../math/geometry/point' i...
msaglJS/msagl-js
src/layout/core/edgeGeometry.ts
import {ICurve} from './../../math/geometry/icurve' import {SmoothedPolyline} from './../../math/geometry/smoothedPolyline' import {Arrowhead} from './arrowhead' import {Port} from './port' import {String} from 'typescript-string-operations' export class EdgeGeometry { sourcePort: Port targetPort: Port curve: IC...
msaglJS/msagl-js
src/routing/spline/bundling/MetroLine.ts
<gh_stars>10-100 // using System; // using System.Collections.Generic; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // namespace Microsoft.Msagl.Routing.Spline.Bundling { // // holds the data of a path /...
msaglJS/msagl-js
src/utils/IntPairSet.ts
import {IntPair} from './IntPair' import {IEnumerable} from 'linq-to-typescript' export class IntPairSet { has(p: IntPair): boolean { return this.hasxy(p.x, p.y) } arrayOfSets: Set<number>[] remove(p: IntPair) { if (p.x < 0 || p.x >= this.arrayOfSets.length) { return } return this.arrayOf...
msaglJS/msagl-js
src/routing/rectilinear/HighReflectionEvent.ts
import {Point} from '../../math/geometry/point' import {HighObstacleSide} from './BasicObstacleSide' import {BasicReflectionEvent} from './basicReflectionEvent' export class HighReflectionEvent extends BasicReflectionEvent { Side: HighObstacleSide constructor( previousSite: BasicReflectionEvent, targetSid...
msaglJS/msagl-js
src/math/geometry/index.ts
export {interpolateICurve, Curve, PointLocation} from './curve' export {CurveFactory} from './curveFactory' export {Point} from './point' export {ICurve} from './icurve' export {Rectangle, Size} from './rectangle' export {Polyline} from './polyline' export {CompassVector} from './compassVector' export {Direction} from ...
msaglJS/msagl-js
src/layout/mds/MDSLayoutSettings.ts
// import {Assert} from '../../utils/assert' import {EdgeConstraints} from '../edgeConstraints' import {LayoutSettings} from '../layered/SugiyamaLayoutSettings' // MDL layout settings export class MdsLayoutSettings extends LayoutSettings { // the setting of Multi-Dimensional Scaling layout // private double ep...
msaglJS/msagl-js
src/layout/core/GeomGraph.ts
<gh_stars>10-100 import {Graph} from '../../structs/graph' import {Rectangle, Size} from '../../math/geometry/rectangle' import {GeomObject} from './geomObject' import {GeomNode} from './geomNode' import {GeomEdge} from './geomEdge' import {PlaneTransformation} from '../../math/geometry/planeTransformation' import {Nod...
msaglJS/msagl-js
test/math/geometry/ellipse.spec.ts
<filename>test/math/geometry/ellipse.spec.ts // eslint-disable-next-line @typescript-eslint/no-unused-vars import {Point} from '../../../src' import {GeomConstants, Curve} from '../../../src/math/geometry' import {Ellipse} from '../../../src/math/geometry/ellipse' // eslint-disable-next-line @typescript-eslint/no-unu...
msaglJS/msagl-js
src/math/geometry/rectanglePacking/OptimalColumnPacking.ts
<reponame>msaglJS/msagl-js // import {Assert} from '../../../utils/assert' import {Rectangle} from '../rectangle' import {ColumnPacking} from './ColumnPacking' import {OptimalPacking} from './OptimalPacking' // Pack rectangles (without rotation) into a given aspect ratio export class OptimalColumnPacking extends Opt...
msaglJS/msagl-js
src/math/geometry/geomConstants.ts
import {Point} from './point' export class GeomConstants { static distanceEpsilonPrecision = 6 static RoundPoint(point: Point): Point { return new Point( GeomConstants.RoundDouble(point.x), GeomConstants.RoundDouble(point.y), ) } static RoundDouble(num: number): number { return Math.rou...
msaglJS/msagl-js
src/routing/rectilinear/nudging/PathMerger.ts
<filename>src/routing/rectilinear/nudging/PathMerger.ts /// Avoid a situation where two paths cross each other more than once. Remove self loops. /// import {from, IEnumerable} from 'linq-to-typescript' import {Point} from '../../../math/geometry/point' // import {Assert} from '../../../utils/assert' import {PointMap}...
msaglJS/msagl-js
src/structs/BinaryHeapPriorityQueue.ts
<reponame>msaglJS/msagl-js // A priority queue based on the binary heap algorithm export class BinaryHeapPriorityQueue { // indexing for A starts from 1 _heap: number[] // array of heap elements _reverse_heap: number[] // the map from [0,..., n-1] to their places of heap // the array of priorities _p...
msaglJS/msagl-js
src/math/graphAlgorithms/topologicalSort.ts
import {IntPair} from './../../utils/IntPair' import { BasicGraphOnEdges, mkGraphOnEdgesArray, } from './../../structs/basicGraphOnEdges' import {Stack} from 'stack-typescript' // Implements the topological sort import {IEdge} from './../../structs/iedge' function visitNodeC( g: BasicGraphOnEdges<IEdge>, u: n...
msaglJS/msagl-js
src/layout/core/geomObject.ts
<gh_stars>10-100 import {AttrContainer} from './../../structs/attrContainer' import {Rectangle} from './../../math/geometry/rectangle' export abstract class GeomObject { abstract boundingBox: Rectangle attrCont: AttrContainer bind() { if (this.attrCont) this.attrCont.setAttr(0, this) } constructor(attrCo...
msaglJS/msagl-js
src/routing/InteractiveEdgeRouter.ts
<filename>src/routing/InteractiveEdgeRouter.ts import {Point, TriangleOrientation} from '../math/geometry/point' import {Polyline} from '../math/geometry/polyline' import {PolylinePoint} from '../math/geometry/polylinePoint' export class InteractiveEdgeRouter { static RemoveCollinearVertices(ret: Polyline): Polyline...
msaglJS/msagl-js
src/layout/driver.ts
<reponame>msaglJS/msagl-js<filename>src/layout/driver.ts<gh_stars>10-100 import {RectilinearEdgeRouter} from '../routing/rectilinear/RectilinearEdgeRouter' import {GeomGraph} from './core/GeomGraph' import {SugiyamaLayoutSettings} from './layered/SugiyamaLayoutSettings' import {LayeredLayout} from './layered/layeredLay...
msaglJS/msagl-js
test/core/projectionSolver.spec.ts
import {Solver} from '../../src/math/projectionSolver/Solver' import {Variable} from '../../src/math/projectionSolver/Variable' import {closeDistEps} from '../../src/utils/compare' test('two vars test', () => { const s = new Solver() const v0 = s.AddVariableAN('v0', 0) const v1 = s.AddVariableAN('v1', 1) s.Add...
msaglJS/msagl-js
src/routing/spline/coneSpanner/LineSweeperForPortLocations.ts
<filename>src/routing/spline/coneSpanner/LineSweeperForPortLocations.ts // using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Diagnostics.CodeAnalysis; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Micros...
msaglJS/msagl-js
src/routing/rectilinear/ObstaclePortEntrance.ts
<filename>src/routing/rectilinear/ObstaclePortEntrance.ts import {from, IEnumerable} from 'linq-to-typescript' import {String} from 'typescript-string-operations' import { Point, Rectangle, CompassVector, Curve, PointLocation, Direction, GeomConstants, LineSegment, Polyline, } from '../../math/geometr...
msaglJS/msagl-js
src/routing/visibility/InteractiveTangentVisibilityGraphCalculator.ts
<reponame>msaglJS/msagl-js // using System; // using System.Collections.Generic; // using System.Linq; // using Microsoft.Msagl.Core; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // namespace Microsoft.Msagl.Routing.Visibility { /...
msaglJS/msagl-js
src/math/geometry/smoothedPolyline.ts
<filename>src/math/geometry/smoothedPolyline.ts import {CornerSite} from './cornerSite' import {Point} from './../../math/geometry/point' import {LineSegment} from './../../math/geometry/lineSegment' import {Curve} from './../../math/geometry/curve' import {BezierSeg} from './../../math/geometry/bezierSeg' // import {A...
msaglJS/msagl-js
src/routing/ConstrainedDelaunayTriangulation/CdtEdge.ts
<filename>src/routing/ConstrainedDelaunayTriangulation/CdtEdge.ts import {String} from 'typescript-string-operations' // import {Assert} from '../../utils/assert' import {Cdt} from './Cdt' import {CdtSite} from './CdtSite' import {CdtTriangle} from './CdtTriangle' export class CdtEdge { public upperSite: CdtSite ...
msaglJS/msagl-js
drawing/drawingEdge.ts
import {DrawingLabel} from './drawingLabel' import {DrawingObject} from './drawingObject' export class DrawingEdge extends DrawingObject { label: DrawingLabel }
msaglJS/msagl-js
src/routing/ClusterBoundaryPort.ts
import {ICurve, Point, Polyline} from '../math/geometry' import {RelativeFloatingPort} from '../layout/core/relativeFloatingPort' export class ClusterBoundaryPort extends RelativeFloatingPort { loosePolyline: Polyline get LoosePolyline(): Polyline { return this.loosePolyline } set LoosePolyline(value: Po...
msaglJS/msagl-js
src/routing/spline/bundling/EdgeNudger.ts
// using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Diagnostics.CodeAnalysis; // using System.Linq; // using Microsoft.Msagl.Core; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using...
msaglJS/msagl-js
src/routing/spline/bundling/FlipSwitcher.ts
// using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; // #if TEST_MSAGL && TEST_MSAGL // using Mi...
msaglJS/msagl-js
src/routing/rectilinear/nudging/PathRefiner.ts
/// If two paths intersect then insert the intersection point as a vertex into both paths. /// Remove path self loops. Merge paths between the crossings if they have multiple crossings. /// If a path passes through a vertex of another path then insert this vertex into the first path. import {from} from 'linq-to-typ...
msaglJS/msagl-js
src/routing/rectilinear/nudging/StaircaseRemover.ts
import {from} from 'linq-to-typescript' import { Point, Rectangle, CompassVector, Curve, GeomConstants, LineSegment, Polyline, } from '../../../math/geometry' import {RectangleNode} from '../../../math/geometry/RTree/RectangleNode' import {RTree} from '../../../math/geometry/RTree/RTree' // import {Assert...
msaglJS/msagl-js
src/routing/spline/bundling/SdBoneEdge.ts
<filename>src/routing/spline/bundling/SdBoneEdge.ts // import {Point} from '../../../math/geometry/point' // import {Assert} from '../../../utils/assert' // import {CdtEdge} from '../../ConstrainedDelaunayTriangulation/CdtEdge' // import {VisibilityEdge} from '../../visibility/VisibilityEdge' // import {SdVertex} from...
msaglJS/msagl-js
src/routing/spline/bundling/OrientedHubSegment.ts
// using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // namespace Microsoft.Msagl.Routing.Spline.Bundling { // internal class OrientedHubSegment { // internal ICurve Segment; // internal bool Reversed; // internal int Index; // internal BundleBase ...
msaglJS/msagl-js
src/layout/layered/XCoordsWithAlignment.ts
// The implementation follows // "Fast and Simple Horizontal Coordinate Assignment" of <NAME> and <NAME> // The paper has two serious bugs that this code resolves. import {TopologicalSort} from '../../math/graphAlgorithms/topologicalSort' import { BasicGraphOnEdges, mkGraphOnEdgesN, } from '../../structs/basicGr...
msaglJS/msagl-js
src/layout/layered/HorizontalConstraintsForSugiyama.ts
import {from} from 'linq-to-typescript' import { BasicGraphOnEdges, mkGraphOnEdges, } from '../../structs/basicGraphOnEdges' import {IntPair} from '../../utils/IntPair' import {IntPairSet} from '../../utils/IntPairSet' import {GeomNode} from '../core/geomNode' import {CycleRemoval} from './CycleRemoval' function m...
msaglJS/msagl-js
src/routing/rectilinear/StaticGraphUtility.ts
<filename>src/routing/rectilinear/StaticGraphUtility.ts // import {CompassVector} from '../../math/geometry/compassVector' import {Direction} from '../../math/geometry/direction' import {LineSegment} from '../../math/geometry/lineSegment' import {Point} from '../../math/geometry/point' import {Rectangle} from '../../ma...
msaglJS/msagl-js
src/layout/layered/routing.ts
<reponame>msaglJS/msagl-js import {Curve} from '../../math/geometry/curve' import {ICurve} from '../../math/geometry/icurve' import {LineSegment} from '../../math/geometry/lineSegment' import {Point} from '../../math/geometry/point' import {Rectangle} from '../../math/geometry/rectangle' import {SmoothedPolyline} from ...
msaglJS/msagl-js
src/math/geometry/rectangle.ts
import {Point} from './point' import {Polyline} from './polyline' import {GeomConstants} from './geomConstants' import {IRectangle} from './IRectangle' export class Size { pad(padW: number): any { this.width += padW * 2 } width: number height: number constructor(width: number, height: number) { this....
msaglJS/msagl-js
src/routing/spline/bundling/BundleRouter.ts
// The class is responsible for general edge bundling with ordered bundles. /* import {IEnumerable} from 'linq-to-typescript' import {Map} from 'lodash' import {RectangleNode} from '../../../core/geometry/RTree/RectangleNode' import {Port} from '../../../core/layout/Port' import {BundlingSettings} from '../../../core/...
msaglJS/msagl-js
src/routing/ShapeObstacleCalculator.ts
// The class calculates obstacles under the shape. // We assume that the boundaries are not set for the shape children yet /* import {IEnumerable} from 'linq-to-typescript' import {Map} from 'lodash' import {RectangleNode} from '../core/geometry/RTree/RectangleNode' import {Curve} from '../math/geometry/curve' impor...
msaglJS/msagl-js
src/routing/rectilinear/TransientGraphUtility.ts
import {String} from 'typescript-string-operations' import { Point, Rectangle, CompassVector, Direction, GeomConstants, LineSegment, } from '../../math/geometry' // import {Assert} from '../../utils/assert' import {closeDistEps} from '../../utils/compare' import {TollFreeVisibilityEdge} from '../visibility/...
msaglJS/msagl-js
src/layout/layered/ordering/AdjacentSwapsWithConstraints.ts
import {LayerArrays} from '../LayerArrays' import {ProperLayeredGraph} from '../ProperLayeredGraph' import {ConstrainedOrdering} from './ConstrainedOrdering' import {LayerInfo} from './LayerInfo' // import {Assert} from './../../../utils/assert' import {randomInt} from '../../../utils/random' export class AdjacentSwaps...
msaglJS/msagl-js
test/math/geometry/bezierSeg.spec.ts
<gh_stars>10-100 import {Point} from '../../../src' import {BezierSeg} from '../../../src/math/geometry/bezierSeg' import {closeDistEps} from '../../../src/utils/compare' describe('bezier', () => { test('bezier control points', () => { const b = [ new Point(0, 0), new Point(1, 0), new Point(1, ...
msaglJS/msagl-js
src/routing/spline/bundling/BundleBase.ts
// using System; // using System.Collections.Generic; // using System.Linq; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using System.Diagnostics; // namespace Microsoft.Msagl.Routing.Spline.Bundling { // internal class BundleBase { // // only one of those is ...
msaglJS/msagl-js
src/routing/spline/bundling/MetroGraphData.ts
// using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Diagnostics.CodeAnalysis; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; //...
msaglJS/msagl-js
drawing/dotparser.ts
<reponame>msaglJS/msagl-js import parse from 'dotparser' import * as fs from 'fs' import parseColor from 'parse-color' import {Edge, Graph, LayerDirectionEnum, Node} from '../src' import {Label} from '../src/structs/label' import {ArrowTypeEnum} from './arrawTypeEnum' import {Color} from './color' import {DrawingEdge} ...
msaglJS/msagl-js
src/math/geometry/ellipse.ts
import {ICurve} from './icurve' import {Curve} from './curve' import {Rectangle} from './rectangle' import {PN, ParallelogramNode} from './parallelogramNode' import {Point} from './point' import {GeomConstants} from './geomConstants' import {PlaneTransformation} from './planeTransformation' import {ClosestPointOnCurve}...
msaglJS/msagl-js
src/routing/BundlingSettings.ts
export class BundlingSettings { // the default value of CapacityOverflowCoefficient public static DefaultCapacityOverflowCoefficientMultiplier = 1000 capacityOverflowCoefficient: number = BundlingSettings.DefaultCapacityOverflowCoefficientMultiplier // this number is muliplied by the overflow penalty cost...
msaglJS/msagl-js
src/routing/spline/bundling/BundleBasesCalculator.ts
<gh_stars>10-100 // using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Routing; // using Microsoft.Msagl.DebugHelpers; // using Microsoft.Msagl.Core.La...
msaglJS/msagl-js
src/routing/visibility/Diagonal.ts
// using System; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // namespace Microsoft.Msagl.Routing.Visibility { // internal class Diagonal { // public override string ToString() { // return String.Format(System.Globalization.CultureInfo.InvariantCulture...
msaglJS/msagl-js
src/routing/rectilinear/ScanDirection.ts
import {CompassVector} from '../../math/geometry/compassVector' import {Direction} from '../../math/geometry/direction' import {Point} from '../../math/geometry/point' // import {Assert} from '../../utils/assert' import {SegmentBase} from '../visibility/SegmentBase' import {PointComparer} from './PointComparer' import ...
msaglJS/msagl-js
src/structs/BasicGraph.ts
<gh_stars>10-100 import {BasicGraphOnEdges} from './basicGraphOnEdges' import {IEdge} from './iedge' export class BasicGraph< TNode, TEdge extends IEdge, > extends BasicGraphOnEdges<TEdge> { nodes: TNode[] constructor(edges: TEdge[], numberOfVerts: number) { super() this.SetEdges(edges, numberOfVerts) ...
msaglJS/msagl-js
src/utils/setOperations.ts
export function subSets<T>(a: Set<T>, b: Set<T>): Set<T> { const ret = new Set<T>() for (const u of a) { if (!b.has(u)) ret.add(u) } return ret } export function addSets<T>(a: Set<T>, b: Set<T>): Set<T> { const ret = new Set<T>(a) for (const v of b) ret.add(v) return ret }
msaglJS/msagl-js
src/routing/ConstrainedDelaunayTriangulation/Cdt.ts
<filename>src/routing/ConstrainedDelaunayTriangulation/Cdt.ts /* Following "Sweep-line algorithm for constrained Delaunay triangulation", by <NAME> Zalik */ //triangulates the space between point, line segment and polygons of the Delaunay fashion import {from, IEnumerable} from 'linq-to-typescript' import {GeomConstant...
msaglJS/msagl-js
src/routing/spline/coneSpanner/RightIntersectionEvent.ts
import {Point} from '../../..' import {PolylinePoint} from '../../../math/geometry/polylinePoint' import {ConeRightSide} from './ConeRightSide' import {SweepEvent} from './SweepEvent' // right here means an intersection of a right cone side with an obstacle edge export class RightIntersectionEvent extends SweepEvent ...
msaglJS/msagl-js
src/routing/rectilinear/nudging/LinkedPoint.ts
<gh_stars>10-100 import {Point} from '../../../math/geometry/point' // import {CompassVector} from '../../../math/geometry/compassVector' // import {Assert} from '../../../utils/assert' /// represents a segment of a path export class LinkedPoint { Point: Point Next: LinkedPoint constructor(point: Point) { ...
msaglJS/msagl-js
src/math/geometry/curveFactory.ts
import {Ellipse} from './ellipse' import {Curve} from './curve' import {Point} from './point' import {LineSegment} from './lineSegment' import {PlaneTransformation} from './planeTransformation' import {ICurve} from './icurve' type RoundedRectRadii = { radX: number radY: number } export class CurveFactory { static...
msaglJS/msagl-js
src/layout/layered/layering/NetworkSimplexForGeneralGraph.ts
import {from} from 'linq-to-typescript' import {BasicGraph} from '../../../structs/BasicGraph' import {BasicGraphOnEdges} from '../../../structs/basicGraphOnEdges' import {CancelToken} from '../../../utils/cancelToken' import {GeomNode} from '../../core/geomNode' import {PolyIntEdge} from '../polyIntEdge' import {GetCo...
msaglJS/msagl-js
src/routing/rectilinear/obstacle.ts
<reponame>msaglJS/msagl-js import {Port} from '../../layout/core/port' import {CompassVector} from '../../math/geometry/compassVector' import {Curve} from '../../math/geometry/curve' import {GeomConstants} from '../../math/geometry/geomConstants' import {Point, TriangleOrientation} from '../../math/geometry/point' impo...
msaglJS/msagl-js
src/routing/rectilinear/VisibilityGraphGenerator.ts
// Scan direction is parallel to the sweepline which moves in the perpendicular direction; // i.e. scan direction is "sideways" along the sweepline. We also have lookahead scans // that enqueue events along the scan-primary coordinate (in the direction of the scan, i.e. // X for Hscan, Y for Vscan) to handle refle...
msaglJS/msagl-js
src/routing/spline/coneSpanner/BrokenConeSide.ts
import {Point} from '../../..' import {PolylinePoint} from '../../../math/geometry/polylinePoint' import {ConeSide} from './ConeSide' // represents a cone side that is broken by the obstacle export class BrokenConeSide extends ConeSide { // point where it starts start: Point get Start(): Point { return th...
msaglJS/msagl-js
src/layout/layered/CycleRemoval.ts
import {IEdge} from '../../structs/iedge' import {BasicGraphOnEdges} from '../../structs/basicGraphOnEdges' import {IntPair} from '../../utils/IntPair' import {IntPairSet} from '../../utils/IntPairSet' // import {Assert} from '../../utils/assert' import {Stack} from 'stack-typescript' enum VertStatus { NotVisited, ...
msaglJS/msagl-js
test/math/geometry/convexHull.spec.ts
import {Point} from '../../../src' import {Polyline, Curve, PointLocation} from '../../../src/math/geometry' import {ConvexHull} from '../../../src/math/geometry/convexHull' import {DebugCurve} from '../../../src/math/geometry/debugCurve' import {SvgDebugWriter} from '../../utils/svgDebugWriter' test('repeated points'...
msaglJS/msagl-js
src/routing/spline/bundling/BundleInfo.ts
<reponame>msaglJS/msagl-js // using System.Collections.Generic; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using System.Diagnostics; // using System; // using Microsoft.Msagl.DebugHelpers; // using Micros...
msaglJS/msagl-js
test/structs/graphs.spec.ts
<gh_stars>10-100 import {Graph, Node, Edge, Rectangle} from '../../src' import {shallowConnectedComponents} from '../../src/structs/graph' test('graph create', () => { const g = new Graph() expect(g.shallowNodeCount).toBe(0) expect(g.edgeCount).toBe(0) const n = new Node('n') g.addNode(n) expect(g.shallowN...
msaglJS/msagl-js
src/layout/layered/ordering/Ordering.ts
// Following "A technique for Drawing Directed Graphs" of Gansner, Koutsofios, North and Vo import {copyTo} from '../../../utils/copy' import {randomInt} from '../../../utils/random' import {LayerArrays} from '../LayerArrays' import {ProperLayeredGraph} from '../ProperLayeredGraph' import {SugiyamaLayoutSettings} from...
msaglJS/msagl-js
src/routing/spline/bundling/Station.ts
// using System; // using System.Collections; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using System.Runtime.InteropServices; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Mi...
msaglJS/msagl-js
src/routing/rectilinear/LowReflectionEvent.ts
<filename>src/routing/rectilinear/LowReflectionEvent.ts import {Point} from '../../math/geometry/point' import {LowObstacleSide} from './BasicObstacleSide' import {BasicReflectionEvent} from './basicReflectionEvent' export class LowReflectionEvent extends BasicReflectionEvent { Side: LowObstacleSide constructor( ...
msaglJS/msagl-js
src/routing/visibility/TollFreeVisibilityEdge.ts
<reponame>msaglJS/msagl-js<gh_stars>10-100 import {VisibilityEdge} from './VisibilityEdge' import {VisibilityVertex} from './VisibilityVertex' export class TollFreeVisibilityEdge extends VisibilityEdge { static constructorVV( source: VisibilityVertex, target: VisibilityVertex, ): TollFreeVisibilityEdge { ...
msaglJS/msagl-js
test/math/geometry/RTree/RTree.spec.ts
import {from} from 'linq-to-typescript' import {Rectangle, Point} from '../../../../src' import {mkRTree} from '../../../../src/math/geometry/RTree/RTree' import {randomInt} from '../../../../src/utils/random' test('RTreeQuery_IncrementalRectangles', () => { const RectsCount = 100 const RegionSize = 100 const Re...
msaglJS/msagl-js
src/routing/spline/bundling/PointPairOrder.ts
<filename>src/routing/spline/bundling/PointPairOrder.ts // using System.Collections.Generic; // namespace Microsoft.Msagl.Routing.Spline.Bundling { // internal class PointPairOrder { // //order for node u of edge u->v // internal Array<Metroline> Metrolines = new Array<Metroline>(); // int...
msaglJS/msagl-js
src/math/geometry/polylinePoint.ts
import {Point} from './point' import {Polyline} from './polyline' export class PolylinePoint { point: Point next: PolylinePoint prev: PolylinePoint polyline: Polyline get nextOnPolyline(): PolylinePoint { return this.polyline.next(this) } get prevOnPolyline(): PolylinePoint { return this.polylin...
msaglJS/msagl-js
src/routing/RelaxedPolylinePoint.ts
<filename>src/routing/RelaxedPolylinePoint.ts // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // namespace Microsoft.Msagl.Routing { // internal class RelaxedPolylinePoint { // private PolylinePoint polylinePoint; // internal PolylinePoint PolylinePoint { //...
msaglJS/msagl-js
test/routing/spline/coneSpanner/LineSweeper.spec.ts
import {Point} from '../../../../src' import {LineSegment, Polyline} from '../../../../src/math/geometry' import {DebugCurve} from '../../../../src/math/geometry/debugCurve' import {TriangleOrientation} from '../../../../src/math/geometry/point' import {LineSweeper} from '../../../../src/routing/spline/coneSpanner/Line...
msaglJS/msagl-js
src/routing/visibility/VisibilityGraph.ts
<gh_stars>10-100 import {Point} from '../../math/geometry/point' import {PolylinePoint} from '../../math/geometry/polylinePoint' // import {Assert} from '../../utils/assert' import {PointMap} from '../../utils/PointMap' import {VisibilityEdge} from './VisibilityEdge' import {VisibilityVertex} from './VisibilityVertex' ...
msaglJS/msagl-js
drawing/shapeEnum.ts
export enum ShapeEnum { Diamond, Ellipse, Box, Circle, Record, Plaintext, Point, Mdiamond, Msquare, Polygon, DoubleCircle, House, InvHouse, Parallelogram, Octagon, TripleOctagon, Triangle, Trapezium, DrawFromGeometry, Hexagon, }
msaglJS/msagl-js
src/layout/layered/layering/longestPathLayering.ts
import {LayerCalculator} from './layerCalculator' import {NetworkEdge} from './networkEdge' import {BasicGraphOnEdges} from './../../../structs/basicGraphOnEdges' import {TopologicalSort} from './../../../math/graphAlgorithms/topologicalSort' // Layering the DAG by longest path export class LongestPathLayering implemen...
msaglJS/msagl-js
src/routing/rectilinear/nudging/Path.ts
import {StringBuilder} from 'typescript-string-operations' import {Point} from '../../../math/geometry/point' import {EdgeGeometry} from '../../../layout/core/edgeGeometry' // import {Assert} from '../../../utils/assert' import {LinkedPoint} from './LinkedPoint' import {PathEdge} from './PathEdge' /// represents the ...
msaglJS/msagl-js
src/routing/rectilinear/PortManager.ts
<gh_stars>10-100 // // PortManager.cs // MSAGL class for Port management for Rectilinear Edge Routing. // /// <summary> /// This stores information mapping the App-level Ports (e.g. FloatingPort, RelativeFloatingPort, /// and MultiLocationFloatingPort) to the router's BasicScanPort subclasses (ObstaclePort and Fre...
msaglJS/msagl-js
src/routing/interactiveObstacleCalculator.ts
<reponame>msaglJS/msagl-js<filename>src/routing/interactiveObstacleCalculator.ts<gh_stars>10-100 import {ConvexHull} from '../math/geometry/convexHull' import {Curve} from '../math/geometry/curve' import {GeomConstants} from '../math/geometry/geomConstants' import {ICurve} from '../math/geometry/icurve' import {Point, ...
msaglJS/msagl-js
src/routing/SingleSourceMultipleTargetsShortestPathOnVisibilityGraph.ts
// using System; // using System.Collections.Generic; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Routing.Visibility; // namespace Microsoft.Msagl.Routing { // internal class SingleSourceMultipleTargetsShortestPathOnV...
msaglJS/msagl-js
src/structs/edge.ts
<filename>src/structs/edge.ts import {Entity} from './entity' import {Label} from './label' import {Node} from './node' export class Edge extends Entity { source: Node target: Node constructor(s: Node, t: Node) { super() this.source = s this.target = t if (s != t) { s.outEdges.add(this) ...
msaglJS/msagl-js
src/math/projectionSolver/SolverShell.ts
<filename>src/math/projectionSolver/SolverShell.ts /// just a convenient interface to the real solver import {from, IEnumerable} from 'linq-to-typescript' import {RealNumberSpan} from '../../utils/RealNumberSpan' import {Solution} from './Solution' import {Solver} from './Solver' import {Variable} from './Variable' i...
msaglJS/msagl-js
src/routing/visibility/PointVisibilityCalculator.ts
<filename>src/routing/visibility/PointVisibilityCalculator.ts // // following "Visibility Algorithms in the Plane", Ghosh // internal class PointVisibilityCalculator { // activeEdgeComparer: ActiveEdgeComparerWithRay; // RBTree<PolylinePoint> activeSidesTree; // // A mapping from sides to their RBNodes // Map...
msaglJS/msagl-js
src/routing/rectilinear/FreePoint.ts
<gh_stars>10-100 /// <summary> /// This is a point on a path that is not associated with an obstacle, such as /// a port for the end of a dragged path, or a waypoint. import { Point, Rectangle, CompassVector, Direction, LineSegment, } from '../../math/geometry' // import {Assert} from '../../utils/assert'...
msaglJS/msagl-js
src/routing/spline/bundling/IMetroMapOrderingAlgorithm.ts
// using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; // using Microsoft.Msagl.DebugHelpers; // namespace Microsoft.Msagl.Routing.Spline.Bundl...
msaglJS/msagl-js
src/routing/visibility/VisibilityEdge.ts
<gh_stars>10-100 import {Point} from './../../math/geometry/point' // import {Assert} from './../../utils/assert' import {String} from 'typescript-string-operations' import {VisibilityVertex} from './VisibilityVertex' // an edge connecting two VisibilityVertices export class VisibilityEdge { LengthMultiplier = 1 ...
msaglJS/msagl-js
test/layout/mds/AllPairsDistances.spec.ts
import { Graph, Edge, CurveFactory, Point, GeomEdge, GeomNode, Node, } from '../../../src' import {GeomObject} from '../../../src/layout/core/geomObject' import {AllPairsDistances} from '../../../src/layout/mds/AllPairsDistances' import {createGeometry} from '../../utils/testUtils' test('all pairs distan...
msaglJS/msagl-js
src/layout/layered/Balancing.ts
<reponame>msaglJS/msagl-js<filename>src/layout/layered/Balancing.ts // balances the layers by moving vertices with import {from} from 'linq-to-typescript' import {Algorithm} from '../../utils/algorithm' import {CancelToken} from '../../utils/cancelToken' import {IntPair} from '../../utils/IntPair' import {BasicGraphOn...
msaglJS/msagl-js
src/routing/ShapeCreatorForRoutingToParents.ts
<filename>src/routing/ShapeCreatorForRoutingToParents.ts // // written in assumption of a single parent // // < // export class ShapeCreatorForRoutingToParents { // static GetShapes(inParentEdges: IEnumerable<Edge>, outParentEdges: Array<Edge>): IEnumerable<Shape> { // let nodesToShapes = new Map<Node, Shape>();...
msaglJS/msagl-js
src/math/projectionSolver/Solver.ts
/// A Solver is the driving class that collects Variables and Constraints and then generates a /// solution that minimally satisfies the constraints. import { IEnumerable, InvalidOperationException, ArgumentOutOfRangeException, from, } from 'linq-to-typescript' // import {Assert} from '../../utils/assert' im...
msaglJS/msagl-js
test/utils/dotparser.spec.ts
<reponame>msaglJS/msagl-js import {join} from 'path' import {Color} from '../../drawing/color' import {parseDotGraph, parseDotString} from '../../drawing/dotparser' import {DrawingNode} from '../../drawing/drawingNode' import {sortedList} from '../layout/sortedBySizeListOfgvFiles' test('all gv files list ', () => { c...
msaglJS/msagl-js
test/routing/rectilinear/RectilinearEdgeRouter.spec.ts
import {join} from 'path' import { GeomGraph, Graph, Size, CurveFactory, Point, GeomEdge, Edge, ICurve, GeomNode, Node, } from '../../../src' import {DrawingGraph} from '../../../drawing/drawingGraph' import {GeomObject} from '../../../src/layout/core/geomObject' import {EdgeRoutingMode} from '../.....
msaglJS/msagl-js
src/routing/shape.ts
<gh_stars>10-100 import {IEnumerable, from} from 'linq-to-typescript' import {Queue} from 'queue-typescript' import {Port} from '../layout/core/port' import {ICurve} from '../math/geometry/icurve' import {Rectangle} from '../math/geometry/rectangle' export class Shape { private parents: Set<Shape> = new Set<Shape>()...
msaglJS/msagl-js
test/math/graphAlgorithms/MinimumSpanningTreeByPrim.spec.ts
import {MinimumSpanningTreeByPrim} from '../../../src/math/graphAlgorithms/MinimumSpanningTreeByPrim' import {mkGraphOnEdgesArray} from '../../../src/structs/basicGraphOnEdges' import {IntPair} from '../../../src/utils/IntPair' test('rombus with diagal', () => { const edges = [ new IntPair(0, 1), new IntPair...
msaglJS/msagl-js
src/routing/visibility/ActiveDiagonalComparerWithRay.ts
<gh_stars>10-100 // using System.Collections.Generic; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core; // namespace Microsoft.Msagl.Routing.Visibility { // internal class ActiveDiagonalComparerWithRay: IComparer < Diagonal > { // Point p...
msaglJS/msagl-js
src/math/projectionSolver/ConstraintVector.ts
<gh_stars>10-100 import {Stack} from 'stack-typescript' // import {Assert} from '../../utils/assert' import {Constraint} from './Constraint' import {DfDvNode} from './DfDvNode' import {Parameters} from './Parameters' export class ConstraintVector { Vector: Constraint[] get IsEmpty(): boolean { return this.Vect...
msaglJS/msagl-js
src/layout/core/geomNode.ts
<filename>src/layout/core/geomNode.ts<gh_stars>10-100 // A node of a GeomGraph // import {Assert} from './../../utils/assert' import {ICurve} from './../../math/geometry/icurve' import {Rectangle} from './../../math/geometry/rectangle' import {Point} from './../../math/geometry/point' import {CurveFactory} from './../....