corresponds to Interval
4 | export interface IRectangle {
5 | add(point: P): void
6 |
7 | add_rect(rectangle: IRectangle
): IRectangle
8 |
9 | contains_point(point: P): boolean
10 |
11 | contains_rect(rect: IRectangle
): boolean
12 |
13 | intersection_rect(rectangle: IRectangle
): IRectangle
14 |
15 | intersects_rect(rectangle: IRectangle
): boolean
16 |
17 | area: number
18 |
19 | contains_point_radius(p: P, radius: number): boolean
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/src/math/geometry/RTree/hitTestBehavior.ts:
--------------------------------------------------------------------------------
1 | //continue or stop the hit tree traversal
2 | export enum HitTestBehavior {
3 | Continue,
4 | Stop,
5 | }
6 |
--------------------------------------------------------------------------------
/modules/core/src/math/geometry/direction.ts:
--------------------------------------------------------------------------------
1 | // enumerates the compass directions
2 | export enum Direction {
3 | None = 0,
4 |
5 | North = 1,
6 |
7 | East = 2,
8 |
9 | South = 4,
10 |
11 | West = 8,
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/math/geometry/geomConstants.ts:
--------------------------------------------------------------------------------
1 | export class GeomConstants {
2 | static distanceEpsilonPrecision = 6
3 |
4 | static mult = Math.pow(10, 6)
5 | static defaultLeafBoxesOffset = 0.5
6 | static lineSegmentThreshold = 0.05
7 | static intersectionEpsilon = 0.0001
8 | static distanceEpsilon = Math.pow(10, -GeomConstants.distanceEpsilonPrecision)
9 | static squareOfDistanceEpsilon = Math.pow(10, -GeomConstants.distanceEpsilonPrecision * 2)
10 | static tolerance = 1.0e-8
11 | }
12 |
--------------------------------------------------------------------------------
/modules/core/src/math/geometry/index.ts:
--------------------------------------------------------------------------------
1 | export {interpolateICurve, Curve, PointLocation} from './curve'
2 | export {CurveFactory} from './curveFactory'
3 | export {Point} from './point'
4 | export {ICurve, parameterSpan} from './icurve'
5 | export {Rectangle, Size, RectJSON} from './rectangle'
6 | export {Polyline} from './polyline'
7 | export {CompassVector} from './compassVector'
8 | export {Direction} from './direction'
9 | export {LineSegment} from './lineSegment'
10 | export {GeomConstants} from './geomConstants'
11 |
--------------------------------------------------------------------------------
/modules/core/src/math/geometry/linearSystem.ts:
--------------------------------------------------------------------------------
1 | // solves a linear system of two equations with two unknown variables
2 | export class LinearSystem2 {
3 | static eps = 1.0e-8
4 |
5 | static solve(a00: number, a01: number, b0: number, a10: number, a11: number, b1: number): {x: number; y: number} | undefined {
6 | const d = a00 * a11 - a10 * a01
7 |
8 | if (Math.abs(d) < LinearSystem2.eps) {
9 | return
10 | }
11 |
12 | return {
13 | x: (b0 * a11 - b1 * a01) / d,
14 | y: (a00 * b1 - a10 * b0) / d,
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/src/math/geometry/rectanglePacking/PackingConstants.ts:
--------------------------------------------------------------------------------
1 | // Constants used by OptimalRectanglePacking
2 | export class PackingConstants {
3 | // The greeks thought the GoldenRatio was a good aspect ratio: Phi = (1 + Math.Sqrt(5)) / 2
4 | // we also use this internally in our golden section search
5 | static GoldenRatio: number = (1 + Math.sqrt(5)) / 2
6 |
7 | // equiv to 1 - (1/Phi) where Phi is the Golden Ratio: i.e. the smaller of the two sections
8 | // if you divide a unit length by the golden ratio
9 | static GoldenRatioRemainder: number = 2 - PackingConstants.GoldenRatio
10 | }
11 |
--------------------------------------------------------------------------------
/modules/core/src/math/projectionSolver/BlockVector.ts:
--------------------------------------------------------------------------------
1 | import {Block} from './Block'
2 |
3 | export class BlockVector {
4 | Vector: Array
5 | get Count(): number {
6 | return this.Vector.length
7 | }
8 |
9 | item(index: number): Block {
10 | return this.Vector[index]
11 | }
12 |
13 | constructor() {
14 | this.Vector = new Array()
15 | }
16 |
17 | Add(block: Block) {
18 | block.VectorIndex = this.Vector.length
19 | this.Vector.push(block)
20 | /*Assert.assert(
21 | this.Vector[block.VectorIndex] === block,
22 | 'Inconsistent block.VectorIndex',
23 | )*/
24 | }
25 |
26 | Remove(block: Block) {
27 | /*Assert.assert(
28 | this.Vector[block.VectorIndex] === block,
29 | 'Inconsistent block.VectorIndex',
30 | )*/
31 | const swapBlock = this.Vector[this.Vector.length - 1]
32 | this.Vector[block.VectorIndex] = swapBlock
33 | swapBlock.VectorIndex = block.VectorIndex
34 | this.Vector.pop()
35 | }
36 |
37 | toString(): string {
38 | return this.Vector.toString()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/modules/core/src/math/projectionSolver/SolverAlgorithm.ts:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // (c) Microsoft Corporation. All rights reserved.
4 | //
5 |
6 | // MSAGL class for algorithm enumeration for Projection Solver.
7 |
8 | // --------------------------------------------------------------------------------------------------------------------
9 |
10 | export enum SolverAlgorithm {
11 | // Iterative Project/Split only.
12 |
13 | ProjectOnly,
14 |
15 | // Diagonally-scaled gradient projection/Qpsc (Quadratic Programming for Separation Constraints).
16 |
17 | QpscWithScaling,
18 |
19 | // Gradient projection/Qpsc (Quadratic Programming for Separation Constraints) without diagonal scaling.
20 |
21 | QpscWithoutScaling,
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/src/routing/ClusterBoundaryPort.ts:
--------------------------------------------------------------------------------
1 | import {ICurve, Point, Polyline} from '../math/geometry'
2 | import {RelativeFloatingPort} from '../layout/core/relativeFloatingPort'
3 |
4 | export class ClusterBoundaryPort extends RelativeFloatingPort {
5 | loosePolyline: Polyline
6 |
7 | get LoosePolyline(): Polyline {
8 | return this.loosePolyline
9 | }
10 | set LoosePolyline(value: Polyline) {
11 | this.loosePolyline = value
12 | }
13 |
14 | // constructor
15 |
16 | public constructor(curveDelegate: () => ICurve, centerDelegate: () => Point, locationOffset: Point = new Point(0, 0)) {
17 | super(curveDelegate, centerDelegate, locationOffset)
18 | }
19 |
20 | // constructor
21 |
22 | public static mk(curveDelegate: () => ICurve, centerDelegate: () => Point) {
23 | return new ClusterBoundaryPort(curveDelegate, centerDelegate)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/modules/core/src/routing/ConstrainedDelaunayTriangulation/CdtFront.ts:
--------------------------------------------------------------------------------
1 | // using Microsoft.Msagl.Core.DataStructures;
2 |
3 | // namespace Microsoft.Msagl.Routing.ConstrainedDelaunayTriangulation {
4 | // internal class CdtFront {
5 | // RBTree front = new RBTree((a, b) => a.point.x.CompareTo(b.point.x));
6 |
7 | // public CdtFront(CdtSite p_1, CdtSite p0, CdtSite p_2) {
8 |
9 | // }
10 | // }
11 | // }
12 |
--------------------------------------------------------------------------------
/modules/core/src/routing/ConstrainedDelaunayTriangulation/PerimeterEdge.ts:
--------------------------------------------------------------------------------
1 | import {CdtEdge} from './CdtEdge'
2 | import {CdtSite} from './CdtSite'
3 |
4 | export class PerimeterEdge {
5 | Start: CdtSite
6 |
7 | End: CdtSite
8 |
9 | Prev: PerimeterEdge
10 |
11 | Next: PerimeterEdge
12 |
13 | Edge: CdtEdge
14 |
15 | constructor(edge: CdtEdge) {
16 | /*Assert.assert(
17 | edge.CcwTriangle == null || edge.CwTriangle == null ,
18 | 'one of the edge triangles has to be null',
19 | )*/
20 | this.Edge = edge
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/src/routing/EdgeRoutingMode.ts:
--------------------------------------------------------------------------------
1 | // defines the way edges are routed
2 | export enum EdgeRoutingMode {
3 | Spline,
4 |
5 | SplineBundling,
6 |
7 | StraightLine,
8 |
9 | SugiyamaSplines,
10 |
11 | Rectilinear,
12 |
13 | RectilinearToCenter,
14 |
15 | None,
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/src/routing/RelativeShape.ts:
--------------------------------------------------------------------------------
1 | // A shape wrapping an ICurve delegate, providing additional information.
2 |
3 | import {GeomNode} from '../layout/core'
4 | import {ICurve} from '../math/geometry'
5 | import {Shape} from './shape'
6 |
7 | export class RelativeShape extends Shape {
8 | // The curve of the shape.
9 | node: GeomNode
10 | public get BoundaryCurve(): ICurve {
11 | return this.node.boundaryCurve
12 | }
13 | public set BoundaryCurve(value: ICurve) {
14 | if (value) throw new Error('Cannot set BoundaryCurve directly for RelativeShape')
15 | }
16 |
17 | curveDelegate: () => ICurve
18 |
19 | // Constructor taking the ID and the curve delegate for the shape.
20 |
21 | constructor(node: GeomNode) {
22 | super(null)
23 | this.node = node
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/modules/core/src/routing/TightLooseCouple.ts:
--------------------------------------------------------------------------------
1 | // an utility class to keep different polylines created around a shape
2 |
3 | import {Polyline} from '../math/geometry'
4 | import {Shape} from './shape'
5 |
6 | export class TightLooseCouple {
7 | private tightPoly: Polyline
8 | get TightPolyline(): Polyline {
9 | return this.tightPoly
10 | }
11 | set TightPolyline(value: Polyline) {
12 | this.tightPoly = value
13 | }
14 |
15 | LooseShape: Shape
16 |
17 | static mk(tightPolyline: Polyline, looseShape: Shape, distance: number): TightLooseCouple {
18 | const ret = new TightLooseCouple()
19 | ret.TightPolyline = tightPolyline
20 | ret.LooseShape = looseShape
21 | ret.Distance = distance
22 | return ret
23 | }
24 |
25 | // the loose polyline has been created with this distance
26 | Distance: number
27 | toString(): string {
28 | return (
29 | (this.TightPolyline == null ? 'null' : this.TightPolyline.toString().substring(0, 5)) +
30 | ',' +
31 | (this.LooseShape == null ? 'null' : this.LooseShape.toString().substring(0, 5))
32 | )
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/AxisCoordinateEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../math/geometry/point'
2 | import {SweepEvent} from '../spline/coneSpanner/SweepEvent'
3 |
4 | export class AxisCoordinateEvent extends SweepEvent {
5 | private site: Point
6 | constructor(p: Point) {
7 | super()
8 | this.site = p
9 | }
10 |
11 | get Site(): Point {
12 | return this.site
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/BasicVertexEvent.ts:
--------------------------------------------------------------------------------
1 | import {PolylinePoint} from '../../math/geometry/polylinePoint'
2 | import {VertexEvent} from '../spline/coneSpanner/VertexEvent'
3 | import {Obstacle} from './obstacle'
4 |
5 | export class BasicVertexEvent extends VertexEvent {
6 | // This is just a subclass to carry the Obstacle object in addition to the Polyline.
7 | Obstacle: Obstacle
8 | constructor(obstacle: Obstacle, p: PolylinePoint) {
9 | super(p)
10 | this.Obstacle = obstacle
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/HighReflectionEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../math/geometry/point'
2 | import {HighObstacleSide} from './BasicObstacleSide'
3 | import {BasicReflectionEvent} from './basicReflectionEvent'
4 |
5 | export class HighReflectionEvent extends BasicReflectionEvent {
6 | Side: HighObstacleSide
7 |
8 | constructor(previousSite: BasicReflectionEvent, targetSide: HighObstacleSide, site: Point) {
9 | super(previousSite.ReflectingObstacle, targetSide.Obstacle, site)
10 | this.Side = targetSide
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/LowReflectionEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../math/geometry/point'
2 | import {LowObstacleSide} from './BasicObstacleSide'
3 | import {BasicReflectionEvent} from './basicReflectionEvent'
4 |
5 | export class LowReflectionEvent extends BasicReflectionEvent {
6 | Side: LowObstacleSide
7 |
8 | constructor(previousSite: BasicReflectionEvent, targetSide: LowObstacleSide, site: Point) {
9 | super(previousSite.ReflectingObstacle, targetSide.obstacle, site)
10 | this.Side = targetSide
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/MiscVertexEvents.ts:
--------------------------------------------------------------------------------
1 | import {PolylinePoint} from '../../math/geometry/polylinePoint'
2 | import {BasicVertexEvent} from './BasicVertexEvent'
3 | import {Obstacle} from './obstacle'
4 |
5 | export class LowBendVertexEvent extends BasicVertexEvent {
6 | constructor(obstacle: Obstacle, p: PolylinePoint) {
7 | super(obstacle, p)
8 | }
9 | }
10 | export class HighBendVertexEvent extends BasicVertexEvent {
11 | constructor(obstacle: Obstacle, p: PolylinePoint) {
12 | super(obstacle, p)
13 | }
14 | }
15 |
16 | export class CloseVertexEvent extends BasicVertexEvent {
17 | constructor(obstacle: Obstacle, p: PolylinePoint) {
18 | super(obstacle, p)
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/OpenVertexEvent.ts:
--------------------------------------------------------------------------------
1 | import {PolylinePoint} from '../../math/geometry/polylinePoint'
2 | import {BasicVertexEvent} from './BasicVertexEvent'
3 | import {Obstacle} from './obstacle'
4 |
5 | export class OpenVertexEvent extends BasicVertexEvent {
6 | constructor(obstacle: Obstacle, p: PolylinePoint) {
7 | super(obstacle, p)
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/OverlapConvexHull.ts:
--------------------------------------------------------------------------------
1 | // This stores the location and type of a Port.
2 |
3 | import {Polyline} from '../../math/geometry/polyline'
4 | import {Obstacle} from './obstacle'
5 |
6 | export class OverlapConvexHull {
7 | Polyline: Polyline
8 |
9 | // This is some arbitrary obstacle inside the convex hull so we qualify Select().Where() so we
10 | // don't get the CH duplicated in the scanline etc. enumerations.
11 |
12 | PrimaryObstacle: Obstacle
13 |
14 | Obstacles: Array
15 |
16 | constructor(polyline: Polyline, obstacles: Iterable) {
17 | this.Polyline = polyline
18 | this.Obstacles = Array.from(obstacles)
19 | this.PrimaryObstacle = this.Obstacles[0]
20 | Obstacle.RoundVerticesAndSimplify(this.Polyline)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/PointAndCrossings.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../math/geometry/point'
2 | import {GroupBoundaryCrossing} from './GroupBoundaryCrossing'
3 |
4 | // MSAGL class for a Point and any Group boundary crossings at that Point, for Rectilinear Edge Routing.
5 | export class PointAndCrossings {
6 | Location: Point
7 | Crossings: Array = []
8 |
9 | constructor(loc: Point, crossings: Array) {
10 | this.Location = loc
11 | this.Crossings = crossings
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/VisibilityVertexRectiline.ts:
--------------------------------------------------------------------------------
1 | import {CompassVector} from '../../math/geometry/compassVector'
2 | import {Point} from '../../math/geometry/point'
3 | import {VisibilityVertex} from '../visibility/VisibilityVertex'
4 | import {VertexEntry} from './VertexEntry'
5 |
6 | export class VisibilityVertexRectilinear extends VisibilityVertex {
7 | constructor(point: Point) {
8 | super(point)
9 | }
10 |
11 | VertexEntries: VertexEntry[]
12 | SetVertexEntry(entry: VertexEntry) {
13 | if (this.VertexEntries == null) {
14 | this.VertexEntries = new Array(4)
15 | }
16 |
17 | this.VertexEntries[CompassVector.ToIndex(entry.Direction)] = entry
18 | }
19 |
20 | RemoveVertexEntries() {
21 | this.VertexEntries = null
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/nudging/AxisEdgeHighPointEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 | import {SweepEvent} from '../../spline/coneSpanner/SweepEvent'
3 | import {AxisEdge} from './AxisEdge'
4 |
5 | export class AxisEdgeHighPointEvent extends SweepEvent {
6 | site: Point
7 |
8 | AxisEdge: AxisEdge
9 |
10 | constructor(edge: AxisEdge, point: Point) {
11 | super()
12 | this.site = point
13 | this.AxisEdge = edge
14 | }
15 |
16 | get Site(): Point {
17 | return this.site
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/nudging/AxisEdgeLowPointEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 | import {SweepEvent} from '../../spline/coneSpanner/SweepEvent'
3 | import {AxisEdge} from './AxisEdge'
4 |
5 | export class AxisEdgeLowPointEvent extends SweepEvent {
6 | site: Point
7 |
8 | AxisEdge: AxisEdge
9 | public constructor(edge: AxisEdge, point: Point) {
10 | super()
11 | this.site = point
12 | this.AxisEdge = edge
13 | }
14 |
15 | get Site(): Point {
16 | return this.site
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/nudging/AxisEdgesContainer.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 |
3 | import {AxisEdge} from './AxisEdge'
4 |
5 | export class AxisEdgesContainer {
6 | edges: Set = new Set()
7 |
8 | get Edges(): Iterable {
9 | return this.edges
10 | }
11 |
12 | // it is not necessarely the upper point but some point above the source
13 |
14 | UpPoint: Point
15 |
16 | AddEdge(edge: AxisEdge) {
17 | this.UpPoint = edge.TargetPoint
18 | /*Assert.assert(!this.edges.has(edge))*/
19 | this.edges.add(edge)
20 | }
21 |
22 | constructor(source: Point) {
23 | this.Source = source
24 | }
25 |
26 | Source: Point
27 | RemoveAxis(edge: AxisEdge) {
28 | /*Assert.assert(this.edges.has(edge))*/
29 | this.edges.delete(edge)
30 | }
31 |
32 | IsEmpty(): boolean {
33 | return this.edges.size === 0
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/modules/core/src/routing/rectilinear/nudging/SegWithIndex.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 |
3 | export class SegWithIndex {
4 | Points: Point[]
5 |
6 | I: number
7 |
8 | // offset
9 | constructor(pts: Point[], i: number) {
10 | /*Assert.assert(i < pts.length && i >= 0)*/
11 | this.Points = pts
12 | this.I = i
13 | }
14 | static equal(a: SegWithIndex, b: SegWithIndex) {
15 | return a.I === b.I && a.Points === b.Points
16 | }
17 | get Start(): Point {
18 | return this.Points[this.I]
19 | }
20 |
21 | get End(): Point {
22 | return this.Points[this.I + 1]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/BundlingStatus.ts:
--------------------------------------------------------------------------------
1 | export enum BundlingStatus {
2 | Success,
3 | Overlaps,
4 | EdgeSeparationIsTooLarge,
5 | }
6 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/ChannelFlag.ts:
--------------------------------------------------------------------------------
1 | export enum ChannelFlag {
2 | NotSet,
3 | FromRight,
4 | FromLeft,
5 | }
6 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/MetroLine.ts:
--------------------------------------------------------------------------------
1 | import {Polyline} from '../../../math/geometry'
2 |
3 | // holds the data of a path
4 | export class Metroline {
5 | Width: number
6 |
7 | Length: number
8 |
9 | IdealLength: number
10 | Polyline: Polyline
11 |
12 | Index: number
13 |
14 | constructor(polyline: Polyline, width: number, sourceAndTargetLoosePolys: () => [Polyline, Polyline], index: number) {
15 | this.Width = width
16 | this.Polyline = polyline
17 | this.sourceAndTargetLoosePolylines = sourceAndTargetLoosePolys
18 | this.Index = index
19 | }
20 |
21 | UpdateLengths() {
22 | let l = 0
23 | for (let p = this.Polyline.startPoint; p.next != null; p = p.next) {
24 | l += p.next.point.sub(p.point).length
25 | }
26 |
27 | this.Length = l
28 | this.IdealLength = this.Polyline.end.sub(this.Polyline.start).length
29 | }
30 |
31 | sourceAndTargetLoosePolylines: () => [Polyline, Polyline]
32 | }
33 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/MetroNodeInfo.ts:
--------------------------------------------------------------------------------
1 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
2 | import {Metroline} from './MetroLine'
3 | import {Station} from './Station'
4 |
5 | export class MetroNodeInfo {
6 | metroline: Metroline
7 |
8 | station: Station
9 |
10 | polyPoint: PolylinePoint
11 |
12 | constructor(metroline: Metroline, station: Station, polyPoint: PolylinePoint) {
13 | this.metroline = metroline
14 | this.station = station
15 | this.polyPoint = polyPoint
16 | }
17 |
18 | get Metroline(): Metroline {
19 | return this.metroline
20 | }
21 |
22 | get PolyPoint(): PolylinePoint {
23 | return this.polyPoint
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/OrientedHubSegment.ts:
--------------------------------------------------------------------------------
1 | import {ICurve, Point} from '../../..'
2 | import {BundleBase} from './BundleBase'
3 |
4 | export class OrientedHubSegment {
5 | private segment: ICurve
6 | public get Segment(): ICurve {
7 | return this.segment
8 | }
9 | public set Segment(value: ICurve) {
10 | this.segment = value
11 | }
12 |
13 | Reversed: boolean
14 |
15 | Index: number
16 | BundleBase: BundleBase
17 |
18 | constructor(seg: ICurve, reversed: boolean, index: number, bundleBase: BundleBase) {
19 | this.Segment = seg
20 | this.Reversed = reversed
21 | this.Index = index
22 | this.BundleBase = bundleBase
23 | }
24 |
25 | value(t: number): Point {
26 | return this.Reversed ? this.Segment.value(this.Segment.parEnd - t) : this.Segment.value(t)
27 | }
28 |
29 | Other: OrientedHubSegment
30 | }
31 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/PointPairOrder.ts:
--------------------------------------------------------------------------------
1 | import {Metroline} from './MetroLine'
2 |
3 | export class PointPairOrder {
4 | // array of metrolines for node u of edge u->v
5 | Metrolines: Array = new Array()
6 |
7 | orderFixed: boolean
8 |
9 | LineIndexInOrder: Map
10 |
11 | Add(metroline: Metroline) {
12 | this.Metrolines.push(metroline)
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/StationEdgeInfo.ts:
--------------------------------------------------------------------------------
1 | import {Metroline} from './MetroLine'
2 |
3 | export class StationEdgeInfo {
4 | get Count() {
5 | return this.Metrolines.length
6 | }
7 |
8 | Width = 0
9 |
10 | Metrolines: Array = new Array()
11 |
12 | cachedBundleCost = 0
13 | }
14 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/bundling/TimeMeasurer.ts:
--------------------------------------------------------------------------------
1 | // using System;
2 | // using Microsoft.Msagl.DebugHelpers;
3 |
4 | // namespace Microsoft.Msagl.Routing.Spline.Bundling {
5 |
6 | // // Outputs run time in debug mode
7 | // // <
8 | // internal class TimeMeasurer {
9 | // #if TEST_MSAGL && TEST_MSAGL
10 | // static Timer timer;
11 | // static TimeMeasurer() {
12 | // timer = new Timer();
13 | // timer.start();
14 | // }
15 | // #endif
16 |
17 | // internal delegate void Task();
18 |
19 | // internal static void DebugOutput(string str) {
20 | // #if TEST_MSAGL && TEST_MSAGL
21 | // timer.Stop();
22 | // System.Diagnostics.Debug.Write("{0}: ", String.format("{0:0.000}", timer.Duration));
23 | // System.Diagnostics.Debug.WriteLine(str);
24 | // #endif
25 | // }
26 | // }
27 | // }
28 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/BrokenConeSide.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../..'
2 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
3 | import {ConeSide} from './ConeSide'
4 |
5 | // represents a cone side that is broken by the obstacle
6 | export class BrokenConeSide extends ConeSide {
7 | // point where it starts
8 | start: Point
9 |
10 | get Start(): Point {
11 | return this.start
12 | }
13 |
14 | // it is the side of the cone that intersects the obstacle side
15 | ConeSide: ConeSide
16 | EndVertex: PolylinePoint
17 |
18 | get End(): Point {
19 | return this.EndVertex.point
20 | }
21 |
22 | constructor(start: Point, end: PolylinePoint, coneSide: ConeSide) {
23 | super()
24 | this.start = start
25 | this.EndVertex = end
26 | this.ConeSide = coneSide
27 | }
28 |
29 | get Direction(): Point {
30 | return this.End.sub(this.Start)
31 | }
32 |
33 | public toString(): string {
34 | return 'BrokenConeSide: ' + (this.Start + (',' + this.End))
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/ConeClosureEvent.ts:
--------------------------------------------------------------------------------
1 | // this event caused by the intersection of a ObstacleSideSegment and the other cone side of the same cone
2 | // when this event happens the cone has to be removed
3 |
4 | import {Point} from '../../..'
5 | import {Cone} from './Cone'
6 | import {SweepEvent} from './SweepEvent'
7 |
8 | export class ConeClosureEvent extends SweepEvent {
9 | coneToClose: Cone
10 |
11 | get ConeToClose(): Cone {
12 | return this.coneToClose
13 | }
14 |
15 | site: Point
16 |
17 | get Site(): Point {
18 | return this.site
19 | }
20 |
21 | constructor(site: Point, cone: Cone) {
22 | super()
23 | this.site = site
24 | this.coneToClose = cone
25 | }
26 |
27 | toString(): string {
28 | return 'ConeClosureEvent ' + this.site
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/ConeLeftSide.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../..'
2 | import {Cone} from './Cone'
3 | import {ConeSide} from './ConeSide'
4 |
5 | export class ConeLeftSide extends ConeSide {
6 | constructor(cone: Cone) {
7 | super()
8 | this.Cone = cone
9 | }
10 |
11 | get Start(): Point {
12 | return this.Cone.Apex
13 | }
14 |
15 | get Direction(): Point {
16 | return this.Cone.LeftSideDirection
17 | }
18 |
19 | toString(): string {
20 | return 'ConeLeftSide ' + this.Start + (' ' + this.Direction)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/ConeRightSide.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../..'
2 | import {Cone} from './Cone'
3 | import {ConeSide} from './ConeSide'
4 |
5 | export class ConeRightSide extends ConeSide {
6 | constructor(cone: Cone) {
7 | super()
8 | this.Cone = cone
9 | }
10 |
11 | get Start(): Point {
12 | return this.Cone.Apex
13 | }
14 |
15 | get Direction(): Point {
16 | return this.Cone.RightSideDirection
17 | }
18 |
19 | toString(): string {
20 | return 'ConeRightSide ' + this.Start + ' ' + this.Direction
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/ConeSide.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 | import {Cone} from './Cone'
3 |
4 | export abstract class ConeSide {
5 | abstract get Start(): Point
6 |
7 | abstract get Direction(): Point
8 |
9 | Cone: Cone
10 |
11 | Removed = false
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/IConeSweeper.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 |
3 | export interface IConeSweeper {
4 | ConeRightSideDirection: Point
5 |
6 | ConeLeftSideDirection: Point
7 |
8 | SweepDirection: Point
9 |
10 | Z: number
11 | }
12 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/LeftIntersectionEvent.ts:
--------------------------------------------------------------------------------
1 | // left here means an intersection of a left cone side with an obstacle edge
2 |
3 | import {Point} from '../../..'
4 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
5 | import {ConeLeftSide} from './ConeLeftSide'
6 | import {SweepEvent} from './SweepEvent'
7 |
8 | export class LeftIntersectionEvent extends SweepEvent {
9 | coneLeftSide: ConeLeftSide
10 |
11 | intersectionPoint: Point
12 |
13 | endVertex: PolylinePoint
14 |
15 | get EndVertex(): PolylinePoint {
16 | return this.endVertex
17 | }
18 |
19 | constructor(coneLeftSide: ConeLeftSide, intersectionPoint: Point, endVertex: PolylinePoint) {
20 | super()
21 | this.coneLeftSide = coneLeftSide
22 | this.intersectionPoint = intersectionPoint
23 | this.endVertex = endVertex
24 | }
25 |
26 | get Site(): Point {
27 | return this.intersectionPoint
28 | }
29 |
30 | toString(): string {
31 | return 'LeftIntersectionEvent ' + this.intersectionPoint
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/LeftObstacleSide.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
3 | import {ObstacleSide} from './ObstacleSide'
4 |
5 | export class LeftObstacleSide extends ObstacleSide {
6 | end: Point
7 |
8 | constructor(startVertex: PolylinePoint) {
9 | super(startVertex)
10 | this.end = startVertex.nextOnPolyline.point
11 | }
12 |
13 | get End(): Point {
14 | return this.end
15 | }
16 |
17 | get EndVertex(): PolylinePoint {
18 | return this.StartVertex.nextOnPolyline
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/LeftVertexEvent.ts:
--------------------------------------------------------------------------------
1 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
2 | import {VertexEvent} from './VertexEvent'
3 |
4 | export class LeftVertexEvent extends VertexEvent {
5 | constructor(p: PolylinePoint) {
6 | super(p)
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/LowestVertexEvent.ts:
--------------------------------------------------------------------------------
1 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
2 | import {VertexEvent} from './VertexEvent'
3 |
4 | export class LowestVertexEvent extends VertexEvent {
5 | constructor(p: PolylinePoint) {
6 | super(p)
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/PortLocationEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../..'
2 | import {SweepEvent} from './SweepEvent'
3 |
4 | export class PortLocationEvent extends SweepEvent {
5 | public constructor(portLocation: Point) {
6 | super()
7 | this.PortLocation = portLocation
8 | }
9 |
10 | get Site(): Point {
11 | return this.PortLocation
12 | }
13 |
14 | PortLocation: Point
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/RightObstacleSide.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
3 | import {ObstacleSide} from './ObstacleSide'
4 |
5 | export class RightObstacleSide extends ObstacleSide {
6 | end: Point
7 |
8 | constructor(startVertex: PolylinePoint) {
9 | super(startVertex)
10 | this.end = startVertex.prevOnPolyline.point
11 | }
12 |
13 | get End(): Point {
14 | return this.end
15 | }
16 |
17 | get EndVertex(): PolylinePoint {
18 | return this.StartVertex.prevOnPolyline
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/RightVertexEvent.ts:
--------------------------------------------------------------------------------
1 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
2 | import {VertexEvent} from './VertexEvent'
3 |
4 | export class RightVertexEvent extends VertexEvent {
5 | constructor(p: PolylinePoint) {
6 | super(p)
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/SweepEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 |
3 | export abstract class SweepEvent {
4 | abstract get Site(): Point
5 | }
6 |
--------------------------------------------------------------------------------
/modules/core/src/routing/spline/coneSpanner/VertexEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../math/geometry/point'
2 | import {Polyline} from '../../../math/geometry/polyline'
3 | import {PolylinePoint} from '../../../math/geometry/polylinePoint'
4 | import {SweepEvent} from './SweepEvent'
5 |
6 | export class VertexEvent extends SweepEvent {
7 | Vertex: PolylinePoint
8 |
9 | get Site(): Point {
10 | return this.Vertex.point
11 | }
12 |
13 | constructor(p: PolylinePoint) {
14 | super()
15 | this.Vertex = p
16 | }
17 |
18 | get Polyline(): Polyline {
19 | return this.Vertex.polyline
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/modules/core/src/routing/visibility/Drawings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/msagljs/44c36504516b7502465a69d53e723eb3629a58a1/modules/core/src/routing/visibility/Drawings.png
--------------------------------------------------------------------------------
/modules/core/src/routing/visibility/PortObstacleEvent.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../math/geometry/point'
2 | import {SweepEvent} from '../spline/coneSpanner/SweepEvent'
3 |
4 | export class PortObstacleEvent extends SweepEvent {
5 | site: Point
6 |
7 | constructor(site: Point) {
8 | super()
9 | this.site = site
10 | }
11 |
12 | get Site(): Point {
13 | return this.site
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/src/routing/visibility/SegmentBase.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../math/geometry/point'
2 |
3 | export abstract class SegmentBase {
4 | abstract get Start(): Point
5 |
6 | abstract get End(): Point
7 |
8 | get Direction(): Point {
9 | return this.End.sub(this.Start)
10 | }
11 | toString(): string {
12 | return this.Start + ' ' + this.End
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/modules/core/src/routing/visibility/Spanner visibility graph.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/msagljs/44c36504516b7502465a69d53e723eb3629a58a1/modules/core/src/routing/visibility/Spanner visibility graph.docx
--------------------------------------------------------------------------------
/modules/core/src/routing/visibility/TollFreeVisibilityEdge.ts:
--------------------------------------------------------------------------------
1 | import {VisibilityEdge} from './VisibilityEdge'
2 | import {VisibilityVertex} from './VisibilityVertex'
3 |
4 | export class TollFreeVisibilityEdge extends VisibilityEdge {
5 | static constructorVV(source: VisibilityVertex, target: VisibilityVertex): TollFreeVisibilityEdge {
6 | return new TollFreeVisibilityEdge(source, target, 0)
7 | }
8 |
9 | constructor(source: VisibilityVertex, target: VisibilityVertex, weight = 0) {
10 | super(source, target, weight)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/routing/visibility/VisibilityKind.ts:
--------------------------------------------------------------------------------
1 | export enum VisibilityKind {
2 | Regular,
3 | Tangent,
4 | }
5 |
--------------------------------------------------------------------------------
/modules/core/src/structs/BasicGraph.ts:
--------------------------------------------------------------------------------
1 | import {BasicGraphOnEdges} from './basicGraphOnEdges'
2 | import {IEdge} from './iedge'
3 |
4 | export class BasicGraph extends BasicGraphOnEdges {
5 | nodes: TNode[]
6 | constructor(edges: TEdge[], numberOfVerts: number) {
7 | super()
8 | this.SetEdges(edges, numberOfVerts)
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/modules/core/src/structs/algorithmData.ts:
--------------------------------------------------------------------------------
1 | import {Attribute} from './attribute'
2 | import {AttributeRegistry} from './attributeRegistry'
3 | import {Entity} from './entity'
4 |
5 | export class AlgorithmData extends Attribute {
6 | clone(): Attribute {
7 | throw new Error('Method not implemented.')
8 | }
9 | rebind(e: Entity): void {
10 | this.entity = e
11 | this.bind(AttributeRegistry.AlgorithmDataIndex)
12 | }
13 |
14 | constructor(entity: Entity, data: any = null) {
15 | super(entity, AttributeRegistry.AlgorithmDataIndex)
16 | this.data = data
17 | }
18 | static getAlgData(attrCont: Entity): AlgorithmData {
19 | return attrCont.getAttr(AttributeRegistry.AlgorithmDataIndex)
20 | }
21 | data: any
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/src/structs/attribute.ts:
--------------------------------------------------------------------------------
1 | import {Entity} from './entity'
2 |
3 | /** The class to support attributes of Entity */
4 | export abstract class Attribute {
5 | entity: Entity
6 | /** this in the index of where the attribute is positioned in the attribute array of the entity */
7 | bind(index: number) {
8 | if (this.entity) this.entity.setAttr(index, this)
9 | }
10 |
11 | abstract rebind(e: Entity): void
12 |
13 | /** The arguments are the underlying entity and the attribute index in the attribute array */
14 | constructor(entity: Entity, index: number) {
15 | this.entity = entity
16 | this.bind(index)
17 | }
18 | abstract clone(): Attribute
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/src/structs/attributeRegistry.ts:
--------------------------------------------------------------------------------
1 | export class AttributeRegistry {
2 | static GeomObjectIndex = 0
3 | static DrawingObjectIndex = 1
4 | static AlgorithmDataIndex = 2
5 | static ViewerIndex = 3
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/src/structs/genericHeapElement.ts:
--------------------------------------------------------------------------------
1 | export class GenericHeapElement {
2 | indexToA: number
3 |
4 | priority: number
5 |
6 | v: T
7 |
8 | // value
9 | constructor(index: number, priority: number, v: T) {
10 | this.indexToA = index
11 | this.priority = priority
12 | this.v = v
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/modules/core/src/structs/iedge.ts:
--------------------------------------------------------------------------------
1 | export interface IEdge {
2 | source: number
3 | target: number
4 | }
5 |
--------------------------------------------------------------------------------
/modules/core/src/structs/label.ts:
--------------------------------------------------------------------------------
1 | import {Entity} from './entity'
2 |
3 | export class Label extends Entity {
4 | /** parent is the entity having this label */
5 | toString(): string {
6 | return 'label of ' + (this.parent ? this.parent.toString() : 'null')
7 | }
8 | constructor(labelledParent: Entity) {
9 | super()
10 | this.parent = labelledParent
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/utils/CoupleSet.ts:
--------------------------------------------------------------------------------
1 | // based on map of maps
2 | export class CoupleSet {
3 | mapOfSets = new Map>()
4 | insert(x: number, y: number) {
5 | let m = this.mapOfSets.get(x)
6 | if (m == null) this.mapOfSets.set(x, (m = new Set()))
7 | m.add(y)
8 | }
9 |
10 | delete(x: number, y: number) {
11 | const m = this.mapOfSets.get(x)
12 | if (m != null) m.delete(y)
13 | }
14 |
15 | has(x: number, y: number): boolean {
16 | const m = this.mapOfSets.get(x)
17 | return m != null && m.has(y)
18 | }
19 |
20 | constructor() {
21 | this.mapOfSets = new Map>()
22 | }
23 |
24 | *elems(): IterableIterator<[number, number]> {
25 | for (const [k, v] of this.mapOfSets) {
26 | for (const yp of v) {
27 | yield [k, yp]
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/modules/core/src/utils/IntPair.ts:
--------------------------------------------------------------------------------
1 | // represents the minimal int->int edge
2 |
3 | export class IntPair {
4 | x: number
5 | y: number
6 | constructor(x: number, y: number) {
7 | this.x = x
8 | this.y = y
9 | }
10 | get source() {
11 | return this.x
12 | }
13 | get target() {
14 | return this.y
15 | }
16 | isDiagonal(): boolean {
17 | return this.x === this.y
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/src/utils/RealNumberSpan.ts:
--------------------------------------------------------------------------------
1 | import {GeomConstants} from '../math/geometry/geomConstants'
2 |
3 | // this class behaves like one dimensional bounding box
4 | export class RealNumberSpan {
5 | isEmpty = true
6 | max: number
7 | min: number
8 | AddValue(x: number) {
9 | if (this.isEmpty) {
10 | this.max = x
11 | this.min = x
12 | this.isEmpty = false
13 | } else if (x < this.min) {
14 | this.min = x
15 | } else if (x > this.max) {
16 | this.max = x
17 | }
18 | }
19 |
20 | get length(): number {
21 | return this.max - this.min
22 | }
23 |
24 | // 0 if value is close to zero;
25 | // 1 if value is strictly greater than zero;
26 | // -1 if value is strictly lower than zero;
27 | static sign(value: number): number {
28 | return value > GeomConstants.distanceEpsilon ? 1 : value < -GeomConstants.distanceEpsilon ? -1 : 0
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/modules/core/src/utils/algorithm.ts:
--------------------------------------------------------------------------------
1 | import {CancelToken} from './cancelToken'
2 |
3 | export abstract class Algorithm {
4 | ProgressStep() {
5 | // todo: Implement
6 | }
7 | constructor(cancelToken: CancelToken) {
8 | this.cancelToken = cancelToken
9 | }
10 | abstract run(): void
11 | cancelToken: CancelToken
12 | }
13 |
--------------------------------------------------------------------------------
/modules/core/src/utils/assert.ts:
--------------------------------------------------------------------------------
1 | export class Assert {
2 | static assert(p: boolean, s: string = null) {
3 | if (!p) {
4 | if (s != null) {
5 | console.log(s)
6 | throw new Error(s)
7 | }
8 | throw new Error('condition does not hold')
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/modules/core/src/utils/cancelToken.ts:
--------------------------------------------------------------------------------
1 | // a place holder for the cancelled flag
2 | export class CancelToken {
3 | throwIfCanceled() {
4 | throw new Error('Algorithm was cancelled')
5 | }
6 | canceled_: boolean
7 |
8 | // Set this flag to true when you want to cancel the layout.
9 | get canceled() {
10 | return this.canceled_
11 | }
12 | set canceled(value) {
13 | this.canceled_ = value
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/src/utils/copy.ts:
--------------------------------------------------------------------------------
1 | export function copyTo(s: A[], t: A[]) {
2 | for (let i = 0; i < s.length; i++) t[i] = s[i]
3 | }
4 |
--------------------------------------------------------------------------------
/modules/core/src/utils/random.ts:
--------------------------------------------------------------------------------
1 | // if max is an integer then returns random in the range [0, max-1]
2 | import {Random} from 'reliable-random'
3 | let generator: Random
4 | export function randomInt(max: number): number {
5 | if (generator == null) {
6 | generator = new Random(0, 0)
7 | }
8 |
9 | return generator.randint(max)
10 | }
11 |
12 | export function initRandom(seed: number) {
13 | generator = new Random(seed, 0)
14 | }
15 |
16 | export function random(): number {
17 | if (generator == null) {
18 | generator = new Random(0, 0)
19 | }
20 |
21 | return generator.random()
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/test/core/geometry/Interval.spec.ts:
--------------------------------------------------------------------------------
1 | import {Interval} from '../../../src/math/geometry/Interval'
2 |
3 | test('interval add', () => {
4 | const i = new Interval(0, 1)
5 | const j = new Interval(1, 2)
6 | expect(i.contains_d(0.5)).toBeTruthy()
7 | expect(j.GetInRange(2.1)).toBe(2)
8 | const k = Interval.mkInterval(i, j)
9 | expect(k.end).toBe(2)
10 | expect(i.intersects(j)).toBeTruthy()
11 | })
12 |
--------------------------------------------------------------------------------
/modules/core/test/data/JSONfiles/README.md:
--------------------------------------------------------------------------------
1 | # Data Sources and Attributions
2 |
3 | ## gameofthrones.json
4 |
5 | Andrew Beveridge and Michael Chemers, "The Game of 'The Game of Thrones': Networked Concordances and Fractal Dramaturgy", in: Paola Brembilla and Ilaria De Pacalis (eds.), Reading Contemporary Serial Television Universes: A Narrative Ecosystem Framework, Routledge, 2018.
6 |
7 | https://github.com/mathbeveridge/gameofthrones
8 |
9 | ## composers.json
10 |
11 | http://mozart.diei.unipg.it/gdcontest/contest2011/composers.xml
12 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ER.gv:
--------------------------------------------------------------------------------
1 | graph ER {
2 | node [shape=box]; course; institute; student;
3 | node [shape=ellipse]; {node [label="name"] name0; name1; name2;}
4 | code; grade; number;
5 | node [shape=diamond,style=filled,color=lightgrey]; "C-I"; "S-C"; "S-I";
6 |
7 | name0 -- course;
8 | code -- course;
9 | course -- "C-I" [label="n",len=1.00];
10 | "C-I" -- institute [label="1",len=1.00];
11 | institute -- name1;
12 | institute -- "S-I" [label="1",len=1.00];
13 | "S-I" -- student [label="n",len=1.00];
14 | student -- grade;
15 | student -- name2;
16 | student -- number;
17 | student -- "S-C" [label="m",len=1.00];
18 | "S-C" -- course [label="n",len=1.00];
19 |
20 | label = "\n\nEntity Relation Diagram\ndrawn by NEATO";
21 | fontsize=20;
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/Heawood.gv:
--------------------------------------------------------------------------------
1 | /*
2 | * The transitive 6-net, also known as Heawood's graph,
3 | * can be used to test the "stability points" of the layout
4 | * algorithm.
5 |
6 | * The "ideal" layout occurs when len="2.5". The layout
7 | * loses the regularity when smaller values are used.
8 | */
9 | graph "Heawood" {
10 | node [
11 | fontname = "Arial"
12 | label = "\N"
13 | shape = "circle"
14 | width = "0.50000"
15 | height = "0.500000"
16 | color = "black"
17 | ]
18 | edge [
19 | color = "black"
20 | ]
21 | /* The outer wheel */
22 | "0" -- "1" -- "2" -- "3" -- "4" -- "5" -- "6" -- "7" -- "8" -- "9" -- "10" -- "11" -- "12" -- "13" -- "0";
23 | /* The internal edges. The len = makes them internal */
24 | "0" -- "5" [len = 2.5];
25 | "2" -- "7" [len = 2.5];
26 | "4" -- "9" [len = 2.5];
27 | "6" -- "11" [len = 2.5];
28 | "8" -- "13" [len = 2.5];
29 | "10" -- "1" [len = 2.5];
30 | "12" -- "3" [len = 2.5];
31 | }
32 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/KW91.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | style=bold;
3 | subgraph cluster_outer {
4 | Act_1 -> Act_21;
5 | Act_1 -> Act_23;
6 | Act_25 -> Act_3;
7 | subgraph cluster_inner {
8 | label = " Act_2";
9 | {Act_21 -> Act_22 [minlen=2]; rank=same;}
10 | Act_22 -> Act_23;
11 | Act_22 -> Act_24;
12 | {Act_23 -> Act_24 [minlen=2]; rank=same;}
13 | Act_23 -> Act_25;
14 | Act_24 -> Act_25;
15 | }
16 | }
17 | Ext_1 -> Act_1;
18 | Act_3 -> Ext_2;
19 | Ext_3 -> Act_24;
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/Latin1.gv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/msagljs/44c36504516b7502465a69d53e723eb3629a58a1/modules/core/test/data/graphvis/Latin1.gv
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/Symbol.gv:
--------------------------------------------------------------------------------
1 | digraph {
2 | greek[fontname=Symbol label="αβγδεζηθικλμνξοπρςστυφχψωϒϖ"
3 | ];
4 | subgraph {
5 | a[ fontname=Symbol label="for all: ∀"];
6 | b[ fontname=Symbol label="part: ∂"];
7 | c[ fontname=Symbol label="exists: ∃"];
8 | d[ fontname=Symbol label="empty: ∅"];
9 | e[ fontname=Symbol label="nabla: ∇"];
10 | f[ fontname=Symbol label="isin: ∈"];
11 | g[ fontname=Symbol label="notin: ∉"];
12 | a->b->c->d->e->f->g;
13 | };
14 | subgraph {
15 | i[ fontname=Symbol label="ni: ∋"];
16 | j[ fontname=Symbol label="prod: ∏"];
17 | k[ fontname=Symbol label="sum: ∑"];
18 | l[ fontname=Symbol label="lowast: ∗"];
19 | m[ fontname=Symbol label="square root: √"];
20 | n[ fontname=Symbol label="proportional to: ∝"];
21 | o[ fontname=Symbol label="infinity∞"];
22 | i->j->k->l->m->n->o
23 | };
24 | greek->a
25 | greek->i
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ZapfChancery.gv:
--------------------------------------------------------------------------------
1 | graph{
2 |
3 | 34[ fontname="ZapfChancery-MediumItalic" shape=box width=0 height=0 margin="0,0"
4 | label=<
5 | "ZapfChancery-MediumItalic" |
6 | "ABCDEFGHIJLKLMNOPQRSTUVWXYZ" |
7 | "abcdefghijlklmnopqrstuvwxyz" |
8 | "ABCDEFGHIJLKLMNOPQRSTUVWXYZ\nabcdefghijlklmnopqrstuvwxyz" |
9 |
>];
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ZapfDingbats.gv:
--------------------------------------------------------------------------------
1 | graph{
2 |
3 | 35[ fontname="ZapfDingbats" shape=box width=0 height=0 margin="0,0"
4 | label=<
5 | "ZapfDingbats" |
6 | "ABCDEFGHIJLKLMNOPQRSTUVWXYZ" |
7 | "abcdefghijlklmnopqrstuvwxyz" |
8 | "ABCDEFGHIJLKLMNOPQRSTUVWXYZ\nabcdefghijlklmnopqrstuvwxyz" |
9 |
>];
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/a.gv:
--------------------------------------------------------------------------------
1 | digraph {
2 | node_1 [label="ID: 1\ntype: 48\nnbr out: 0\nnbr chi: 11"];
3 | node_1 -> node_1
4 | }
5 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/alf.gv:
--------------------------------------------------------------------------------
1 | digraph Alf {
2 | size = "6,9";
3 | node [ shape = record ];
4 | Decl [ label = "\n\nDecl|{name|access|decl_flags|extern_c_linkage}"];
5 | Nontype_decl [ label = "Nontype_decl|{type}"];
6 | Defined_decl [ label = "Defined_decl|{linkage}"];
7 | Data_decl [ label = "Data_decl|{storage_class}"];
8 | Function_decl [ label = "Function_decl|{formals|defaults}"];
9 | Data [ label = "Data|{initializer}"];
10 | Function [ label = "Function|{body}"];
11 | Constructor [ label = "Constructor|{member_initializers}"];
12 | Aggregate -> Type_decl ;
13 | Class -> Aggregate;
14 | Union -> Aggregate;
15 | Data -> Data_decl;
16 | Data -> Defn;
17 | Data_decl -> Defined_decl;
18 | Data_member -> Nontype_decl ;
19 | Defined_decl -> Nontype_decl;
20 | Defn -> Defined_decl;
21 | Enum -> Type_decl ;
22 | Enumerator -> Nontype_decl ;
23 | Function -> Defn;
24 | Function -> Function_decl;
25 | Constructor -> Function;
26 | Destructor -> Function;
27 | Function_decl -> Defined_decl;
28 | Nontype_decl -> Decl ;
29 | Template_type_arg -> Type_decl ;
30 | Type_decl -> Decl ;
31 | Typedef -> Type_decl ;
32 | }
33 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b.gv:
--------------------------------------------------------------------------------
1 | digraph automata_0 {
2 | size ="8.5, 11";
3 | node [shape = circle];
4 | 0 [ style = filled, color=lightgrey ];
5 | 2 [ shape = doublecircle ];
6 | 0 -> 2 [ label = "a " ];
7 | 0 -> 0 [ label = "self " ];
8 | 0 -> 1 [ label = "other " ];
9 | 1 -> 2 [ label = "a " ];
10 | 1 -> 1 [ label = "other " ];
11 | 2 -> 2 [ label = "a " ];
12 | 2 -> 1 [ label = "other " ];
13 | "M" [ shape = plaintext ];
14 | }
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b117.gv:
--------------------------------------------------------------------------------
1 | digraph automata_0 {
2 | size ="8.5, 11";
3 | node [shape = circle];
4 | 0 [ style = filled, color=lightgrey ];
5 | 2 [ shape = doublecircle ];
6 | 0 -> 2 [ label = "a " ];
7 | 0 -> 1 [ label = "other " ];
8 | 1 -> 2 [ label = "a " ];
9 | 1 -> 1 [ label = "other " ];
10 | 2 -> 2 [ label = "a " ];
11 | 2 -> 1 [ label = "other " ];
12 | "Machine: a" [ shape = plaintext ];
13 | }
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b123.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | tester_run_ksh:ne -> tester_run_ksh:n ;
3 | }
4 |
5 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b135.gv:
--------------------------------------------------------------------------------
1 | digraph ID {
2 | graph [
3 | concentrate = true
4 | ];
5 | A -> B
6 | B -> A
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b145.gv:
--------------------------------------------------------------------------------
1 | digraph bla {
2 | rankdir=LR;
3 | compound=true;
4 | subgraph cluster_foo {
5 | label_foo [shape="record",label="foo"];
6 | }
7 | cluster_foo -> label_xxxxxxx [lhead="cluster_foo"]
8 | columns_foo_insider:foo -> label_foo [lhead="cluster_foo"]
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b146.gv:
--------------------------------------------------------------------------------
1 | digraph mygraph {
2 | label_foo [shape="record",label="foo"];
3 | label_foo:foo -> label_foo
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b155.gv:
--------------------------------------------------------------------------------
1 | digraph TopLevel {
2 | bgcolor = lightcyan1
3 | fontname = Arial
4 | label = "test.rb"
5 | fontsize = 8
6 | node [
7 | fontname = Arial,
8 | color = black,
9 | fontsize = 8
10 | ]
11 |
12 | subgraph cluster_1 {
13 | bgcolor = palegreen1
14 | fontname = Arial
15 | color = blue
16 | label = "ModuleName"
17 | ClassName [
18 | style = filled,
19 | URL = "classes/ModuleName/ClassName.html",
20 | fontcolor = black,
21 | color = palegoldenrod,
22 | label = "ClassName"
23 | ]
24 |
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b22.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir=LR;
3 | node [shape=box];
4 | size = "7.5,10.0";
5 | ratio = "fill";
6 | center =1;
7 |
8 | /* Node Definitions */
9 |
10 |
11 | dc1 [shape=plaintext,label="DC 1"];
12 | dc10 [shape=plaintext,label="DC 10"];
13 | dc100 [shape=plaintext,label="DC 100"];
14 |
15 | { rank = same; "dc1"; "dc10"; "dc100"; }
16 |
17 | /* Link Definitions */
18 |
19 | /* Marking Unused Dialing Plans */
20 |
21 | no_dc [shape=plaintext,label="NOTHING"];
22 | { rank = min; "no_dc"; }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b3.gv:
--------------------------------------------------------------------------------
1 | digraph "g" {
2 | graph [
3 | fontsize = "14"
4 | fontname = "Times-Roman"
5 | fontcolor = "black"
6 | color = "black"
7 | ]
8 | node [
9 | fontsize = "14"
10 | fontname = "Times-Roman"
11 | fontcolor = "black"
12 | shape = "ellipse"
13 | color = "black"
14 | ]
15 | edge [
16 | fontsize = "14"
17 | fontname = "Times-Roman"
18 | fontcolor = "black"
19 | color = "black"
20 | ]
21 | "n0" [
22 | label = "(balanced)"
23 | color = "black"
24 | width = "0.833333"
25 | fontsize = "14"
26 | fontname = "Times-Roman"
27 | fontcolor = "black"
28 | pos = "151.378446,405.811623"
29 | height = "0.416667"
30 | shape = "ellipse"
31 | ]
32 | "n1" [
33 | label = "(unbalanced"
34 | color = "black"
35 | width = "0.833333"
36 | fontsize = "14"
37 | fontname = "Times-Roman"
38 | fontcolor = "black"
39 | pos = "163.408521,310.621242"
40 | height = "0.416667"
41 | shape = "ellipse"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b33.gv:
--------------------------------------------------------------------------------
1 | digraph JAAS {
2 | fontname=arial;
3 | fontsize=20;
4 | subgraph cluster0 {
5 | label="Foo";
6 | JOC [ label="JAAS" ];
7 | };
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b34.gv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/msagljs/44c36504516b7502465a69d53e723eb3629a58a1/modules/core/test/data/graphvis/b34.gv
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b491.gv:
--------------------------------------------------------------------------------
1 | digraph G
2 | {
3 | Node29 [ shape=record ]
4 |
5 | Node29 -> Node27
6 | Node29 -> Node26
7 | Node29 -> Node29 [ label="v"]
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b545.gv:
--------------------------------------------------------------------------------
1 | digraph g {
2 |
3 | "N11"
4 | [
5 | shape = record
6 | label = "WFSt|1571 as Ref: 1338 D"
7 | ]
8 | N11ne -> N11:p0
9 | }
10 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b56.gv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/msagljs/44c36504516b7502465a69d53e723eb3629a58a1/modules/core/test/data/graphvis/b56.gv
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b58.gv:
--------------------------------------------------------------------------------
1 | digraph G{
2 | ordering=out;
3 | {rank=same;"1";"2"};
4 | "1"->"2";
5 | {rank=same;"4";"5"};
6 | "4"->"5";
7 | "7"->"5";
8 | "7"->"4";
9 | "6"->"1";
10 | "3"->"6";
11 | "6"->"4";
12 | "3"->"8";
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b60.gv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/msagljs/44c36504516b7502465a69d53e723eb3629a58a1/modules/core/test/data/graphvis/b60.gv
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b62.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | graph [concentrate=true];
3 |
4 | routine1;
5 | routine2;
6 |
7 | routine1->routine2;
8 | routine1->routine2;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b68.gv:
--------------------------------------------------------------------------------
1 | digraph simple {
2 | orientation=landscape;
3 | ratio=auto;
4 | size = "10,7.5";
5 | label="Task Hierarchy: model2";
6 | task15 [shape=box,fontcolor=forestgreen];
7 | task16 [shape=box];
8 | task17 [shape=box];
9 | task18 [shape=box];
10 | task19 [shape=box];
11 | task20 [shape=box];
12 | task21 [shape=box];
13 | task95 [shape=box];
14 | task31 [shape=box];
15 | task32 [shape=box];
16 | task33 [shape=box];
17 | task34 [shape=box];
18 | task15 -> task16 [];
19 | task15 -> task17 [];
20 | task15 -> task18 [];
21 | task15 -> task19 [];
22 | task15 -> task20 [];
23 | task15 -> task21 [];
24 | task15 -> task95 [];
25 | task15 -> task31 [];
26 | task31 -> task32 [];
27 | task31 -> task33 [];
28 | task31 -> task34 [];
29 | }
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b7.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster_0 {
3 | subgraph cluster_1 {
4 | }
5 | a -> c;
6 | }
7 |
8 | subgraph cluster_1 {
9 | y -> z;
10 | y -> q;
11 | }
12 |
13 | y -> b;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b73.gv:
--------------------------------------------------------------------------------
1 | digraph test {
2 | gvds_array0 [label="{fi}|{b}", shape="record"];
3 | "gvds_array0":port1 -> gvds_array0;
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b73a.gv:
--------------------------------------------------------------------------------
1 | digraph test {
2 | gvds_array0 [label="{1}|{2}|{3}", shape="record"];
3 | "gvds_array0":port2 -> gvds_array0;
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b76.gv:
--------------------------------------------------------------------------------
1 | digraph polyport {
2 | edge [headport=":w", tailport=":e"]
3 | n0->n0
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b77.gv:
--------------------------------------------------------------------------------
1 | graph S {
2 | 1 -- 6;
3 | 2 -- 3 -- 6;
4 | 4 -- 5 -- 6;
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b786.gv:
--------------------------------------------------------------------------------
1 | digraph g {
2 | node [shape = record];
3 | subgraph cluster0 {
4 | n12 [label = "|12|"];
5 | n13 [label = "|13|"];
6 | n18 [label = "|18|"];
7 | n2 [label = "|2|"];
8 | n23 [label = "|23|"];
9 | n3 [label = "|3|"];
10 | n4 [label = "|4|"];
11 | n5 [label = "|5|"];
12 | n6 [label = "|6|"];
13 | n7 [label = "|7|"];
14 | n8 [label = "|8|"];
15 | "n3":f0 -> "n2":f1;
16 | "n3":f2 -> "n4":f1;
17 | "n5":f0 -> "n3":f1;
18 | "n5":f2 -> "n7":f1;
19 | "n6":f0 -> "n12":f1;
20 | "n6":f2 -> "n13":f1;
21 | "n7":f0 -> "n6":f1;
22 | "n7":f2 -> "n8":f1;
23 | "n8":f0 -> "n23":f1;
24 | "n8":f2 -> "n18":f1;
25 | }
26 | }
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b79.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | size="2,2";
3 | rankdir=LR;
4 | T -> H [arrowhead=dot,arrowsize=2.2];
5 | }
6 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b80.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | ranksep=equally;
3 | c [height=2.0];
4 | a -> b;
5 | c -> b;
6 | b -> d;
7 | }
8 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b80a.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | ranksep=equally;
3 | c [height=2.0];
4 | a -> b;
5 | c -> b;
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b85.gv:
--------------------------------------------------------------------------------
1 | digraph inheritance
2 | {
3 | Node1100 [shape="box",label="exotkAF_ViewType.hxx",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",style="filled" fontcolor="white"];
4 | Node1101 -> Node1100 [color="midnightblue",fontsize=10,style="solid",fontname="doxfont"];
5 | Node1101 [shape="box",label="exotkAF_View.cxx",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$exotkAF__View_8cxx.html"];
6 | Node1102 -> Node1100 [color="midnightblue",fontsize=10,style="solid",fontname="doxfont"];
7 | Node1102 [shape="box",label="exotkAF_ViewPopup.cxx",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$exotkAF__ViewPopup_8cxx.html"];
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/b993.gv:
--------------------------------------------------------------------------------
1 | diGraph G{
2 | graph [charset="utf8"]
3 | 1[label="Umlaut"];
4 | 2[label="ü"];
5 | 3[label="ä"];
6 | 4[label="ö"];
7 | 1->2;
8 | 1->3;
9 | 1->4;
10 | }
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/bad.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | Marden--hg;
3 | Cannon--ggt;
4 | Epstein--kg;
5 | Epstein--ldt;
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/center.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | center=true
3 | a -> { b c}
4 | }
5 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clover.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | a -- b -- c -- a
3 | a -- B -- C -- a
4 | a -- 1 -- 2 -- a
5 | }
6 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clust.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster_0 {
3 | label = "hello world";
4 | a -> b;
5 | a -> c;
6 | color = hot_pink;
7 | }
8 |
9 | subgraph cluster_1 {
10 | label = "MSDOT";
11 | style= "dashed";
12 | color=purple;
13 | x -> y [ label = "xtoy" ];
14 | x -> z;
15 | y -> z;
16 | y -> q;
17 | }
18 | cluster_0 -> cluster_1 [ label = "C0->C1" ];
19 | top -> a [ label = "top_a" ];
20 | top -> y;
21 | y -> b;
22 | }
23 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clust1.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster_c0 {a0 -> a1 -> a2 -> a3;}
3 | subgraph cluster_c1 {b0 -> b1 -> b2 -> b3;}
4 | x -> a0;
5 | x -> b0;
6 | a1 -> a3;
7 | a3 -> a0;
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clust2.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster_c0 {a0 -> a1 -> a2 -> a3;}
3 | subgraph cluster_c1 {b0 -> b1 -> b2 -> b3;}
4 | x -> a0;
5 | x -> b0;
6 | a1 -> b3;
7 | b3 -> a1;
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clust3.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster_c0 {a0 -> a1 -> a2 -> a3;}
3 | subgraph cluster_c1 {b0 -> b1 -> b2 -> b3;}
4 | subgraph cluster_c2 {a02 -> a12 -> a22 -> a32;}
5 | subgraph cluster_c3 {y}
6 | x -> a0;
7 | x -> b0;
8 | a1 -> b3;
9 | b1 -> a3;
10 | a32 ->y
11 | }
12 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clust4.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 |
3 | subgraph cluster_0 {
4 | style=filled;
5 | color=lightgrey;
6 | node [style=filled,color=white];
7 | a0 -> a1 -> a2 -> a3;
8 | label = "process #1";
9 | }
10 |
11 | subgraph cluster_1 {
12 | node [style=filled];
13 | b0 -> b1 -> b2 -> b3;
14 | label = "process #2";
15 | color=blue
16 | }
17 | start -> a0;
18 | start -> b0;
19 | a1 -> b3;
20 | b2 -> a3;
21 | a3 -> a0;
22 | a3 -> end;
23 | b3 -> end;
24 |
25 | start [shape=Mdiamond];
26 | end [shape=Msquare];
27 | }
28 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clust5.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | size="6,6";
3 | a -> b -> c;
4 |
5 | subgraph cluster0 {
6 | x0 -> y0;
7 | x0 -> z0;
8 | }
9 |
10 | subgraph cluster1 {
11 | x1 -> y1;
12 | x1 -> z1;
13 | }
14 |
15 | subgraph cluster2 {
16 | x2 -> y2;
17 | x2 -> z2;
18 | }
19 |
20 | a -> x0;
21 | b -> x1;
22 | b -> x2;
23 | a -> z2;
24 | c -> z1;
25 | }
26 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clusters.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 |
3 | subgraph cluster_0 {
4 | style=filled;
5 | color=lightgrey;
6 | node [style=filled,color=white];
7 | a0 -> a1 -> a2 -> a3;
8 | label = "process #1";
9 | }
10 |
11 | subgraph cluster_1 {
12 | node [style=filled];
13 | b0 -> b1 -> b2 -> b3;
14 | label = "process #2";
15 | color=blue
16 | }
17 | start -> a0;
18 | start -> b0;
19 | a1 -> b3;
20 | b2 -> a3;
21 | a3 -> a0;
22 | a3 -> end;
23 | b3 -> end;
24 |
25 | start [shape=Mdiamond];
26 | end [shape=Msquare];
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clustlabel.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster0 {
3 | a->{c b};
4 | label = "cluster0";
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/clustsquare.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster_0 {
3 | label = "hello world";
4 | a -> b;
5 | a -> c;
6 | color = hot_pink;
7 | }
8 |
9 | subgraph cluster_1_parent {
10 | subgraph cluster_1 {
11 | label = "MSDOT";
12 | style= "dashed";
13 | color=purple;
14 | x -> y [ label = "xtoy"];
15 | x -> z;
16 | y -> z;
17 | y -> q;
18 | }
19 | z->top [label = "ztop"];
20 | }
21 | cluster_0 -> cluster_1 [ label = "C0->C1" ];
22 | cluster_0 -> cluster_1_parent [ label = "c0->c1parent" ];
23 | top -> a [ label = "top_a" ];
24 | top -> y;
25 | y -> b;
26 | }
27 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/color.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | node [style=filled]
3 | abc [color=green]
4 | def [color="0.2,0.8,0.8"]
5 | ghi [color="#FF0000"]
6 | kl [color="#FF00007F"]
7 | mno [color=yellow, fontcolor="#FF00007F"]
8 | pqr [label=mno, color=yellow, fontcolor="#FF0000"]
9 | abc -> def [color="red:blue:#00FF00"]
10 | }
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/colors.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 |
3 | node [style=filled, shape=box]
4 | ddddddd [fontcolor=yellow, fillcolor=blue, color=orange]
5 | subgraph clusterA {
6 | style=filled
7 | fillcolor=lightgray
8 | pencolor=blue
9 | eeeee [peripheries=3, fontcolor=red, color=yellow]
10 | eeeee -> ee
11 | }
12 | ddddddd -> eeeee [labelfontcolor=chocolate, headlabel=headlabel, label=flue, fontcolor=green, color=lightblue]
13 | }
14 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/colorscheme.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 |
3 | node [shape=box, style=filled]
4 |
5 | subgraph {
6 | node [colorscheme=spectral11]
7 | 1 [color=1]
8 | 4 [color=4]
9 | 8 [color=8]
10 | 11 [color="//11"]
11 | }
12 |
13 | ylgn7 [color="/ylgn7/5"]
14 | X11 [color="/X11/thistle"]
15 | indigo [color="/X11/indigo"]
16 | magenta [color="magenta"]
17 |
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/compound.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | compound=true
3 |
4 | subgraph clusterA {
5 | a1 -> a2 -> a3
6 | }
7 | subgraph clusterB {
8 | subgraph clusterC {
9 | c1 -> c2
10 | }
11 | b1 -> b2
12 | b1 -> b3
13 | b1 -> c2
14 | }
15 | a1 -> b2 [lhead=clusterB]
16 | c2 -> a3 [ltail=clusterC]
17 | b3 -> a3 [ltail=clusterB, lhead=clusterA]
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ctext.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | xyz [label = "hello\nworld",color="slateblue",fontsize=24,fontname="Palatino-Italic",style=filled,fontcolor="hotpink"];
3 | node [style=filled];
4 | red [color=red];
5 | green [color=green];
6 | blue [color=blue,fontcolor=black];
7 | cyan [color=cyan];
8 | magenta [color=magenta];
9 | yellow [color=yellow];
10 | orange [color=orange];
11 | red -> green;
12 | red -> blue;
13 | blue -> cyan;
14 | blue -> magenta;
15 | green -> yellow;
16 | green -> orange;
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/d.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | Marden--ldt;
3 | Marden--kg;
4 | Marden--hg;
5 | Cannon--ldt;
6 | Cannon--kg;
7 | Cannon--ggt;
8 | Epstein--kg;
9 | Epstein--ldt;
10 | Epstein--ggt;
11 | Epstein--hg;
12 | Conway--ggt;
13 | }
14 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/dir.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 |
3 | a -> b
4 | a -> c [dir=forward]
5 | a -> d [dir=back]
6 | a -> e [dir=both]
7 | a -> f [dir=none]
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/edgeclip.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | ab -> cd
3 | ab -> CD [tailclip=false]
4 | AB -> CD [headclip=false]
5 | AB -> cd [tailclip=false, headclip=false]
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/fdp.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | e
3 | subgraph clusterA {
4 | a -- b;
5 | subgraph clusterC {
6 | C -- D;
7 | }
8 | }
9 | subgraph clusterB {
10 | d -- f
11 | }
12 | d -- D
13 | e -- clusterB
14 | clusterC -- clusterB
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/flatedge.gv:
--------------------------------------------------------------------------------
1 | /* bug 1364, nonconstraint flat edge cycle */
2 | digraph {
3 | "tcp" -> "kernel_linux" [ label="linux" ];
4 | "usmStats" -> "usmStats-5.5" [ color=red,constraint=false ];
5 | "usmStats-5.5" -> "usmStats" [ color=red,constraint=false ];
6 | "snmpv3mibs" -> "snmpEngine";
7 | "snmpv3mibs" -> "usmStats-5.5";
8 | "snmpv3mibs" -> "usmStats" [ style=dashed ];
9 | }
10 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/fsm.gv:
--------------------------------------------------------------------------------
1 | digraph finite_state_machine {
2 |
3 | node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
4 | node [shape = circle];
5 | rankdir=LR;
6 | LR_0 -> LR_2 [ label = "SS(B)" ];
7 | LR_0 -> LR_1 [ label = "SS(S)" ];
8 | LR_1 -> LR_3 [ label = "S($end)" ];
9 | LR_2 -> LR_6 [ label = "SS(b)" ];
10 | LR_2 -> LR_5 [ label = "SS(a)" ];
11 | LR_2 -> LR_4 [ label = "S(A)" ];
12 | LR_5 -> LR_7 [ label = "S(b)" ];
13 | LR_5 -> LR_5 [ label = "S(a self)" ];
14 | LR_6 -> LR_6 [ label = "S(b)" ];
15 | LR_6 -> LR_5 [ label = "S(a)" ];
16 | LR_7 -> LR_8 [ label = "S(b)" ];
17 | LR_7 -> LR_5 [ label = "S(a)" ];
18 | LR_8 -> LR_6 [ label = "S(b)" ];
19 | LR_8 -> LR_5 [ label = "S(a)" ];
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/grdcluster.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster0 {
3 | fillcolor="blue:red"
4 | style="filled,rounded"
5 | 0
6 | }
7 | subgraph cluster1 {
8 | peripheries=0
9 | fillcolor="blue:red"
10 | style=filled
11 | 1
12 | }
13 | subgraph cluster2 {
14 | fillcolor="blue"
15 | style=filled
16 | 2
17 | }
18 | subgraph cluster3 {
19 | peripheries=0
20 | fillcolor="red"
21 | style="filled,rounded"
22 | 3
23 | }
24 | subgraph cluster4 {
25 | peripheries=0
26 | bgcolor="red:blue"
27 | 4
28 | }
29 | subgraph cluster5 {
30 | bgcolor="red:blue"
31 | 5
32 | }
33 | 0 -> 1 -> 2 -> 3 -> 4
34 | }
35 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/grdlinear_node.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | bgcolor="yellow:blue" gradientangle=60 label="Graph"
3 |
4 | subgraph cluster_1 {
5 | style=filled fillcolor="green:magenta" label="Cluster" fontcolor="white"
6 | node [style=filled]
7 | n5 [ shape="box",fillcolor="antiquewhite:aquamarine" ]
8 | n4 [ shape="ellipse",fillcolor="bisque4:blue2" ]
9 | n3 [ shape="circle",fillcolor="cadetblue1:chocolate1" ]
10 | n2 [ shape="diamond",fillcolor="crimson:cyan4" ]
11 | n1 [ shape="triangle",fillcolor="deepskyblue2:firebrick" ]
12 | n0 [ shape="pentagon",fillcolor="gray24:gray88" ]
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/grdradial_node.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | style=radial bgcolor="yellow:blue" label="Graph"
3 |
4 | subgraph cluster_1 {
5 | style=radial fillcolor="green:magenta" label="Cluster" fontcolor="white"
6 | node [style=radial]
7 | n5 [ shape="box",fillcolor="antiquewhite:aquamarine" ]
8 | n4 [ shape="ellipse",fillcolor="bisque4:blue2" ]
9 | n3 [ shape="circle",fillcolor="cadetblue1:chocolate1" ]
10 | n2 [ shape="diamond",fillcolor="crimson:cyan4" ]
11 | n1 [ shape="triangle",fillcolor="deepskyblue2:firebrick" ]
12 | n0 [ shape="pentagon",fillcolor="gray24:gray88" ]
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/hashtable.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | nodesep=.05;
3 | rankdir=LR;
4 | node [shape=record,width=.1,height=.1];
5 |
6 | node0 [label = " | | | | | | | ",height=2.0];
7 | node [width = 1.5];
8 | node1 [label = "{ n14 | 719 | }"];
9 | node2 [label = "{ a1 | 805 | }"];
10 | node3 [label = "{ i9 | 718 | }"];
11 | node4 [label = "{ e5 | 989 | }"];
12 | node5 [label = "{ t20 | 959 | }"] ;
13 | node6 [label = "{ o15 | 794 | }"] ;
14 | node7 [label = "{ s19 | 659 | }"] ;
15 |
16 | node0:f0 -> node1:n;
17 | node0:f1 -> node2:n;
18 | node0:f2 -> node3:n;
19 | node0:f5 -> node4:n;
20 | node0:f6 -> node5:n;
21 | node2:p -> node6:n;
22 | node4:p -> node7:n;
23 | }
24 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/html.gv:
--------------------------------------------------------------------------------
1 | digraph structs {
2 | node [shape=plaintext]
3 | struct1 [label=<
4 |
>];
7 | struct2 [label=<
8 | >];
11 | struct3 [label=<
12 |
13 |
14 | hello world |
15 | b |
16 | g |
17 | h |
18 |
19 |
20 | c | d | e |
21 |
22 |
23 | f |
24 |
25 |
>];
26 | struct1:f1 -> struct2:f0;
27 | struct1:f2 -> struct3:here;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/imports.gv:
--------------------------------------------------------------------------------
1 | digraph abstract {
2 | size="6,6";
3 | DrawingGraph -> {Arrowhead,
4 | CurveFactory,
5 | EdgeClass,
6 | GeomEdge,
7 | GeomGraph,
8 | GeomLabel,
9 | GeomNode,
10 | GraphClass,
11 | ICurve,
12 | Label,
13 | Point,
14 | Rectangle,
15 | Size,
16 | SugiyamaLayoutSettings,
17 | NodeClass, DrawingNode, DrawingObject, DrawingEdge, TextMeasurerOptions, ArrowTypeEnum, ShapeEnum};
18 | DrawingNode->{DrawingObject, ShapeEnum, NodeClass, Attribute}
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/in.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | ordering=in
3 | 1 -> 2
4 | 4 -> 3
5 | 1 -> 3
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/inv_inv.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath="/inv_dir/"
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (invalid absolute pathname) | imagepath attribute (invalid absolute pathname) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="no image should be displayed",image="/inv_dir/image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/inv_nul.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath=""
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (invalid absolute pathname) | imagepath attribute (null) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="no image should be displayed",image="/inv_dir/image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/inv_val.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath="imagepath_test/imagepath_dir/"
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (invalid absolute pathname) | imagepath attribute (valid absolute pathname) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="no image should be displayed",image="/inv_dir/image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/japanese.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | graph [label="下駄配列の派生図"]
3 |
4 | getas [label = "下駄配列"];
5 | new_getas [label = "新下駄配列"];
6 | getas_in_fine_weather [label = "日和下駄配列"];
7 | black_lacquered_getas [label = "黒塗り下駄配列"];
8 | black_lacquered_getas_made_of_paulownia [label = "黒塗り桐下駄配列"];
9 | lacquered_getas [label = "塗り下駄配列"];
10 | new_JIS_getas [label = "新JIS下駄配列"];
11 |
12 | getas -> {
13 | getas_in_fine_weather
14 | lacquered_getas
15 | new_JIS_getas new_getas
16 | lacquered_getas
17 | };
18 |
19 | lacquered_getas -> black_lacquered_getas;
20 | black_lacquered_getas -> black_lacquered_getas_made_of_paulownia;
21 | black_lacquered_getas_made_of_paulownia -> black_lacquered_getas;
22 |
23 | black_lacquered_getas -> getas_in_fine_weather [style = dotted];
24 | }
25 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/jcctree.gv:
--------------------------------------------------------------------------------
1 | digraph "tree" {
2 | // The problem disappeared when I removed the "ELEM3 -> ID5;" line!
3 | //size="4,5";
4 | ordering=out;
5 | node [shape=plaintext];
6 | SPEC -> DEF2;
7 | SPEC -> DEF1;
8 | DEF1 -> ID1;
9 | DEF1 -> SET1;
10 | DEF1 -> SC1;
11 | DEF2 -> ID2;
12 | DEF2 -> SET2;
13 | DEF2 -> SC2;
14 | SET1 -> OPEN1;
15 | SET1 -> ELEM1;
16 | SET1 -> SC3;
17 | SET1 -> ELEM2;
18 | SET1 -> CLOSE1;
19 | ELEM1 -> ID3;
20 | SET2 -> OPEN2;
21 | SET2 -> ELEM3;
22 | SET2 -> CLOSE2;
23 | ELEM2 -> ID4;
24 | ELEM3 -> ID5;
25 | DEF1 [label=DEF];
26 | DEF2 [label=DEF];
27 | SET1 [label=SET];
28 | SC1 [label=";"];
29 | SC3 [label=";"];
30 | SET2 [label=SET];
31 | SC2 [label=";"];
32 | OPEN1 [label="{"];
33 | OPEN2 [label="{"];
34 | CLOSE1 [label="}"];
35 | CLOSE2 [label="}"];
36 | ELEM1 [label=ELEMENT];
37 | ELEM2 [label=ELEMENT];
38 | ELEM3 [label=ELEMENT];
39 | ID1 [label=cities];
40 | ID2 [label=insects];
41 | ID3 [label=andover];
42 | ID4 [label=boston];
43 | ID5 [label=fly];
44 | }
45 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fbc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom";
10 | labeljust="center";
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fbd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fbl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom";
10 | labeljust="left";
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fbr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom";
10 | labeljust="right";
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fdc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labeljust="center";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fdd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fdl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labeljust="left";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-fdr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labeljust="right";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ftc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="top";
10 | labeljust="center";
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ftd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="top";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ftl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="top";
10 | labeljust="left";
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ftr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="top";
10 | labeljust="right";
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-nbc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="bottom";
9 | labeljust="center";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-nbd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="bottom";
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-nbl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="bottom";
9 | labeljust="left";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-nbr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="bottom";
9 | labeljust="right";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ndc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labeljust="center";
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ndd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | }
9 | subgraph cluster1 {
10 | c;
11 | d;
12 | c->d;
13 | label = "cluster1";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ndl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labeljust="left";
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ndr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labeljust="right";
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ntc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="top";
9 | labeljust="center";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ntd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="top";
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ntl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="top";
9 | labeljust="left";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelclust-ntr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="top";
9 | labeljust="right";
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fbc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="bottom";
5 | labeljust="center";
6 | subgraph cluster0 {
7 | a;
8 | b;
9 | a->b;
10 | label = "cluster0";
11 | labelloc="bottom"
12 | }
13 | subgraph cluster1 {
14 | c;
15 | d;
16 | c->d;
17 | label = "cluster1";
18 | labelloc="top"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fbd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="bottom";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fbl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="bottom";
5 | labeljust="left";
6 | subgraph cluster0 {
7 | a;
8 | b;
9 | a->b;
10 | label = "cluster0";
11 | labelloc="bottom"
12 | }
13 | subgraph cluster1 {
14 | c;
15 | d;
16 | c->d;
17 | label = "cluster1";
18 | labelloc="top"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fbr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="bottom";
5 | labeljust="right";
6 | subgraph cluster0 {
7 | a;
8 | b;
9 | a->b;
10 | label = "cluster0";
11 | labelloc="bottom"
12 | }
13 | subgraph cluster1 {
14 | c;
15 | d;
16 | c->d;
17 | label = "cluster1";
18 | labelloc="top"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fdc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labeljust="center";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fdd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom"
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | labelloc="top"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fdl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labeljust="left";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-fdr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labeljust="right";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ftc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="top";
5 | labeljust="center";
6 | subgraph cluster0 {
7 | a;
8 | b;
9 | a->b;
10 | label = "cluster0";
11 | labelloc="bottom"
12 | }
13 | subgraph cluster1 {
14 | c;
15 | d;
16 | c->d;
17 | label = "cluster1";
18 | labelloc="top"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ftd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="top";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ftl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="top";
5 | labeljust="left";
6 | subgraph cluster0 {
7 | a;
8 | b;
9 | a->b;
10 | label = "cluster0";
11 | labelloc="bottom"
12 | }
13 | subgraph cluster1 {
14 | c;
15 | d;
16 | c->d;
17 | label = "cluster1";
18 | labelloc="top"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ftr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir="LR";
3 | label = "label demo";
4 | labelloc="top";
5 | labeljust="right";
6 | subgraph cluster0 {
7 | a;
8 | b;
9 | a->b;
10 | label = "cluster0";
11 | labelloc="bottom"
12 | }
13 | subgraph cluster1 {
14 | c;
15 | d;
16 | c->d;
17 | label = "cluster1";
18 | labelloc="top"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-nbc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="bottom";
4 | labeljust="center";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-nbd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="bottom";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom"
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | labelloc="top"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-nbl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="bottom";
4 | labeljust="left";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-nbr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="bottom";
4 | labeljust="right";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ndc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labeljust="center";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom"
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | labelloc="top"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ndd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="bottom"
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | labelloc="top"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ndl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labeljust="left";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom"
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | labelloc="top"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ndr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labeljust="right";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom"
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | labelloc="top"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ntc.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="top";
4 | labeljust="center";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ntd.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="top";
4 | subgraph cluster0 {
5 | a;
6 | b;
7 | a->b;
8 | label = "cluster0";
9 | labelloc="bottom"
10 | }
11 | subgraph cluster1 {
12 | c;
13 | d;
14 | c->d;
15 | label = "cluster1";
16 | labelloc="top"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ntl.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="top";
4 | labeljust="left";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/labelroot-ntr.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | labelloc="top";
4 | labeljust="right";
5 | subgraph cluster0 {
6 | a;
7 | b;
8 | a->b;
9 | label = "cluster0";
10 | labelloc="bottom"
11 | }
12 | subgraph cluster1 {
13 | c;
14 | d;
15 | c->d;
16 | label = "cluster1";
17 | labelloc="top"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/layer.gv:
--------------------------------------------------------------------------------
1 |
2 | digraph G {
3 | layers="local:pvt:test:new:ofc";
4 |
5 | node1 [layer="pvt"];
6 | node2 [layer="all"];
7 | node3 [layer="pvt:ofc"]; /* pvt, test, new, and ofc */
8 | node2 -> node3 [layer="pvt:all"]; /* same as pvt:ofc */
9 | node2 -> node4 [layer=3]; /* same as test */
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/layer2.gv:
--------------------------------------------------------------------------------
1 |
2 | digraph G {
3 | layersep="+"
4 | layers="local+pvt+test+new+ofc";
5 |
6 | node1 [layer="pvt"];
7 | node2 [layer="all"];
8 | node3 [layer="pvt+ofc"]; /* pvt, test, new, and ofc */
9 | node2 -> node3 [layer="pvt+all"]; /* same as pvt:ofc */
10 | node2 -> node4 [layer=3]; /* same as test */
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/layers.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | layers="local:pvt:test:new:ofc";
3 |
4 | node1 [layer="pvt"];
5 | node2 [layer="all"];
6 | node3 [layer="pvt:ofc"]; /* pvt, test, new, and ofc */
7 | node2 -> node3 [layer="pvt:all"]; /* same as pvt:ofc */
8 | node2 -> node4 [layer=3]; /* same as test */
9 | }
10 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/longflat.gv:
--------------------------------------------------------------------------------
1 | digraph if
2 | {
3 | rankdir=TB;
4 | {rank=same;b;c;}
5 | a->b;
6 | c->b[label="long long long"];
7 | }
8 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/mike.gv:
--------------------------------------------------------------------------------
1 | digraph mike{
2 | size = "8,8";
3 | a -> A;
4 | a -> m;
5 | a -> E;
6 | t -> O;
7 | r -> V;
8 | r -> Q;
9 | p -> B;
10 | m -> R;
11 | l -> C;
12 | c -> C;
13 | W -> X;
14 | W -> D;
15 | V -> W;
16 | T -> U;
17 | Q -> T;
18 | Q -> H;
19 | Q -> A;
20 | O -> K;
21 | L -> U;
22 | K -> L;
23 | K -> J;
24 | K -> E;
25 | J -> I;
26 | R -> B;
27 | P -> F;
28 | H -> R;
29 | H -> P;
30 | U -> H;
31 | G -> U;
32 | E -> G;
33 | C -> Z;
34 | C -> D;
35 | S -> D;
36 | B -> N;
37 | B -> D;
38 | B -> S;
39 | M -> B;
40 | A -> M;
41 | N -> Y;
42 | }
43 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/multi.gv:
--------------------------------------------------------------------------------
1 | digraph G
2 | {
3 | a-> b
4 | }
5 |
6 | digraph H
7 | {
8 | c-> d
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/nestedclust.gv:
--------------------------------------------------------------------------------
1 | digraph G { node[style=filled fillcolor="#00ff005f" color="#00ff005f"]
2 | subgraph {e->f subgraph cluster_ss81 {a->b->c}};
3 | subgraph { subgraph { subgraph { subgraph cluster_x { x; subgraph cluster_y {y }}}}}
4 | }
5 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/nhg.gv:
--------------------------------------------------------------------------------
1 | digraph automata_0 {
2 | size ="8.5, 11";
3 | node [shape = circle];
4 | 0 [ style = filled, color=lightgrey ];
5 | 2 [ shape = doublecircle ];
6 | 0 -> 2 [ label = "a " ];
7 | 0 -> 1 [ label = "other " ];
8 | 1 -> 2 [ label = "a " ];
9 | 1 -> 1 [ label = "other " ];
10 | 2 -> 2 [ label = "a " ];
11 | 2 -> 1 [ label = "other " ];
12 | "Machine: a" [ shape = plaintext ];
13 | }
14 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/nojustify.gv:
--------------------------------------------------------------------------------
1 | digraph G{
2 | node [shape=box, label="aaaaaaaaaaaaaa\nddd\l"]
3 | n [width=3]
4 | m [width=3, nojustify=true]
5 | b [nojustify=true]
6 | n -> m
7 | l -> p
8 | l [shape=record, label="{aaaaaaaaaaaaaa\n | bbbbbb\nddd\l}"]
9 | p [nojustify=true, shape=record, label="{aaaaaaaaaaaaaa\n | bbbbbb\nddd\l}"]
10 | a -> b
11 | }
12 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/nul_inv.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath="/inv_dir/"
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (null) | imagepath attribute (invalid absolute pathname) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="no image for Graphviz.app, else image from working directory",image="image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/nul_nul.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath=""
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (null) | imagepath attribute (null) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="image in working directory should be displayed",image="image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/nul_val.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath="imagepath_test/imagepath_dir/"
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (null) | imagepath attribute (valid absolute pathname) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="image from imagepath attribute directory or working directory should be displayed",image="image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ordering.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | 0 -> 1
3 | 0 -> 2
4 | 1 -> 3
5 | 1 -> 5
6 | 1 -> 7
7 | 2 -> 4
8 | 2 -> 5
9 | 2 -> 6
10 | 2 -> 8
11 | 3 -> 9
12 | 5 -> 9
13 | 6 -> 9
14 | 7 -> 9
15 | 4 -> 10
16 | 8 -> 10
17 | 6 -> 10
18 | }
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/p.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | kernel [ root=true ]
3 | run -- intr;
4 | intr -- runbl;
5 | runbl -- run;
6 | run -- kernel;
7 | kernel -- zombie;
8 | kernel -- sleep;
9 | kernel -- runmem;
10 | sleep -- swap;
11 | swap -- runswap;
12 | runswap -- new;
13 | runswap -- runmem;
14 | new -- runmem;
15 | sleep -- runmem;
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/p2.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | run -- intr;
3 | intr -- runbl;
4 | runbl -- run;
5 | run -- runmem;
6 | /* run -- kernel; */
7 | kernel -- zombie;
8 | kernel -- sleep;
9 | kernel -- runmem;
10 | sleep -- swap;
11 | swap -- runswap;
12 | runswap -- new;
13 | runswap -- runmem;
14 | new -- runmem;
15 | sleep -- runmem;
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/p3.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | run -- intr;
3 | intr -- runbl;
4 | runbl -- run;
5 | run -- kernel;
6 | kernel -- zombie;
7 | kernel -- sleep;
8 | kernel -- runmem;
9 | sleep -- swap;
10 | swap -- runswap;
11 | runswap -- new;
12 | runswap -- runmem;
13 | new -- runmem;
14 | sleep -- runmem;
15 | kernel -- 1
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/p4.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | run -- intr;
3 | intr -- runbl;
4 | runbl -- run;
5 | run -- kernel;
6 | /* run -- runmem; */
7 | kernel -- zombie
8 | kernel -- sleep;
9 | kernel -- runmem;
10 | sleep -- swap;
11 | swap -- runswap;
12 | runswap -- new;
13 | runswap -- runmem;
14 | new -- runmem;
15 | sleep -- runmem;
16 | zombie -- 1 -- 2 -- 4 -- 5 -- 6 -- 7 -- 8 -- zombie;
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/pack.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | 1 -- { 2 3 4 5 6}
3 | 2 -- { 8 9 10}
4 | 3 -- 11 -- 12 -- 13
5 | a1 -- { a2 a3 a4 a5 a6}
6 | a2 -- { a8 a9 a10}
7 | A -- B
8 | C
9 | }
10 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ports.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | node [shape=box]
3 | TOP -> {rank=same a b c d e f } -> BOTTOM
4 | b [shape=record, label="left |{up | middle | down } | right"]
5 | d [shape=none
6 | label=<
7 |
8 | LEFT |
9 | MIDDLE |
10 |
11 |
12 | RIGHTTOP |
13 | RIGHTBOTTOM |
14 |
15 | |
16 |
17 |
> ]
18 | A:s -> a:n
19 | a:w ->f:e
20 | f:n -> d:htmlleft
21 | a:ne -> d:inner:n
22 | a:s ->b:down:se
23 | a:w -> B:e
24 | D -> b:left
25 | C -> b:middle:e
26 | }
27 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/process.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | run -- intr;
3 | intr -- runbl;
4 | runbl -- run;
5 | run -- kernel;
6 | kernel -- zombie;
7 | kernel -- sleep;
8 | kernel -- runmem;
9 | sleep -- swap;
10 | swap -- runswap;
11 | runswap -- new;
12 | runswap -- runmem;
13 | new -- runmem;
14 | sleep -- runmem;
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ps.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | a [style=filled shape=DFDbox]
3 | a -> b
4 | }
5 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/ps_user_shapes.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | n [label=""]
3 | }
4 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/record2.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | node [shape=record];
3 | a [label = " foo | x | bar"];
4 | b [label = "a | { foo | x | bar } | b"];
5 | a:f0 -> b:f1
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/records.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | rankdir=LR;
3 | node [shape=record];
4 | a [ label =" Graphs can\lbe fun\l| mid| right\r"];
5 | b [ label =" | b | " ];
6 | c [ label =" | c | " ];
7 | x [ label =" | x | " ];
8 | y [ label =" | y | " ];
9 | z [ label =" | z | " ];
10 | a:bala -> b:left;
11 | a:f1 -> d;
12 | a:f2 -> y:"p1";
13 | c:"p1" -> d;
14 | b:mid -> x:"p1";
15 | c:"p2" -> y:"p2";
16 | b:left -> z:"p2";
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/rootlabel.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | label = "label demo";
3 | subgraph cluster0 {
4 | a;
5 | b;
6 | a->b;
7 | label = "cluster0";
8 | labelloc="bottom"
9 | }
10 | subgraph cluster1 {
11 | c;
12 | d;
13 | c->d;
14 | label = "cluster1";
15 | labelloc="top"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/rowcolsep.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | node [shape=box]
3 |
4 | aaa -> bbb
5 | aaa -> BBB
6 | AAA -> BBB
7 | AAA -> bbb
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/russian.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | Контрагенты -> БанковскиеСчета;
3 | Организации -> БанковскиеСчета;
4 | ВопросыДляАнкетирования -> ВариантыОтветовОпросов;
5 | Контрагенты -> ДоговорыВзаиморасчетов;
6 | Номенклатура -> ЕдиницыИзмерения;
7 | НоменклатурныеГруппы -> ЕдиницыИзмерения;
8 | СвойстваОбектов -> ЗначенияСвойствОбектов;
9 | }
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/sb_box.gv:
--------------------------------------------------------------------------------
1 | digraph G{ label="SelfBottom"
2 | node [shape = box] "node55";
3 | "node55" -> "node55"[label ="tailport=se headport=se" tailport=se headport=se];
4 | "node55" -> "node66"
5 | "node66" -> "node66"[label ="tailport=s headport=s" tailport=s headport=s];
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/sb_box_dbl.gv:
--------------------------------------------------------------------------------
1 | digraph G{ label="SelfBottom"
2 | node [shape = box] "node55";
3 | "node55" -> "node55"[label ="tailport=se headport=se" tailport=se headport=se];
4 | "node55" -> "node55"[label ="tailport=se headport=se" tailport=se headport=se];
5 | "node55" -> "node66"
6 | "node66" -> "node66"[label ="tailport=s headport=s" tailport=s headport=s];
7 | "node66" -> "node66"[label ="tailport=s headport=s" tailport=s headport=s];
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/sb_circle.gv:
--------------------------------------------------------------------------------
1 | digraph G{ label="SelfBottom"
2 | node [shape = circle] "node55";
3 | "node55" -> "node55"[label ="tailport=se headport=se" tailport=se headport=se];
4 | "node55" -> "node66"
5 | "node66" -> "node66"[label ="tailport=s headport=s" tailport=s headport=s];
6 | }
7 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/sb_circle_dbl.gv:
--------------------------------------------------------------------------------
1 | digraph G{ label="SelfBottom"
2 | node [shape = circle] "node55";
3 | "node55" -> "node55"[label ="tailport=se headport=se" tailport=se headport=se];
4 | "node55" -> "node55"[label ="tailport=se headport=se" tailport=se headport=se];
5 | "node55" -> "node66"
6 | "node66" -> "node66"[label ="tailport=s headport=s" tailport=s headport=s];
7 | "node66" -> "node66"[label ="tailport=s headport=s" tailport=s headport=s];
8 | }
9 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/self.gv:
--------------------------------------------------------------------------------
1 | digraph finite_state_machine {
2 |
3 | node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
4 | node [shape = circle];
5 | rankdir=LR;
6 | LR_5 -> LR_5 [ label = "S(a self)" ];
7 | }
8 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/shapes.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | a [shape=box]
3 | b [shape=polygon]
4 | c [shape=ellipse]
5 | d [shape=circle]
6 | e [shape=point]
7 | f [shape=egg]
8 | g [shape=triangle]
9 | h [shape=plaintext]
10 | i [shape=diamond]
11 | j [shape=trapezium]
12 | k [shape=parallelogram]
13 | l [shape=house]
14 | m [shape=pentagon]
15 | n [shape=hexagon]
16 | o [shape=septagon]
17 | p [shape=octagon]
18 | q [shape=doublecircle]
19 | r [shape=doubleoctagon]
20 | s [shape=tripleoctagon]
21 | t [shape=invtriangle]
22 | u [shape=invtrapezium]
23 | v [shape=invhouse]
24 | w [shape=Mdiamond]
25 | x [shape=Msquare]
26 | y [shape=Mcircle]
27 | z [shape=rect]
28 | 1 [shape=rectangle]
29 | 2 [shape=none]
30 | 3 [shape=note]
31 | 4 [shape=tab]
32 | 5 [shape=box3d]
33 | 6 [shape=component]
34 | 7 [shape=folder]
35 | a -> b -> c -> d -> e -> f -> g
36 | h -> i -> j -> k -> l -> m -> n
37 | o -> p -> q -> r -> s -> t -> u
38 | v -> w -> x -> y -> z -> 1 -> 2
39 | 3 -> 4 -> 5 -> 6 -> 7
40 | }
41 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/sides.gv:
--------------------------------------------------------------------------------
1 | graph {
2 | abc [shape=none, label = <
3 | bottom |
4 | right |
5 | top |
6 | left |
7 | bottomright |
8 | righttop |
9 | topleft |
10 | leftbottom |
11 | bottomrighttop |
12 | righttopleft |
13 | topleftbottom |
14 | leftbottomright |
15 | topbottom |
16 | leftright |
17 |
> ]
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/states.gv:
--------------------------------------------------------------------------------
1 | /*
2 | The command line is
3 |
4 | dot -Tps -Grankdir=LR states.gv > states.ps
5 |
6 | and the file is:
7 | */
8 | digraph states {
9 | size="3,2";
10 | rankdir=LR;
11 | node [shape=ellipse];
12 | empty [label = "Empty"];
13 | stolen [label = "Stolen"];
14 | waiting [label = "Waiting"];
15 | full [label = "Full"];
16 | empty -> full [label = "return"]
17 | empty -> stolen [label = "dispatch", wt=28]
18 | stolen -> full [label = "return"];
19 | stolen -> waiting [label = "touch"];
20 | waiting -> full [label = "return"];
21 | }
22 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/structs.gv:
--------------------------------------------------------------------------------
1 | digraph structs {
2 | node [shape=record];
3 | struct1 [shape=record,label=" left| middle| right"];
4 | struct2 [shape=record,label=" one| two"];
5 | struct3 [shape=record,label="hello\nworld |{ b |{c| d|e}| f}| g | h"];
6 | struct1:f1 -> struct2:f0;
7 | struct1:f2 -> struct3:here;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/train11.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | size="6,6";
3 | node [shape=circle,fontsize=8];
4 | rankdir=LR;
5 | st9 -> st9 [label="11/1"];
6 | st9 -> st10 [label="10/1"];
7 | st8 -> st8 [label="10/1"];
8 | st8 -> st0 [label="00/-"];
9 | st7 -> st8 [label="10/1"];
10 | st7 -> st7 [label="00/1"];
11 | st6 -> st6 [label="01/1"];
12 | st6 -> st0 [label="00/-"];
13 | st5 -> st6 [label="01/1"];
14 | st5 -> st5 [label="11/1"];
15 | st4 -> st4 [label="01/1"];
16 | st4 -> st0 [label="00/-"];
17 | st3 -> st4 [label="01/1"];
18 | st3 -> st3 [label="00/1"];
19 | st2 -> st9 [label="11/1"];
20 | st2 -> st7 [label="00/1"];
21 | st2 -> st2 [label="01/1"];
22 | st10 -> st10 [label="10/1"];
23 | st10 -> st0 [label="00/-"];
24 | st1 -> st5 [label="11/1"];
25 | st1 -> st3 [label="00/1"];
26 | st1 -> st1 [label="10/1"];
27 | st0 -> st2 [label="01/-"];
28 | st0 -> st1 [label="10/-"];
29 | st0 -> st0 [label="00/0"];
30 | }
31 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/tree.gv:
--------------------------------------------------------------------------------
1 | digraph g {
2 | node [shape = record,height=.1];
3 | node0[label = " | G| "];
4 | node1[label = " | E| "];
5 | node2[label = " | B| "];
6 | node3[label = " | F| "];
7 | node4[label = " | R| "];
8 | node5[label = " | H| "];
9 | node6[label = " | Y| "];
10 | node7[label = " | A| "];
11 | node8[label = " | C| "];
12 | "node0":f2 -> "node4":f1;
13 | "node0":f0 -> "node1":f1;
14 | "node1":f0 -> "node2":f1;
15 | "node1":f2 -> "node3":f1;
16 | "node2":f2 -> "node8":f1;
17 | "node2":f0 -> "node7":f1;
18 | "node4":f2 -> "node6":f1;
19 | "node4":f0 -> "node5":f1;
20 | }
21 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/try.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster_small {
3 | a -> b;
4 | label=small;
5 | }
6 |
7 | subgraph cluster_big {
8 | p -> q -> r -> s -> t;
9 | label=big;
10 | t -> p;
11 | }
12 |
13 | t -> a;
14 | b -> q;
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/user_shapes.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | n [label="", shapefile="graphs/jcr.gif"]
3 | x [width=3, height=3, label="", shapefile="graphs/jcr.gif"]
4 | m -> n -> x
5 | }
6 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/val_inv.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath="/inv_dir/"
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (valid absolute pathname) | imagepath attribute (invalid absolute pathname) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="image from image attribute directory should be displayed",image="imagepath_test/image_dir/image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/val_nul.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath=""
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (valid absolute pathname) | imagepath attribute (null) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="image from image attribute directory should be displayed",image="imagepath_test/image_dir/image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/val_val.gv:
--------------------------------------------------------------------------------
1 | graph G { imagepath="imagepath_test/imagepath_dir/"
2 |
3 | a[shape=plaintext,label=<
6 | image attribute (valid absolute pathname) | imagepath attribute (valid absolute pathname) |
7 | |
>];
8 | b[shape=box,fontsize=30,fontname="Helvetica-Bold",label="image from image attribute directory should be displayed",image="imagepath_test/image_dir/image.jpg",labelloc=b];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/modules/core/test/data/graphvis/xlabels.gv:
--------------------------------------------------------------------------------
1 | digraph weight_tree{
2 | node [shape=box color=lightblue,style=filled];
3 |
4 | all [label="All items",xlabel="100"];
5 | t1 [label="Part 1",xlabel="75"];
6 | t2 [label="Part 2",xlabel="25"];
7 | p1 [label="pPart 1",xlabel="50"];
8 | p2 [label="pPart 2",xlabel="50"];
9 | p3 [label="pPart 3",xlabel="50"];
10 | p4 [label="pPart 4",xlabel="50"];
11 | all -> t1 [label="75%"];
12 | all -> t2;
13 | t1 -> p1 [label="20%"];
14 | t1 -> p2;
15 | t2 -> p3;
16 | t2 -> p4;
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/modules/core/test/data/smallGraphs/clust_.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | subgraph cluster0 {
3 | x0 -> y0;
4 | x0 -> z0;
5 | }
6 |
7 | subgraph cluster1 {
8 | x1 -> y1;
9 | x1 -> z1;
10 | }
11 | cluster0 -> cluster1
12 |
13 | }
--------------------------------------------------------------------------------
/modules/core/test/data/smallGraphs/fork.gv:
--------------------------------------------------------------------------------
1 | digraph G {
2 | a -> c
3 | b -> c
4 | }
--------------------------------------------------------------------------------
/modules/core/test/data/smallGraphs/process.gv:
--------------------------------------------------------------------------------
1 | graph G {
2 | run -- intr;
3 | intr -- runbl;
4 | runbl -- run;
5 | run -- kernel;
6 | kernel -- zombie;
7 | kernel -- sleep;
8 | kernel -- runmem;
9 | sleep -- swap;
10 | swap -- runswap;
11 | runswap -- new;
12 | runswap -- runmem;
13 | new -- runmem;
14 | sleep -- runmem;
15 | }
16 |
--------------------------------------------------------------------------------
/modules/core/test/layout/driver.spec.ts:
--------------------------------------------------------------------------------
1 | import {GeomGraph} from '@msagl/core'
2 | import {layoutGeomGraph} from '../../src/layout/driver'
3 | import * as testUtils from '../utils/testUtils'
4 | import {DrawingGraph} from '@msagl/drawing'
5 |
6 | test('layoutGeomGraph', () => {
7 | const g = testUtils.parseDotGraph('graphvis/clust.gv')
8 | const dg = DrawingGraph.getDrawingGraph(g)
9 | dg.createGeometry((s) => testUtils.measureTextSize(s, {}))
10 | const geomGraph = GeomGraph.getGeom(dg.graph)
11 | layoutGeomGraph(geomGraph, null)
12 | // SvgDebugWriter.writeGeomGraph('./tmp/test_layoutGeomGraph.svg', geomGraph)
13 | })
14 |
15 | test('ldbxtried', () => {
16 | const g = testUtils.parseDotGraph('graphvis/ldbxtried.gv')
17 | const dg = DrawingGraph.getDrawingGraph(g)
18 | dg.createGeometry((s) => testUtils.measureTextSize(s, {}))
19 | const geomGraph = GeomGraph.getGeom(dg.graph)
20 | layoutGeomGraph(geomGraph, null)
21 | // SvgDebugWriter.writeGeomGraph('./tmp/ldbxtried.svg', geomGraph)
22 | })
23 |
--------------------------------------------------------------------------------
/modules/core/test/layout/edgeLabelPlacement.spec.ts:
--------------------------------------------------------------------------------
1 | import {DrawingGraph} from '../../../drawing/src'
2 | import {GeomGraph} from '../../src/layout/core'
3 | import {layoutGraphWithMds} from '../../src/layout/mds/pivotMDS'
4 | import {parseDotGraph} from '../utils/testUtils'
5 |
6 | test('fsm', () => {
7 | const dg = runLayout('graphvis/fsm.gv')
8 | // SvgDebugWriter.writeGeomGraph('./tmp/fsm_with_labels.svg', GeomObject.getGeom(dg.graph))
9 | })
10 |
11 | function runLayout(fname: string): DrawingGraph {
12 | const dg = DrawingGraph.getDrawingGraph(parseDotGraph(fname))
13 | dg.createGeometry()
14 | layoutGraphWithMds(GeomGraph.getGeom(dg.graph))
15 | return dg
16 | }
17 |
--------------------------------------------------------------------------------
/modules/core/test/layout/layered/layering/NetworkSimplex.spec.ts:
--------------------------------------------------------------------------------
1 | import {CancelToken} from '../../../../src'
2 | import {NetworkSimplex} from '../../../../src/layout/layered/layering/NetworkSimplex'
3 | import {PolyIntEdge} from '../../../../src/layout/layered/polyIntEdge'
4 | import {mkGraphOnEdgesArray} from '../../../../src/structs/basicGraphOnEdges'
5 |
6 | test('network simplex', () => {
7 | // This is the example from North, Gansnern etc. 1993 paper
8 | // (ab)(bc)(cd)(dh)(af)(fg)(ae)(eg)(gh)
9 | const a = 0
10 | const b = 1
11 | const c = 2
12 | const d = 3
13 | const e = 4
14 | const f = 5
15 | const g = 6
16 | const h = 7
17 | const edge = (a: number, b: number) => new PolyIntEdge(a, b, null)
18 | const edges = [edge(a, b), edge(b, c), edge(c, d), edge(d, h), edge(a, f), edge(f, g), edge(a, e), edge(e, g), edge(g, h)]
19 | const graph = mkGraphOnEdgesArray(edges)
20 | const ns = new NetworkSimplex(graph, new CancelToken())
21 | ns.run()
22 | expect(ns.weight).toBe(10)
23 | })
24 |
--------------------------------------------------------------------------------
/modules/core/test/layout/mds/Transform.spec.ts:
--------------------------------------------------------------------------------
1 | import {Transform} from '../../../src/layout/mds/Transform'
2 | import {closeDistEps} from '../../../src/utils/compare'
3 |
4 | test('transform.rotate', () => {
5 | const x = [1, 1]
6 | const y = [0, 0]
7 | Transform.Rotate(x, y, 30)
8 | const cos = Math.cos((Math.PI / 180) * 30)
9 | const sin = Math.sin((Math.PI / 180) * 30)
10 | expect(closeDistEps(x[0], cos)).toBe(true)
11 | expect(x[0]).toBe(x[1])
12 | expect(closeDistEps(y[0], -sin)).toBe(true)
13 | expect(y[0]).toBe(y[1])
14 | })
15 |
--------------------------------------------------------------------------------
/modules/core/test/math/geometry/compassVector.spec.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../src'
2 | import {CompassVector, Direction} from '../../../src/math/geometry'
3 |
4 | test('rotate', () => {
5 | const north = new CompassVector(Direction.North)
6 | const rrNorth = north.Right
7 | expect(rrNorth.Dir).toBe(Direction.East)
8 | expect(CompassVector.RotateLeft(Direction.East)).toBe(Direction.North)
9 | })
10 |
11 | test('VectorDirection', () => {
12 | const p = new Point(-1, 1)
13 | const dir = CompassVector.VectorDirection(p)
14 | expect(dir).toBe(Direction.West | Direction.North)
15 | const dirpp = CompassVector.VectorDirectionPP(new Point(0, 0), p)
16 | expect(dirpp).toBe(dir)
17 | const dd = Direction.East | Direction.South
18 | const ddVec = CompassVector.toPoint(dd)
19 | expect(ddVec.x).toBe(1)
20 | expect(ddVec.y).toBe(-1)
21 | })
22 |
--------------------------------------------------------------------------------
/modules/core/test/math/geometry/geomConstants.spec.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '@msagl/core'
2 |
3 | test('round', () => {
4 | let rp = Point.RoundDouble(1.2222225)
5 | expect(rp).toBe(1.222223)
6 | expect(Point.RoundDouble(1.2222224)).toBe(1.222222)
7 | rp = Point.RoundDouble(1.2222226)
8 | expect(rp).toBe(1.222223)
9 | expect(Point.RoundDouble(1.9999996)).toBe(2)
10 | expect(Point.RoundDouble(1.3333334)).toBe(1.333333)
11 | expect(Point.RoundDouble(1.0000011)).toBe(1.000001)
12 | expect(Point.RoundDouble(1.0000019)).toBe(1.000002)
13 | })
14 |
--------------------------------------------------------------------------------
/modules/core/test/math/geometry/linearSystem.spec.ts:
--------------------------------------------------------------------------------
1 | import {LinearSystem2} from './../../../src/math/geometry/linearSystem'
2 | test('linearSystem2 test', () => {
3 | let xy = LinearSystem2.solve(1, 0, 0, 0, 1, 0)
4 | expect(xy.x).toBe(0)
5 | expect(xy.y).toBe(0)
6 | xy = LinearSystem2.solve(0, 1, 0, 0, 1, 0)
7 | expect(xy).toBe(undefined)
8 | })
9 |
--------------------------------------------------------------------------------
/modules/core/test/math/geometry/rectangle.spec.ts:
--------------------------------------------------------------------------------
1 | import {Rectangle, Point} from '../../../src'
2 |
3 | test('rectangle test', () => {
4 | const r = new Rectangle({left: 0, right: 1, top: 1, bottom: 0})
5 | const p = new Point(0.3, 0.3)
6 | expect(r.contains(p)).toBe(true)
7 | const r0 = new Rectangle({left: 1, right: 4, top: 1, bottom: 0})
8 | expect(r.intersects(r0)).toBe(true)
9 | r0.center = new Point(12, 0)
10 | expect(r.intersects(r0)).toBe(false)
11 | })
12 |
--------------------------------------------------------------------------------
/modules/core/test/math/geometry/smoothedPolyline.spec.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../src'
2 | import {Polyline} from '../../../src/math/geometry'
3 | import {SmoothedPolyline} from '../../../src/math/geometry/smoothedPolyline'
4 | //import {SvgDebugWriter} from '../../utils/svgDebugWriter'
5 |
6 | test('smooth test', () => {
7 | const ps = [new Point(0, 100), new Point(100, 100), new Point(200, 10), new Point(300, 0)]
8 |
9 | let sp = SmoothedPolyline.mkFromPoints(ps)
10 | let poly = Polyline.mkFromPoints(ps)
11 | expect(poly.count).toBe(ps.length)
12 | //SvgDebugWriter.dumpICurves('./tmp/sp.svg', [poly, sp.createCurve()])
13 |
14 | ps[0] = new Point(0, 0)
15 | sp = SmoothedPolyline.mkFromPoints(ps)
16 | poly = Polyline.mkFromPoints(ps)
17 | //SvgDebugWriter.dumpICurves('./tmp/sp1.svg', [poly, sp.createCurve()])
18 | })
19 |
--------------------------------------------------------------------------------
/modules/core/test/math/graphAlgorithms/MinimumSpanningTreeByPrim.spec.ts:
--------------------------------------------------------------------------------
1 | import {MinimumSpanningTreeByPrim} from '../../../src/math/graphAlgorithms/MinimumSpanningTreeByPrim'
2 | import {mkGraphOnEdgesArray} from '../../../src/structs/basicGraphOnEdges'
3 | import {IntPair} from '../../../src/utils/IntPair'
4 |
5 | test('rombus with diagal', () => {
6 | const edges = [new IntPair(0, 1), new IntPair(1, 2), new IntPair(2, 3), new IntPair(3, 0), new IntPair(0, 2)]
7 | const graph = mkGraphOnEdgesArray(edges)
8 | const mstree = new MinimumSpanningTreeByPrim(graph, (e) => (e === edges[4] ? 2 : 1), 1)
9 | const tree = mstree.GetTreeEdges()
10 |
11 | expect(tree.length).toBe(3)
12 | const nodes = new Set()
13 | nodes.add(0)
14 | nodes.add(1)
15 | nodes.add(2)
16 | nodes.add(3)
17 | for (const e of tree) {
18 | nodes.delete(e.source)
19 | nodes.delete(e.target)
20 | }
21 | expect(nodes.size).toBe(0)
22 | expect(tree.find((e) => e === edges[4])).toBe(undefined)
23 | const e = tree.find((e) => e === edges[0] || e === edges[1])
24 | expect(e == null).toBe(false)
25 | })
26 |
--------------------------------------------------------------------------------
/modules/core/test/routing/InteractiveEdgeRouter.spec.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../src'
2 | import {Polyline} from '../../src/math/geometry'
3 |
4 | test('RemoveCollinearVertices from polyline', () => {
5 | const a = new Point(0, 0)
6 | const b = new Point(1, 0)
7 | const c = new Point(1, 1)
8 | const d = new Point(0, 1)
9 | const e = Point.middle(b, c)
10 | let poly = Polyline.mkFromPoints([a, b, e, c, d])
11 | poly = poly.RemoveCollinearVertices()
12 | expect(poly.count).toBe(4)
13 | })
14 |
--------------------------------------------------------------------------------
/modules/core/test/routing/interactiveObstacleCalculator.spec.ts:
--------------------------------------------------------------------------------
1 | import {Rectangle} from '../../src'
2 | import {Point, Polyline} from '../../src/math/geometry'
3 | import {InteractiveObstacleCalculator} from '../../src/routing/interactiveObstacleCalculator'
4 | import {SvgDebugWriter} from '../utils/svgDebugWriter'
5 | test('padded rectangle', () => {
6 | const rect = Rectangle.mkPP(new Point(0, 0), new Point(100, 50))
7 | const poly = rect.perimeter()
8 | expect(poly instanceof Polyline).toBe(true)
9 | const paddedPoly = InteractiveObstacleCalculator.CreatePaddedPolyline(poly, 10)
10 | SvgDebugWriter.dumpICurves('./tmp/paddedRect.svg', [poly, paddedPoly])
11 | })
12 |
13 | test('padded triangle', () => {
14 | const poly = Polyline.mkClosedFromPoints([new Point(0, 0), new Point(10, 100), new Point(20, 0)])
15 |
16 | expect(poly instanceof Polyline).toBe(true)
17 | const paddedPoly = InteractiveObstacleCalculator.CreatePaddedPolyline(poly, 10)
18 | SvgDebugWriter.dumpICurves('./tmp/paddedTri.svg', [poly, paddedPoly])
19 | })
20 |
--------------------------------------------------------------------------------
/modules/core/test/routing/rectilinear/PointComparer.spec.ts:
--------------------------------------------------------------------------------
1 | import {PointComparer} from '../../../src/routing/rectilinear/PointComparer'
2 |
3 | test('equal', () => {
4 | expect(PointComparer.Equal(1.0, 1.0000001)).toBe(true)
5 | expect(PointComparer.Equal(1.0, 1.00001)).toBe(false)
6 | expect(PointComparer.Equal(1.0, 1.000001)).toBe(false)
7 | })
8 |
--------------------------------------------------------------------------------
/modules/core/test/routing/rectilinear/SparseVisibiltyGraphGenerator.spec.ts:
--------------------------------------------------------------------------------
1 | test('generate', () => {
2 | expect(1).toBe(1)
3 | })
4 |
--------------------------------------------------------------------------------
/modules/core/test/routing/shape.spec.ts:
--------------------------------------------------------------------------------
1 | import {Shape} from '../../src/routing/shape'
2 |
3 | test('parents', () => {
4 | const a = new Shape(null)
5 | const b = new Shape(null)
6 | a.AddParent(b)
7 | const c = Shape.mkShape()
8 | b.AddParent(c)
9 | const ancestors = [...a.Ancestors()]
10 | expect(ancestors.length).toBe(2)
11 | const children = [...c.Children]
12 | expect(children.length).toBe(1)
13 | const achildren = [...a.Children]
14 | expect(achildren.length).toBe(0)
15 | })
16 |
--------------------------------------------------------------------------------
/modules/core/test/routing/visibility/Bimodal.spec.ts:
--------------------------------------------------------------------------------
1 | import {BimodalSequence} from '../../../src/routing/visibility/BimodalSequence'
2 |
3 | test('unimodal sequence', () => {
4 | let t = [0, 1, 2, 3, 1, 0, -1, -2, -3, -4, -2]
5 | const f = (m: number) => t[m]
6 | let us = new BimodalSequence(f, t.length)
7 | expect(us.FindMinimum()).toBe(t.length - 2)
8 | expect(us.FindMaximum()).toBe(3)
9 | t = [2, 3, 1]
10 | us = new BimodalSequence(f, t.length)
11 | expect(us.FindMinimum()).toBe(t.length - 1)
12 | expect(us.FindMaximum()).toBe(1)
13 | })
14 |
--------------------------------------------------------------------------------
/modules/core/test/routing/visibility/UnimodalSequence.spec.ts:
--------------------------------------------------------------------------------
1 | import {UnimodalSequence} from '../../../src/routing/visibility/UnimodalSequence'
2 |
3 | test('unimodal sequence', () => {
4 | const t = [0, 1, 2, 3, 1, 0]
5 | const f = (m: number) => t[m]
6 | let us = new UnimodalSequence(f, t.length)
7 | const min = us.FindMinimum()
8 | expect(min === 0 || min === t.length - 1).toBe(true)
9 | expect(us.FindMaximum()).toBe(3)
10 |
11 | const l = [0, 1, 2, 3, 3.1, 1, -1]
12 | us = new UnimodalSequence((u) => l[u], l.length)
13 | expect(us.FindMinimum()).toBe(l.length - 1)
14 | expect(us.FindMaximum()).toBe(4)
15 | })
16 |
--------------------------------------------------------------------------------
/modules/core/test/routing/visibility/VisibilityGraph.spec.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../../src'
2 | import {VisibilityGraph} from '../../../src/routing/visibility/VisibilityGraph'
3 |
4 | test('vg', () => {
5 | const g = new VisibilityGraph()
6 | g.AddVertexP(new Point(0, 0))
7 | g.AddVertexP(new Point(0, 1))
8 | const vv = [...g.Vertices()]
9 | expect(vv.length).toBe(2)
10 | })
11 | test('vg0', () => {
12 | const g = new VisibilityGraph()
13 | g.AddVertexP(new Point(0, 0))
14 | g.AddVertexP(new Point(0, 1))
15 | const v = g.FindVertex(new Point(0, 0))
16 | expect(v.point.equal(new Point(0, 0))).toBe(true)
17 | const u = g.FindVertex(new Point(0, 0.5))
18 | expect(u == null).toBe(true)
19 | g.RemoveVertex(v)
20 | })
21 |
22 | test('e0', () => {
23 | const g = new VisibilityGraph()
24 | const a = new Point(0, 0)
25 | const b = new Point(1, 2)
26 | const c = new Point(5, 0)
27 | g.AddVertexP(a)
28 | g.AddVertexP(b)
29 | g.AddVertexP(c)
30 | const ab = g.AddEdgePP(a, b)
31 | const e_ab = g.FindEdgePP(a, b)
32 | expect(ab).toBe(e_ab)
33 | })
34 |
--------------------------------------------------------------------------------
/modules/core/test/structs/BinaryHeapWithComparer.spec.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../src'
2 | import {LineSegment} from '../../src/math/geometry'
3 | import {BinaryHeapWithComparer} from '../../src/structs/BinaryHeapWithComparer'
4 |
5 | test('lines', () => {
6 | const short = LineSegment.mkPP(new Point(0, 0), new Point(1, 0))
7 | const medium = LineSegment.mkPP(new Point(0, 0), new Point(2, 0))
8 | const long = LineSegment.mkPP(new Point(0, 0), new Point(6, 0))
9 | const bh = new BinaryHeapWithComparer((a, b) => a.length - b.length)
10 | bh.Enqueue(long)
11 | bh.Enqueue(long)
12 | bh.Enqueue(short)
13 | bh.Enqueue(short)
14 | bh.Enqueue(medium)
15 | bh.Enqueue(medium) // ssmmll
16 | expect(bh.Dequeue()).toBe(short)
17 | bh.Enqueue(long) //smmlll
18 | expect(bh.Dequeue()).toBe(short)
19 | expect(bh.Dequeue()).toBe(medium)
20 | expect(bh.Dequeue()).toBe(medium)
21 | expect(bh.Dequeue()).toBe(long)
22 | expect(bh.Dequeue()).toBe(long)
23 | expect(bh.Dequeue()).toBe(long)
24 | })
25 |
--------------------------------------------------------------------------------
/modules/core/test/structs/BinaryHeapWithComparer.ts:
--------------------------------------------------------------------------------
1 | import {Point} from '../../src'
2 | import {LineSegment} from '../../src/math/geometry'
3 | import {BinaryHeapWithComparer} from '../../src/structs/BinaryHeapWithComparer'
4 |
5 | test('lines', () => {
6 | const short = LineSegment.mkPP(new Point(0, 0), new Point(1, 0))
7 | const medium = LineSegment.mkPP(new Point(0, 0), new Point(2, 0))
8 | const long = LineSegment.mkPP(new Point(0, 0), new Point(6, 0))
9 | const bh = new BinaryHeapWithComparer((a, b) => a.length - b.length)
10 | bh.Enqueue(long)
11 | bh.Enqueue(short)
12 | bh.Enqueue(medium)
13 | let t = bh.Dequeue()
14 | expect(t).toBe(short)
15 | t = bh.Dequeue()
16 | expect(t).toBe(medium)
17 | t = bh.Dequeue()
18 | expect(t).toBe(long)
19 | })
20 |
--------------------------------------------------------------------------------
/modules/core/test/structs/basicGraph.spec.ts:
--------------------------------------------------------------------------------
1 | import {BasicGraph} from '../../src/structs/BasicGraph'
2 | import {IEdge} from '../../src/structs/iedge'
3 |
4 | class myedge implements IEdge {
5 | source: number
6 | target: number
7 | constructor(a: number, b: number) {
8 | this.source = a
9 | this.target = b
10 | }
11 | }
12 | test('bgoe', () => {
13 | const edges = [new myedge(0, 1), new myedge(1, 2), new myedge(2, 0), new myedge(2, 2), new myedge(2, 3)]
14 | const bg = new BasicGraph(edges, 4)
15 | expect(bg.nodeCount).toBe(4)
16 | bg.removeEdge(edges[4])
17 | expect(bg.inEdgesCount(3)).toBe(0)
18 | expect(bg.outEdgesCount(2)).toBe(1)
19 | expect(bg.selfEdgesCount(2)).toBe(1)
20 | let i = 0
21 | for (const n of bg.nodesOfConnectedGraph()) {
22 | i++
23 | }
24 | expect(i).toBe(3)
25 | bg.addEdge(new myedge(0, 2))
26 | expect(bg.outEdgesCount(0)).toBe(2)
27 | })
28 |
--------------------------------------------------------------------------------
/modules/core/test/structs/basicGraphOnEdges.spec.ts:
--------------------------------------------------------------------------------
1 | import {mkGraphOnEdgesArray} from '../../src/structs/basicGraphOnEdges'
2 | import {IEdge} from '../../src/structs/iedge'
3 |
4 | class myedge implements IEdge {
5 | source: number
6 | target: number
7 | constructor(a: number, b: number) {
8 | this.source = a
9 | this.target = b
10 | }
11 | }
12 | test('bgoe', () => {
13 | const edges = [new myedge(0, 1), new myedge(1, 2), new myedge(2, 0), new myedge(2, 2), new myedge(2, 3)]
14 | const bg = mkGraphOnEdgesArray(edges)
15 | expect(bg.nodeCount).toBe(4)
16 | bg.removeEdge(edges[4])
17 | expect(bg.inEdgesCount(3)).toBe(0)
18 | expect(bg.outEdgesCount(2)).toBe(1)
19 | expect(bg.selfEdgesCount(2)).toBe(1)
20 | let i = 0
21 | for (const n of bg.nodesOfConnectedGraph()) {
22 | i++
23 | }
24 | expect(i).toBe(3)
25 | bg.addEdge(new myedge(0, 2))
26 | expect(bg.outEdgesCount(0)).toBe(2)
27 | })
28 |
--------------------------------------------------------------------------------
/modules/core/test/structs/entity.spec.ts:
--------------------------------------------------------------------------------
1 | import {Graph} from '../../src/structs/graph'
2 | import {Node} from '../../src/structs/node'
3 |
4 | test('entity graphs', () => {
5 | const c = new Graph('c')
6 | const b = new Graph('b')
7 | const a = new Graph('a')
8 | c.addNode(b)
9 | b.addNode(a)
10 | const bc = Array.from(a.getAncestors())
11 | expect(bc.length).toBe(2)
12 | expect(a.isDescendantOf(b) && a.isDescendantOf(c)).toBe(true)
13 | const e = new Graph('e')
14 | expect(e.isDescendantOf(b)).toBe(false)
15 | })
16 |
17 | test('test attrs', () => {
18 | const a = new Node('a')
19 | a.setAttr(2, '2')
20 | expect(a.getAttr(0)).toBe(undefined)
21 | expect(a.getAttr(2)).toBe('2')
22 | })
23 |
--------------------------------------------------------------------------------
/modules/core/test/utils/IntPairSet.spec.ts:
--------------------------------------------------------------------------------
1 | import {IntPairSet} from '../../src/utils/IntPairSet'
2 | import {randomInt} from '../../src/utils/random'
3 |
4 | test('IntPairSet', () => {
5 | const m = new IntPairSet()
6 | m.addNN(0, 0)
7 | m.addNN(1, 1)
8 | m.addNN(2, 2)
9 | m.addNN(2, 1)
10 |
11 | const p = Array.from(m.values())
12 | expect(p.length).toBe(4)
13 | expect(p[0].y < 3).toBe(true)
14 | })
15 |
16 | test('IntPairSet perf', () => {
17 | const n = 10000
18 | const m = new IntPairSet()
19 | for (let i = 0; i < n; i++) {
20 | const j = randomInt(10)
21 | /*Assert.assert(j >= 0 && j < 10)*/
22 | for (let k = 0; k < j; k++) m.addNN(i, k)
23 | }
24 | })
25 |
--------------------------------------------------------------------------------
/modules/core/test/utils/PointMap.spec.ts:
--------------------------------------------------------------------------------
1 | import {PointMap} from '../../src/utils/PointMap'
2 |
3 | test('PointMap', () => {
4 | const m = new PointMap()
5 | m.setxy(0, 0, 0)
6 | m.setxy(1.3, 1, 2)
7 | m.setxy(2, 2, 4)
8 | m.setxy(2, 1.2, 3)
9 |
10 | const p = Array.from(m.keys())
11 | expect(p.length).toBe(4)
12 | expect(p[0].y < 3).toBe(true)
13 | const kv = Array.from(m)
14 | expect(kv[0][1] < 5).toBe(true)
15 | expect(kv.length === 4).toBe(true)
16 |
17 | m.delete(1.3, 1)
18 | expect(m.hasxy(1.3, 1)).toBe(false)
19 | expect(m.hasxy(2, 1.2)).toBe(true)
20 | })
21 |
--------------------------------------------------------------------------------
/modules/core/test/utils/utils.spec.ts:
--------------------------------------------------------------------------------
1 | import {removeFromArray} from '../../src/utils/setOperations'
2 |
3 | test('remove from array', () => {
4 | const arr = ['a', 'b', 'c']
5 | const t = 'b'
6 | removeFromArray(arr, t)
7 | expect(arr.length).toBe(2)
8 | })
9 |
--------------------------------------------------------------------------------
/modules/core/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.prod.json",
3 | "compilerOptions": {
4 | "outDir": "./dist",
5 | "rootDir": "./src",
6 | "composite": true
7 | },
8 | "include": ["src/**/*"]
9 | }
10 |
--------------------------------------------------------------------------------
/modules/drawing/bundle.ts:
--------------------------------------------------------------------------------
1 | import * as drawing from './src'
2 |
3 | // @ts-ignore
4 | globalThis.msagl = globalThis.msagl || {}
5 |
6 | Object.assign(globalThis.msagl, drawing)
7 |
--------------------------------------------------------------------------------
/modules/drawing/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@msagl/drawing",
3 | "version": "1.1.23",
4 | "description": "Drawing attributes for MSAGL",
5 | "main": "dist/index.js",
6 | "types": "dist/index.d.ts",
7 | "type": "module",
8 | "files": [
9 | "dist",
10 | "dist.min.js",
11 | "src"
12 | ],
13 | "publishConfig": {
14 | "access": "public"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/microsoft/msagljs"
19 | },
20 | "license": "MIT",
21 | "scripts": {
22 | "build": "tsc --build tsconfig.prod.json && npm run build-bundle",
23 | "build-bundle": "node ../../esbuild.js bundle.ts dist.min.js"
24 | },
25 | "dependencies": {
26 | "@msagl/core": "^1.1.23"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/modules/drawing/src/arrowTypeEnum.ts:
--------------------------------------------------------------------------------
1 | export enum ArrowTypeEnum {
2 | normal,
3 | inv,
4 | dot,
5 | invdot,
6 | odot,
7 | invodot,
8 | none,
9 | tee,
10 | empty,
11 | invempty,
12 | diamond,
13 | odiamond,
14 | ediamond,
15 | crow,
16 | box,
17 | obox,
18 | open,
19 | halfopen,
20 | vee,
21 | }
22 |
--------------------------------------------------------------------------------
/modules/drawing/src/dirTypeEnum.ts:
--------------------------------------------------------------------------------
1 | export enum DirTypeEnum {
2 | forward,
3 | back,
4 |
5 | both,
6 |
7 | none,
8 | }
9 |
--------------------------------------------------------------------------------
/modules/drawing/src/drawingEdge.ts:
--------------------------------------------------------------------------------
1 | import {Entity} from '@msagl/core'
2 | import {ArrowTypeEnum} from './arrowTypeEnum'
3 | import {DrawingObject} from './drawingObject'
4 |
5 | export class DrawingEdge extends DrawingObject {
6 | directed = true
7 | constructor(entity: Entity, directed: boolean) {
8 | super(entity)
9 | this.directed = directed
10 | if (directed) {
11 | this.arrowhead = ArrowTypeEnum.normal
12 | } else {
13 | this.arrowhead = ArrowTypeEnum.none
14 | }
15 |
16 | this.arrowtail = ArrowTypeEnum.none
17 | }
18 | clone(): DrawingEdge {
19 | const ret = new DrawingEdge(null, this.directed)
20 | DrawingObject.copyValidFields(this, ret)
21 | ret.directed = this.directed
22 | ret.arrowtail = this.arrowtail
23 | ret.arrowhead = this.arrowhead
24 | return ret
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/iViewerEdge.ts:
--------------------------------------------------------------------------------
1 | import {IViewerObject} from './iViewerObject'
2 | import {IViewerNode} from './iViewerNode'
3 | import {Edge} from '@msagl/core'
4 |
5 | export interface IViewerEdge extends IViewerObject {
6 | selectedForEditing: boolean
7 | edge: Edge
8 | IsCollapsedChanged: (node: IViewerNode) => void
9 | radiusOfPolylineCorner: number
10 | }
11 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/iViewerGraph.ts:
--------------------------------------------------------------------------------
1 | import {Graph} from '@msagl/core'
2 | import {IViewerObject} from './iViewerObject'
3 |
4 | export interface IViewerGraph extends IViewerObject {
5 | graph: Graph
6 | }
7 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/iViewerNode.ts:
--------------------------------------------------------------------------------
1 | import {EventHandler, Node} from '@msagl/core'
2 | import {IViewerObject} from './iViewerObject'
3 | export interface IViewerNode extends IViewerObject {
4 | node: Node
5 | IsCollapsedChanged: EventHandler // TODO:should it be in IViewerGraph
6 | }
7 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/iViewerObject.ts:
--------------------------------------------------------------------------------
1 | import {Entity} from '@msagl/core'
2 | import {DrawingObject} from '..'
3 |
4 | export interface IViewerObject {
5 | /** the corresponding Entity*/
6 | entity: Entity
7 |
8 | isVisible: boolean
9 |
10 | /** is set to true when the object is selected for editing */
11 | markedForDragging: boolean
12 |
13 | /** called when the entity is unmarked for dragging*/
14 | unmarkedForDraggingCallback: () => void
15 | }
16 | export function getViewerDrawingObject(ivo: IViewerObject): DrawingObject {
17 | return DrawingObject.getDrawingObj(ivo.entity)
18 | }
19 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/labelFixture.ts:
--------------------------------------------------------------------------------
1 | /** to put a label go to RelativeLengthOnCurve position, take normal accordingly to the RightSide and follow NormalLength this direction */
2 | export class LabelFixture {
3 | RelativeLengthOnCurve: number
4 |
5 | RightSide: boolean
6 |
7 | NormalLength: number
8 | constructor(relativeLengthOnCurve: number, rightSide: boolean, normalLength: number) {
9 | this.RelativeLengthOnCurve = relativeLengthOnCurve
10 | this.RightSide = rightSide
11 | this.NormalLength = normalLength
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/modifierKeys.ts:
--------------------------------------------------------------------------------
1 | export enum ModifierKeysEnum {
2 | // No modifiers are pressed.
3 |
4 | None = 0,
5 |
6 | // THE alt key
7 |
8 | Alt = 1,
9 |
10 | // the control key
11 |
12 | Control = 2,
13 |
14 | // the shift key
15 |
16 | Shift = 4,
17 |
18 | // the window logo key
19 |
20 | Windows = 8,
21 | }
22 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/objectUnderMouseCursorChangedEventArgs.ts:
--------------------------------------------------------------------------------
1 | import {IViewerObject} from './iViewerObject'
2 | export class EventArgs {}
3 |
4 | export class ObjectUnderMouseCursorChangedEventArgs extends EventArgs {
5 | oldObject: IViewerObject
6 |
7 | // The old object under the mouse
8 |
9 | public get OldObject(): IViewerObject {
10 | return this.oldObject
11 | }
12 | public set OldObject(value: IViewerObject) {
13 | this.oldObject = value
14 | }
15 |
16 | newObject: IViewerObject
17 |
18 | // the new object under the mouse
19 |
20 | public get NewObject(): IViewerObject {
21 | return this.newObject
22 | }
23 | public set NewObject(value: IViewerObject) {
24 | this.newObject = value
25 | }
26 |
27 | // constructor
28 |
29 | public constructor(oldObject: IViewerObject, newObject: IViewerObject) {
30 | super()
31 | this.OldObject = oldObject
32 | this.NewObject = newObject
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/modules/drawing/src/layoutEditing/polylineCornerType.ts:
--------------------------------------------------------------------------------
1 | export enum PolylineCornerType {
2 | // a corner to insert
3 |
4 | PreviousCornerForInsertion,
5 |
6 | // a corner to delete
7 |
8 | CornerToDelete,
9 | }
10 |
--------------------------------------------------------------------------------
/modules/drawing/src/orderingEnum.ts:
--------------------------------------------------------------------------------
1 | export enum OrderingEnum {
2 | in,
3 | out,
4 | }
5 |
--------------------------------------------------------------------------------
/modules/drawing/src/rankEnum.ts:
--------------------------------------------------------------------------------
1 | export enum RankEnum {
2 | same,
3 | min,
4 | source,
5 | max,
6 | sink,
7 | }
8 |
--------------------------------------------------------------------------------
/modules/drawing/src/shapeEnum.ts:
--------------------------------------------------------------------------------
1 | export enum ShapeEnum {
2 | diamond,
3 |
4 | ellipse,
5 |
6 | box,
7 |
8 | circle,
9 |
10 | record,
11 |
12 | plaintext,
13 |
14 | point,
15 |
16 | mdiamond,
17 |
18 | msquare,
19 |
20 | polygon,
21 |
22 | doublecircle,
23 |
24 | house,
25 |
26 | invhouse,
27 |
28 | parallelogram,
29 |
30 | octagon,
31 |
32 | tripleoctagon,
33 |
34 | triangle,
35 |
36 | trapezium,
37 |
38 | drawFromGeometry,
39 |
40 | hexagon,
41 | }
42 |
--------------------------------------------------------------------------------
/modules/drawing/src/styleEnum.ts:
--------------------------------------------------------------------------------
1 | export enum StyleEnum {
2 | //The default style - solid.
3 | none,
4 | dashed,
5 | solid,
6 | invis,
7 | bold,
8 | filled,
9 | diagonals,
10 | dotted,
11 | rounded,
12 | }
13 |
--------------------------------------------------------------------------------
/modules/drawing/src/textMeasurerOptions.ts:
--------------------------------------------------------------------------------
1 | export type TextMeasurerOptions = {
2 | fontFamily: string
3 | fontSize: number
4 | lineHeight: number
5 | fontStyle: 'normal' | 'italic' | 'oblique'
6 | fontWeight: 'normal' | 'bold' | 'lighter' | 'bolder' | number
7 | }
8 |
--------------------------------------------------------------------------------
/modules/drawing/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.prod.json",
3 | "compilerOptions": {
4 | "outDir": "./dist",
5 | "rootDir": "./src",
6 | "composite": true
7 | },
8 | "references": [
9 | {
10 | "path": "../core/tsconfig.prod.json"
11 | }
12 | ],
13 | "include": ["src/**/*"]
14 | }
15 |
--------------------------------------------------------------------------------
/modules/parser/bundle.ts:
--------------------------------------------------------------------------------
1 | import * as parser from './src'
2 |
3 | // @ts-ignore
4 | globalThis.msagl = globalThis.msagl || {}
5 |
6 | Object.assign(globalThis.msagl, parser)
7 |
--------------------------------------------------------------------------------
/modules/parser/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@msagl/parser",
3 | "version": "1.1.23",
4 | "description": "Graph parser for MSAGL in JavaScript",
5 | "main": "dist/index.js",
6 | "types": "dist/index.d.ts",
7 | "type": "module",
8 | "files": [
9 | "dist",
10 | "dist.min.js",
11 | "src"
12 | ],
13 | "publishConfig": {
14 | "access": "public"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/microsoft/msagljs"
19 | },
20 | "license": "MIT",
21 | "scripts": {
22 | "build": "tsc --build tsconfig.prod.json && npm run build-bundle",
23 | "build-bundle": "node ../../esbuild.js bundle.ts dist.min.js"
24 | },
25 | "dependencies": {
26 | "@msagl/core": "^1.1.23",
27 | "@msagl/drawing": "^1.1.23",
28 | "@types/parse-color": "^1.0.1",
29 | "dotparser": "^1.1.1",
30 | "parse-color": "^1.0.0"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/modules/parser/src/index.ts:
--------------------------------------------------------------------------------
1 | export {parseDot, graphToJSON, parseTXT, parseJSON} from './dotparser'
2 | import {loadGraphFromFile, loadGraphFromUrl} from './dotparser'
3 | export {loadGraphFromFile, loadGraphFromUrl}
4 |
--------------------------------------------------------------------------------
/modules/parser/src/utils.ts:
--------------------------------------------------------------------------------
1 | import parseCSSColor from 'parse-color'
2 | import {Color} from '@msagl/drawing'
3 |
4 | export function parseColor(s: string): Color {
5 | const p = parseCSSColor(s)
6 | if (p.keyword != null) {
7 | return Color.parse(p.keyword.toString())
8 | }
9 | if (p != null) {
10 | if (p.rgba != null) {
11 | return new Color(p.rgba[3], p.rgba[0], p.rgba[1], p.rgba[2])
12 | }
13 | if (p.rgb != null) {
14 | return Color.mkRGB(p.rgb[0], p.rgb[1], p.rgb[2])
15 | }
16 | }
17 | return Color.Black
18 | }
19 |
--------------------------------------------------------------------------------
/modules/parser/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.prod.json",
3 | "compilerOptions": {
4 | "outDir": "./dist",
5 | "rootDir": "./src"
6 | },
7 | "references": [
8 | {
9 | "path": "../core/tsconfig.prod.json"
10 | }
11 | ],
12 | "include": ["src/**/*"]
13 | }
--------------------------------------------------------------------------------
/modules/renderer-common/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@msagl/renderer-common",
3 | "version": "1.1.25",
4 | "description": "common utils for MSAGL renderers",
5 | "main": "dist/index.js",
6 | "types": "dist/index.d.ts",
7 | "type": "module",
8 | "files": [
9 | "dist",
10 | "dist.min.js",
11 | "src"
12 | ],
13 | "publishConfig": {
14 | "access": "public"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/microsoft/msagljs"
19 | },
20 | "license": "MIT",
21 | "scripts": {
22 | "build": "tsc --build tsconfig.prod.json"
23 | },
24 | "dependencies": {
25 | "@msagl/core": "^1.1.23",
26 | "@msagl/drawing": "^1.1.23",
27 | "@msagl/parser": "^1.1.23"
28 | },
29 | "gitHead": "07dc5720f142d48f0d8f1dd08a49723ae150d6f7"
30 | }
31 |
--------------------------------------------------------------------------------
/modules/renderer-common/src/index.ts:
--------------------------------------------------------------------------------
1 | import {EdgeRoutingMode} from '@msagl/core'
2 | import {TextMeasurerOptions} from '@msagl/drawing'
3 |
4 | export {layoutGraph, layoutGraphOnWorker} from './layout'
5 | export {default as TextMeasurer} from './text-measurer'
6 | export {deepEqual, getLabelPosition} from './utils'
7 | export {default as initLayoutWorker} from './workers/layoutWorker'
8 |
9 | export type LayoutOptions = {
10 | layoutType?: 'Sugiyama LR' | 'Sugiyama TB' | 'Sugiyama BT' | 'Sugiyama RL' | 'IPsepCola' | 'MDS'
11 | label?: Partial
12 | edgeRoutingMode?: EdgeRoutingMode
13 | }
14 |
--------------------------------------------------------------------------------
/modules/renderer-common/src/workers/layoutWorker.ts:
--------------------------------------------------------------------------------
1 | import {parseJSON, graphToJSON} from '@msagl/parser'
2 | import {DrawingGraph} from '@msagl/drawing'
3 | import {layoutGraph} from '../layout'
4 |
5 | export default function initLayoutWorker() {
6 | globalThis.onmessage = ({data}) => {
7 | switch (data.type) {
8 | case 'layout': {
9 | const graph = parseJSON(data.graph)
10 |
11 | console.debug('graph transfer to worker', Date.now() - data.timestamp + ' ms')
12 | //geometry has to be created before layout, and transfered to worker
13 | layoutGraph(graph, data.options, data.forceUpdate)
14 | console.debug('layout done', Date.now() - data.timestamp + ' ms')
15 | postMessage({
16 | type: 'layout-done',
17 | timestamp: Date.now(),
18 | graph: graphToJSON(graph),
19 | })
20 | }
21 | }
22 | }
23 |
24 | globalThis.onerror = (e) => {
25 | postMessage({
26 | type: 'Error',
27 | message: e.toString(),
28 | })
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/modules/renderer-common/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.prod.json",
3 | "compilerOptions": {
4 | "lib": ["dom", "es2018"],
5 | "outDir": "./dist",
6 | "rootDir": "./src",
7 | "composite": true
8 | },
9 | "references": [
10 | {
11 | "path": "../core/tsconfig.prod.json"
12 | }
13 | ],
14 | "include": ["src/**/*"]
15 | }
16 |
--------------------------------------------------------------------------------
/modules/renderer-svg/bundle.ts:
--------------------------------------------------------------------------------
1 | import * as renderer from './src'
2 |
3 | // @ts-ignore
4 | globalThis.msagl = globalThis.msagl || {}
5 |
6 | Object.assign(globalThis.msagl, renderer)
7 |
--------------------------------------------------------------------------------
/modules/renderer-svg/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@msagl/renderer-svg",
3 | "version": "1.1.25",
4 | "description": "Svg renderer for MSAGL in JavaScript",
5 | "main": "dist/index.js",
6 | "types": "dist/index.d.ts",
7 | "type": "module",
8 | "files": [
9 | "dist",
10 | "dist.min.js",
11 | "src"
12 | ],
13 | "publishConfig": {
14 | "access": "public"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/microsoft/msagljs"
19 | },
20 | "license": "MIT",
21 | "scripts": {
22 | "build": "tsc --build tsconfig.prod.json && npm run build-bundle && npm run build-worker",
23 | "build-bundle": "node ../../esbuild.js bundle.ts dist.min.js",
24 | "build-worker": "esbuild ./worker.js --outfile=dist/worker.min.js --bundle --minify"
25 | },
26 | "dependencies": {
27 | "@msagl/core": "^1.1.23",
28 | "@msagl/parser": "^1.1.23",
29 | "@msagl/renderer-common": "^1.1.25",
30 | "panzoom": "^9.4.2"
31 | },
32 | "gitHead": "07dc5720f142d48f0d8f1dd08a49723ae150d6f7"
33 | }
34 |
--------------------------------------------------------------------------------
/modules/renderer-svg/src/index.ts:
--------------------------------------------------------------------------------
1 | export {RendererSvg} from './rendererSvg'
2 |
--------------------------------------------------------------------------------
/modules/renderer-svg/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.prod.json",
3 | "compilerOptions": {
4 | "lib": ["dom", "es2018"],
5 | "outDir": "./dist",
6 | "rootDir": "./src"
7 | },
8 | "references": [
9 | {
10 | "path": "../core/tsconfig.prod.json"
11 | },
12 | {
13 | "path": "../renderer-common/tsconfig.prod.json"
14 | }
15 | ],
16 | "include": ["src/**/*"]
17 | }
18 |
--------------------------------------------------------------------------------
/modules/renderer-svg/worker.ts:
--------------------------------------------------------------------------------
1 | import {initLayoutWorker} from '@msagl/renderer-common'
2 | initLayoutWorker()
3 |
--------------------------------------------------------------------------------
/modules/renderer-webgl/bundle.ts:
--------------------------------------------------------------------------------
1 | import * as renderer from './src'
2 |
3 | // @ts-ignore
4 | globalThis.msagl = globalThis.msagl || {}
5 |
6 | Object.assign(globalThis.msagl, renderer)
7 |
--------------------------------------------------------------------------------
/modules/renderer-webgl/src/index.ts:
--------------------------------------------------------------------------------
1 | import {initLayoutWorker} from '@msagl/renderer-common'
2 |
3 | export {default as Renderer, IRendererControl} from './renderer'
4 |
5 | export {default as SearchControl} from './controls/search-control'
6 | export {initLayoutWorker}
7 |
8 | export {GraphStyleSpecification} from './styles/graph-style-spec'
9 |
--------------------------------------------------------------------------------
/modules/renderer-webgl/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.prod.json",
3 | "compilerOptions": {
4 | "lib": ["dom", "es2018"],
5 | "outDir": "./dist",
6 | "rootDir": "./src",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {
11 | "path": "../core/tsconfig.prod.json"
12 | },
13 | {
14 | "path": "../renderer-common/tsconfig.prod.json"
15 | }
16 | ],
17 | "include": ["src/**/*"]
18 | }
19 |
--------------------------------------------------------------------------------
/modules/renderer-webgl/worker.ts:
--------------------------------------------------------------------------------
1 | import {initLayoutWorker} from '@msagl/renderer-common'
2 | initLayoutWorker()
3 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2018",
4 | "moduleResolution": "node",
5 | "allowJs": true,
6 | "noImplicitAny": true,
7 | "lib": ["dom", "es2018"],
8 | "importHelpers": true,
9 | "noEmit": true,
10 | "esModuleInterop": true,
11 | "paths": {
12 | "@msagl/core": ["./modules/core/src"],
13 | "@msagl/drawing": ["./modules/drawing/src"],
14 | "@msagl/parser": ["./modules/parser/src"],
15 | "@msagl/renderer-common": ["./modules/renderer-common/src"],
16 | "@msagl/renderer-svg": ["./modules/renderer-svg/src"],
17 | "@msagl/renderer-webgl": ["./modules/renderer-webgl/src"]
18 | }
19 | },
20 | "include": [
21 | "./modules/**/src/**/*",
22 | "./modules/**/test/**/*",
23 | "modules/renderer-common/src/text-measurer.ts",
24 | "modules/renderer-common/src/utils.ts"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2018",
4 | "moduleResolution": "node",
5 | "noEmit": false,
6 | "declaration": true,
7 | "sourceMap": true,
8 | "lib": ["dom", "es2018"],
9 | "importHelpers": true,
10 | "esModuleInterop": true,
11 | "strictNullChecks": false
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/website/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependencies
2 | /node_modules
3 |
4 | # Production
5 | /build
6 |
7 | # Generated files
8 | .docusaurus
9 | .cache-loader
10 |
11 | # Misc
12 | .DS_Store
13 | .env.local
14 | .env.development.local
15 | .env.test.local
16 | .env.production.local
17 |
18 | npm-debug.log*
19 | yarn-debug.log*
20 | yarn-error.log*
21 |
--------------------------------------------------------------------------------
/website/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "semi": false,
4 | "useTabs": false,
5 | "bracketSpacing": true,
6 | "printWidth": 80,
7 | "trailingComma": "all"
8 | }
9 |
--------------------------------------------------------------------------------
/website/README.md:
--------------------------------------------------------------------------------
1 | # Website
2 |
3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4 |
5 | ### Installation
6 |
7 | ```
8 | $ yarn
9 | ```
10 |
11 | ### Local Development
12 |
13 | ```
14 | $ yarn start
15 | ```
16 |
17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18 |
19 | ### Build
20 |
21 | ```
22 | $ yarn build
23 | ```
24 |
25 | This command generates static content into the `build` directory and can be served using any static contents hosting service.
26 |
27 | ### Deployment
28 |
29 | Using SSH:
30 |
31 | ```
32 | $ USE_SSH=true yarn deploy
33 | ```
34 |
35 | Not using SSH:
36 |
37 | ```
38 | $ GIT_USER= yarn deploy
39 | ```
40 |
41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
42 |
--------------------------------------------------------------------------------
/website/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3 | };
4 |
--------------------------------------------------------------------------------
/website/docs/intro.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 1
3 | ---
4 |
5 | # Introduction
6 |
7 | [MSAGL-JS](https://github.com/microsoft/msagljs) is a JavaScript implementation of several graph layout algorithms together with two graph viewers and an editor component. In most parts it is a port of .NET layout engine [MSAGL](https://github.com/microsoft/automatic-graph-layout). MSAGL-JS is currently under development and it comprises the following modules:
8 |
9 | - `@msagl/core`: the core graph data structures and the layout engines
10 | - `@msagl/drawing`: device independent graphic support
11 | - `@msagl/parser`: convert common formats to MSAGL Graph instances
12 | - `@msagl/renderer-webgl`: a WebGL-powered rendering component
13 | - `@msagl/renderer-svg`: an SVG-powered rendering component
14 |
15 | To browse a large graph please use [Web-GL renderer example](https://microsoft.github.io/msagljs/renderer-webgl/index.html),
16 | and to browse and to edit a smaller graph use [SVG-renderer example](https://microsoft.github.io/msagljs/renderer-svg/index.html)
17 |
--------------------------------------------------------------------------------
/website/sidebars.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Creating a sidebar enables you to:
3 | - create an ordered group of docs
4 | - render a sidebar for each doc of that group
5 | - provide next/previous navigation
6 |
7 | The sidebars can be generated from the filesystem, or explicitly defined here.
8 |
9 | Create as many sidebars as you want.
10 | */
11 |
12 | // @ts-check
13 |
14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
15 | const sidebars = {
16 | // By default, Docusaurus generates a sidebar from the docs folder structure
17 | tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
18 |
19 | // But you can create a sidebar manually
20 | /*
21 | tutorialSidebar: [
22 | 'intro',
23 | 'hello',
24 | {
25 | type: 'category',
26 | label: 'Tutorial',
27 | items: ['tutorial-basics/create-a-document'],
28 | },
29 | ],
30 | */
31 | };
32 |
33 | module.exports = sidebars;
34 |
--------------------------------------------------------------------------------
/website/src/components/HomepageFeatures/styles.module.css:
--------------------------------------------------------------------------------
1 | .features {
2 | display: flex;
3 | align-items: center;
4 | padding: 2rem 0;
5 | width: 100%;
6 | }
7 |
8 | .featureSvg {
9 | height: 200px;
10 | width: 200px;
11 | }
12 |
--------------------------------------------------------------------------------
/website/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS files with the .module.css suffix will be treated as CSS modules
3 | * and scoped locally.
4 | */
5 |
6 | .heroBanner {
7 | padding: 4rem 0;
8 | text-align: center;
9 | position: relative;
10 | overflow: hidden;
11 | }
12 |
13 | @media screen and (max-width: 996px) {
14 | .heroBanner {
15 | padding: 2rem;
16 | }
17 | }
18 |
19 | .buttons {
20 | display: flex;
21 | align-items: center;
22 | justify-content: center;
23 | }
24 |
--------------------------------------------------------------------------------
/website/static/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/msagljs/44c36504516b7502465a69d53e723eb3629a58a1/website/static/.nojekyll
--------------------------------------------------------------------------------
/website/static/editors/msagl.html:
--------------------------------------------------------------------------------
1 | html>
2 |
3 |
4 |
5 |
6 |
7 |
25 |
26 |