repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
msaglJS/msagl-js
src/math/geometry/RTree/RTree.ts
import {from, IEnumerable} from 'linq-to-typescript' // import {Assert} from '../../../utils/assert' import {IRectangle} from '../IRectangle' import { RectangleNode, mkRectangleNode, CreateRectangleNodeOnEnumeration, CreateRectangleNodeOnListOfNodes, } from './RectangleNode' // A search tree for rapid lookup ...
msaglJS/msagl-js
src/routing/TightLooseCouple.ts
/* import {Polyline} from '../math/geometry/polyline' import {Shape} from './Shape' // an utility class to keep different polylines created around a shape export class TightLooseCouple { TightPolyline: Polyline LooseShape: Shape public constructor( tightPolyline: Polyline, looseShape: Shape, dista...
msaglJS/msagl-js
src/math/geometry/closestPointOnCurve.ts
<filename>src/math/geometry/closestPointOnCurve.ts import {Point} from './point' import {ICurve} from './icurve' import {GeomConstants} from './geomConstants' export class ClosestPointOnCurve { // eslint-disable-next-line @typescript-eslint/no-unused-vars static closestPoint( curve: ICurve, a: Point, hi...
msaglJS/msagl-js
src/layout/layered/RefinerBetweenTwoLayers.ts
import {from, IEnumerable} from 'linq-to-typescript' import {CornerSite} from '../../math/geometry/cornerSite' import {CurveFactory} from '../../math/geometry/curveFactory' import {DebugCurve} from '../../math/geometry/debugCurve' import {GeomConstants} from '../../math/geometry/geomConstants' import {Point} from '../....
msaglJS/msagl-js
src/routing/rectilinear/nudging/AxisEdgesContainer.ts
import {Point} from '../../../math/geometry/point' // import {Assert} from '../../../utils/assert' import {AxisEdge} from './AxisEdge' export class AxisEdgesContainer { edges: Set<AxisEdge> = new Set<AxisEdge>() get Edges(): Iterable<AxisEdge> { return this.edges } /// it is not necessarely the upper po...
msaglJS/msagl-js
test/layout/mds/SingleSourceDistances.spec.ts
<filename>test/layout/mds/SingleSourceDistances.spec.ts import { CurveFactory, Edge, GeomEdge, GeomNode, Graph, Node, Point, } from '../../../src' import {GeomObject} from '../../../src/layout/core/geomObject' import {SingleSourceDistances} from '../../../src/layout/mds/SingleSourceDistances' import {clos...
msaglJS/msagl-js
src/routing/spline/bundling/CostCalculator.ts
// using System.Collections.Generic; // using System.Linq; // using System.Diagnostics; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Routing; // using Microsoft.Msagl.Routing.Visibility; // using Micros...
msaglJS/msagl-js
src/math/geometry/debugCurve.ts
<filename>src/math/geometry/debugCurve.ts<gh_stars>10-100 import {ICurve} from './icurve' export class DebugCurve { pen: number color: string fillColor: string transparency: number width: number icurve: ICurve dashArray: number[] label: any drawPN: boolean static mkDebugCurveTWCILD( transparenc...
msaglJS/msagl-js
drawing/drawingNode.ts
import {DrawingObject} from './drawingObject' import {Color} from './color' import {ShapeEnum} from './shapeEnum' import {DrawingLabel} from './drawingLabel' import {Node} from '../src/structs/node' export class DrawingNode extends DrawingObject { label: DrawingLabel padding = 2 get Padding(): number { return...
msaglJS/msagl-js
src/index.ts
<reponame>msaglJS/msagl-js<gh_stars>10-100 export {GeomGraph, GeomLabel, GeomNode, GeomEdge} from './layout/core' export {SugiyamaLayoutSettings} from './layout/layered/SugiyamaLayoutSettings' export {LayeredLayout} from './layout/layered/layeredLayout' export {CancelToken} from './utils/cancelToken' export { CurveFa...
msaglJS/msagl-js
src/routing/spline/bundling/SdShortestPath.ts
<gh_stars>10-100 // using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; // using Microsoft.Msagl.C...
msaglJS/msagl-js
src/layout/mds/MDSGraphLayout.ts
<filename>src/layout/mds/MDSGraphLayout.ts<gh_stars>10-100 import {Point} from '../../math/geometry/point' import {Rectangle} from '../../math/geometry/rectangle' import {GeomGraph} from '../core/GeomGraph' import {AllPairsDistances} from './AllPairsDistances' import {MdsLayoutSettings} from './MDSLayoutSettings' impor...
msaglJS/msagl-js
src/layout/layered/HierarchyCalculator.ts
<filename>src/layout/layered/HierarchyCalculator.ts import {Parallelogram} from '../../math/geometry/parallelogram' import {PN} from '../../math/geometry/parallelogramNode' export class HierarchyCalculator { initialNodes: Array<PN> groupSplitThreshold = 2 static Calculate(nodes: Array<PN>, groupSplitThresholdP...
msaglJS/msagl-js
test/structs/BinaryHeapWithComparer.ts
import {Point} from '../../src' import {LineSegment} from '../../src/math/geometry' import {BinaryHeapWithComparer} from '../../src/structs/BinaryHeapWithComparer' test('lines', () => { const short = LineSegment.mkPP(new Point(0, 0), new Point(1, 0)) const medium = LineSegment.mkPP(new Point(0, 0), new Point(2, 0)...
msaglJS/msagl-js
src/routing/visibility/Tangent.ts
<filename>src/routing/visibility/Tangent.ts // using System; // using Microsoft.Msagl.Core.Geometry.Curves; // namespace Microsoft.Msagl.Routing.Visibility { // internal class Tangent { // Tangent comp; // //the complimentary tangent // [System.Diagnostics.CodeAnalysis.SuppressMessage("Mi...
msaglJS/msagl-js
examples/layout/src/layers/edge-layer.ts
<gh_stars>10-100 import {CompositeLayer, Position} from '@deck.gl/core' import {PathLayer, IconLayer, PathLayerProps} from '@deck.gl/layers' import {iconAtlas, iconMapping} from './arrows' export interface EdgeLayerProps<D> extends PathLayerProps<D> { getArrowSize?: number | ((d: D) => number) getArrowType?: strin...
msaglJS/msagl-js
src/math/projectionSolver/QPSC.ts
// An instance of Qpsc drives the gradient-projection portion of the Projection Solver. import {number} from 'yargs' // import {Assert} from '../../utils/assert' import {Parameters} from './Parameters' import {Variable} from './Variable' // Store original weight to be restored when done. With the ability to re-Solve...
msaglJS/msagl-js
src/routing/spline/bundling/IntersectionCache.ts
<reponame>msaglJS/msagl-js // using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; // using Microso...
msaglJS/msagl-js
src/structs/genericBinaryHeapPriorityQueue.ts
<gh_stars>10-100 // Generic version priority queue based on the binary heap algorithm where import {StringBuilder} from 'typescript-string-operations' import {GenericHeapElement} from './genericHeapElement' // the priority of each element is passed as a parameter. export class GenericBinaryHeapPriorityQueue<T> { ...
msaglJS/msagl-js
src/routing/spline/bundling/CdtThreader.ts
// using System.Collections.Generic; // using System.Diagnostics; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; // using Microsoft.Msagl.DebugHelpers; // using Microsoft.Msagl.Routing.ConstrainedDelaunayTriangulation; // namespace Microsoft...
msaglJS/msagl-js
test/layout/core/geomNode.spec.ts
<filename>test/layout/core/geomNode.spec.ts import {GeomNode, CurveFactory, Point, Rectangle, Node} from '../../../src' import {DebugCurve} from '../../../src/math/geometry/debugCurve' import {closeDistEps} from '../../../src/utils/compare' import {SvgDebugWriter} from '../../utils/svgDebugWriter' test('no boundary cu...
msaglJS/msagl-js
src/layout/core/geomEdge.ts
<gh_stars>10-100 import {GeomNode} from './geomNode' import {EdgeGeometry} from './edgeGeometry' import {Edge} from './../../structs/edge' import {GeomObject} from './geomObject' import {Rectangle} from './../../math/geometry/rectangle' import {ICurve} from './../../math/geometry/icurve' import {SmoothedPolyline} from ...
msaglJS/msagl-js
src/routing/ConstrainedDelaunayTriangulation/CdtTriangle.ts
<gh_stars>10-100 import {Point, TriangleOrientation} from '../../math/geometry/point' import {Rectangle} from '../../math/geometry/rectangle' // import {Assert} from '../../utils/assert' import {CdtEdge} from './CdtEdge' import {CdtSite} from './CdtSite' import {ThreeArray} from './ThreeArray' // a trianlge oriented...
msaglJS/msagl-js
src/layout/layered/layeredLayout.ts
<filename>src/layout/layered/layeredLayout.ts<gh_stars>10-100 import {RealNumberSpan} from '../../utils/RealNumberSpan' import {BasicGraph} from '../../structs/BasicGraph' import {Point, TriangleOrientation} from '../../math/geometry/point' // import {Assert} from '../../utils/assert' import {Algorithm} from '../../uti...
msaglJS/msagl-js
src/structs/entity.ts
import {from} from 'linq-to-typescript' import {Graph} from './graph' import {AttrContainer} from './attrContainer' export abstract class Entity extends AttrContainer { private _parent: Entity = null public get parent(): Entity { return this._parent } public set parent(value: Entity) { this._parent = va...
msaglJS/msagl-js
src/layout/layered/ordering/ConstrainedOrdering.ts
<reponame>msaglJS/msagl-js<gh_stars>10-100 import {IEnumerable, from} from 'linq-to-typescript' import {BasicGraph} from '../../../structs/BasicGraph' import {IntPairMap} from '../../../utils/IntPairMap' import {GeomGraph} from '../../core/GeomGraph' import {GeomNode} from '../../core/geomNode' import {Database} from '...
msaglJS/msagl-js
src/routing/MultipleSourceMultipleTargetsShortestPathOnVisibilityGraph.ts
// using System; // using System.Collections.Generic; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Routing.Visibility; // namespace Microsoft.Msagl.Routing { // internal class MultipleSourceMultipleTargetsShortestPathO...
msaglJS/msagl-js
src/utils/algorithm.ts
import {CancelToken} from './cancelToken' export abstract class Algorithm { constructor(cancelToken: CancelToken) { this.cancelToken = cancelToken } abstract run(): void cancelToken: CancelToken }
msaglJS/msagl-js
src/layout/layered/SugiyamaLayoutSettings.ts
import {VerticalConstraintsForSugiyama} from './VerticalConstraintsForSugiyama' import {HorizontalConstraintsForSugiyama} from './HorizontalConstraintsForSugiyama' import {LayerDirectionEnum} from './layerDirectionEnum' import {PlaneTransformation} from '../../math/geometry/planeTransformation' import {closeDistEps} fr...
msaglJS/msagl-js
src/routing/StraightLineEdges.ts
// Basic geomedge router for producing straight edges. import {GeomGraph} from '../layout/core/GeomGraph' import {Arrowhead} from '../layout/core/arrowhead' import {EdgeGeometry} from '../layout/core/edgeGeometry' import {GeomEdge} from '../layout/core/geomEdge' import {CornerSite} from '../math/geometry/cornerSite'...
msaglJS/msagl-js
src/routing/visibility/BimodalSequence.ts
import {UnimodalSequence} from './UnimodalSequence' // following https://dl.acm.org/doi/pdf/10.1145/7531.24036?casa_token=<PASSWORD> // 'Intersection of Convex Objects in Two and Three Dimensions' by Chazelle, and Dobkin // For our purposes, it suffices to define a bimodal function as // one for which there is an r ...
msaglJS/msagl-js
src/layout/core/relativeFloatingPort.ts
import {ICurve} from '../../math/geometry/icurve' import {Point} from '../../math/geometry/point' import {FloatingPort} from './floatingPort' export class RelativeFloatingPort extends FloatingPort { static mk( boundaryDelegate: () => ICurve, centerDelegate: () => Point, ): RelativeFloatingPort { return...
msaglJS/msagl-js
src/layout/mds/PivotDistances.ts
<reponame>msaglJS/msagl-js import {Algorithm} from '../../utils/algorithm' import {GeomEdge} from '../core/geomEdge' import {GeomGraph} from '../core/GeomGraph' import {SingleSourceDistances} from './SingleSourceDistances' // An algorithm for computing the distances between a selected set of nodes and all nodes. expo...
msaglJS/msagl-js
src/routing/spline/bundling/MetroNodeInfo.ts
<gh_stars>10-100 // using Microsoft.Msagl.Core.Geometry.Curves; // namespace Microsoft.Msagl.Routing.Spline.Bundling { // internal class MetroNodeInfo { // Metroline metroline; // Station station; // PolylinePoint polyPoint; // internal MetroNodeInfo(Metroline metroline, Station s...
msaglJS/msagl-js
src/routing/rectilinear/nudging/LongestNudgedSegment.ts
import {from} from 'linq-to-typescript' import {Point} from '../../../math/geometry/point' import {CompassVector} from '../../../math/geometry/compassVector' import {Direction} from '../../../math/geometry/direction' import {SegmentBase} from '../../visibility/SegmentBase' import {PathEdge} from './PathEdge' /// Repr...
msaglJS/msagl-js
src/structs/nodeCollection.ts
import {Node} from './node' import {Edge} from './edge' import {Graph} from './graph' // import {Assert} from '../utils/assert' export class NodeCollection { private *nodes_(): IterableIterator<Node> { for (const p of this.nodeMap.values()) yield p } private *graphs_(): IterableIterator<Graph> { for (con...
msaglJS/msagl-js
src/routing/PreGraph.ts
<filename>src/routing/PreGraph.ts // using System; // using System.Collections.Generic; // using System.Linq; // using System.Text; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Layout; // namespace Mi...
msaglJS/msagl-js
src/layout/layered/ProperLayeredGraph.ts
<reponame>msaglJS/msagl-js import {from, IEnumerable} from 'linq-to-typescript' import {BasicGraph} from '../../structs/BasicGraph' import {GeomNode} from '../core/geomNode' import {LayerEdge} from './LayerEdge' import {PolyIntEdge} from './polyIntEdge' // a class representing a graph where every edge goes down only o...
msaglJS/msagl-js
src/structs/graph.ts
<filename>src/structs/graph.ts<gh_stars>10-100 import {Queue} from 'queue-typescript' // import {Assert} from '../utils/assert' import {Edge} from './edge' import {Node} from './node' import {NodeCollection} from './nodeCollection' export class Graph extends Node { *subgraphs(): IterableIterator<Graph> { for (co...
msaglJS/msagl-js
src/routing/rectilinear/LookaheadScan.ts
<filename>src/routing/rectilinear/LookaheadScan.ts // For lookahead points, we record the point of the intersection on the reflecting side, then // whenever we load a side, we check for active lookahead lines within this range. Since we // are just intersecting rays, we only care about the X (H scan) or Y (V scan) ...
msaglJS/msagl-js
test/routing/interactiveObstacleCalculator.spec.ts
import {Rectangle} from '../../src' import {Point, Polyline} from '../../src/math/geometry' import {InteractiveObstacleCalculator} from '../../src/routing/interactiveObstacleCalculator' import {SvgDebugWriter} from '../utils/svgDebugWriter' test('padded rectangle', () => { const rect = Rectangle.mkPP(new Point(0, 0)...
msaglJS/msagl-js
test/structs/basicGraph.spec.ts
<gh_stars>10-100 import {BasicGraph} from '../../src/structs/BasicGraph' import {IEdge} from '../../src/structs/iedge' class myedge implements IEdge { source: number target: number constructor(a: number, b: number) { this.source = a this.target = b } } test('bgoe', () => { const edges = [ new mye...
msaglJS/msagl-js
src/routing/visibility/LineSweeperBase.ts
// import {IEnumerable} from 'linq-to-typescript' import {Point} from '../../math/geometry/point' import {GeomConstants} from '../../math/geometry/geomConstants' import {Polyline} from '../../math/geometry/polyline' import {PolylinePoint} from '../../math/geometry/polylinePoint' import {BinaryHeapWithComparer} from '.....
msaglJS/msagl-js
src/routing/ShapeCreator.ts
/// <summary> /// Class for creating Shape elements from a Graph. import {from, IEnumerable} from 'linq-to-typescript' import {GeomGraph, GeomNode, GeomEdge} from '../layout/core' import {Port} from '../layout/core/port' import {RelativeFloatingPort} from '../layout/core/relativeFloatingPort' // import {Assert} fro...
msaglJS/msagl-js
test/layout/layered/layeredLayout.spec.ts
import {SortedMap} from '@esfx/collections-sortedmap' import {StringBuilder} from 'typescript-string-operations' import {join} from 'path' import * as fs from 'fs' import {sortedList} from '../sortedBySizeListOfgvFiles' import { createGeometry, nodeBoundaryFunc, labelRectFunc, outputGraph, edgeString, } f...
msaglJS/msagl-js
src/structs/attrContainer.ts
<gh_stars>10-100 export class AttrContainer { private attrs: any[] = [] get length() { return this.attrs.length } clearAttr() { this.attrs = [] } setAttr(position: number, val: any) { // todo : make it more JavaScript this.attrs[position] = val } getAttr(position: number): any { re...
msaglJS/msagl-js
src/routing/ConstrainedDelaunayTriangulation/CdtFrontElement.ts
// import {Assert} from '../../utils/assert' import {CdtEdge} from './CdtEdge' import {CdtSite} from './CdtSite' export class CdtFrontElement { // The LeftSite should coincide with the leftmost end of the Edge, and the edge should not be vertical LeftSite: CdtSite Edge: CdtEdge RightSite: CdtSite get x()...
msaglJS/msagl-js
src/routing/visibility/Stem.ts
// using System; // using System.Collections.Generic; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // namespace Microsoft.Msagl.Routing.Visibility { // // represents a chunk of a hole boundary // // < // internal class Stem { // PolylinePoint start; // ...
msaglJS/msagl-js
src/structs/node.ts
<gh_stars>10-100 import {Entity} from './entity' import {Edge} from './edge' import {Graph} from './graph' // import {Assert} from './../utils/assert' import {NodeCollection} from './nodeCollection' export class Node extends Entity { private _id: string public get id(): string { return this._id } public se...
msaglJS/msagl-js
src/routing/spline/coneSpanner/ConeSpanner.ts
<gh_stars>10-100 // using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Routing.V...
msaglJS/msagl-js
src/routing/rectilinear/SparseVisibiltyGraphGenerator.ts
// Scan direction is parallel to the sweepline which moves in the perpendicular direction; // i.e. scan direction is "sideways" along the sweepline. We do several passes, following Clarkson et al., // "Rectilinear shortest paths through polygonal obstacles in O(n (log n)2) time" (checked into the enlistment). // ...
msaglJS/msagl-js
src/routing/visibility/StemStartPointComparer.ts
// using System; // using System.Collections.Generic; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core; // namespace Microsoft.Msagl.Routing.Visibility { // // compares couples only by looking at the couple first point // // we need the coupl...
msaglJS/msagl-js
examples/layout/src/renderer.ts
import {Deck, OrthographicView} from '@deck.gl/core' import {interpolateICurve, GeomNode, GeomGraph, Point, GeomEdge} from 'msagl-js' import NodeLayer from './layers/node-layer' import EdgeLayer from './layers/edge-layer' export default class Renderer { deck: any geomGraph?: GeomGraph constructor(geomGraph?: ...
msaglJS/msagl-js
src/math/geometry/minDistCurveCurve.ts
import {ICurve} from './icurve' import {Point} from './point' import {LineSegment} from './lineSegment' import {GeomConstants} from './geomConstants' // For curves A(s) and B(t), when we have some evidence that // there is at most one intersection point, and we have a guess for the parameters (s0, t0), // we try to bri...
msaglJS/msagl-js
src/routing/rectilinear/SpliceUtility.ts
import {GeomConstants} from '../../math/geometry/geomConstants' import {IntersectionInfo} from '../../math/geometry/intersectionInfo' import {Point} from '../../math/geometry/point' import {Rectangle} from '../../math/geometry/rectangle' export class SpliceUtility { // Most of the original contents of this file hav...
msaglJS/msagl-js
src/routing/spline/bundling/SimulatedAnnealing.ts
<reponame>msaglJS/msagl-js // using System; // using System.Collections.Generic; // using System.Diagnostics; // using System.Diagnostics.CodeAnalysis; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Micr...
msaglJS/msagl-js
src/layout/layered/XLayoutGraph.ts
// Follows the idea from Gansner etc 93, creating a special graph // for x-coordinates calculation import {BasicGraphOnEdges} from '../../structs/basicGraphOnEdges' // import {Assert} from '../../utils/assert' import {LayerArrays} from './LayerArrays' import {PolyIntEdge} from './polyIntEdge' import {ProperLayeredGr...
msaglJS/msagl-js
src/math/graphAlgorithms/ConnectedComponentCalculator.ts
import {Queue} from 'queue-typescript' import {BasicGraphOnEdges} from '../../structs/basicGraphOnEdges' import {IEdge} from '../../structs/iedge' export function* GetConnectedComponents<TEdge extends IEdge>( graph: BasicGraphOnEdges<TEdge>, ): IterableIterator<number[]> { const enqueueed = new Array(graph.nodeCou...
msaglJS/msagl-js
test/layout/mds/PivotDistances.spec.ts
<gh_stars>10-100 import {parseDotGraph} from '../../../drawing/dotparser' import {MdsLayoutSettings} from '../../../src' import {MdsGraphLayout} from '../../../src/layout/mds/MDSGraphLayout' import {PivotDistances} from '../../../src/layout/mds/PivotDistances' import {SvgDebugWriter} from '../../utils/svgDebugWriter' i...
msaglJS/msagl-js
src/routing/spline/bundling/CdtIntersections.ts
<gh_stars>10-100 // using System; // using System.Collections.Generic; // using System.Diagnostics; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.Core.Routing; // using Microsoft.Msagl.Routing.ConstrainedDel...
msaglJS/msagl-js
test/layout/layered/anchor.spec.ts
import {Point, CurveFactory, GeomNode, Node} from '../../../src' import {Anchor} from '../../../src/layout/layered/anchor' import { LineSegment, Curve, GeomConstants, Polyline, } from '../../../src/math/geometry' import {DebugCurve} from '../../../src/math/geometry/debugCurve' import {IntersectionInfo} from '.....
msaglJS/msagl-js
src/math/geometry/Interval.ts
<reponame>msaglJS/msagl-js<gh_stars>10-100 import {GeomConstants} from '../../math/geometry/geomConstants' import {IRectangle} from './IRectangle' export class Interval implements IRectangle<number> { start: number end: number // constructor constructor(start: number, end: number) { this.start = start ...
msaglJS/msagl-js
test/math/geometry/smoothedPolyline.spec.ts
import {Point} from '../../../src' import {Polyline} from '../../../src/math/geometry' import {SmoothedPolyline} from '../../../src/math/geometry/smoothedPolyline' import {SvgDebugWriter} from '../../utils/svgDebugWriter' test('smooth test', () => { const ps = [ new Point(0, 100), new Point(100, 100), ne...
msaglJS/msagl-js
src/routing/spline/bundling/SdVertex.ts
<filename>src/routing/spline/bundling/SdVertex.ts /* import {VisibilityVertex} from '../../visibility/VisibilityVertex' export class SdVertex { VisibilityVertex: VisibilityVertex InBoneEdges: Array<SdBoneEdge> = new Array<SdBoneEdge>() OutBoneEdges: Array<SdBoneEdge> = new Array<SdBoneEdge>() get Prev(): S...
msaglJS/msagl-js
src/math/geometry/point.ts
<reponame>msaglJS/msagl-js<filename>src/math/geometry/point.ts import {LinearSystem2} from './linearSystem' import {GeomConstants} from './geomConstants' import {compareNumbers} from '../../utils/compare' export enum TriangleOrientation { Clockwise, Counterclockwise, Collinear, } export class Point { static Ra...
msaglJS/msagl-js
src/math/projectionSolver/Variable.ts
<gh_stars>10-100 import {String} from 'typescript-string-operations' import {compareNumbers} from '../../utils/compare' import {Block} from './Block' import {Constraint} from './Constraint' // MSAGL class for Variables for Projection Solver. export class NeighborAndWeight { Neighbor: Variable Weight: number pu...
msaglJS/msagl-js
src/math/geometry/icurve.ts
<filename>src/math/geometry/icurve.ts import {PlaneTransformation} from './planeTransformation' import {Point} from './point' import {PN} from './parallelogramNode' import {Rectangle} from './rectangle' // The interface for curves export interface ICurve { // Returns the point on the curve corresponding to parameter...
msaglJS/msagl-js
drawing/drawingObject.ts
<reponame>msaglJS/msagl-js<filename>drawing/drawingObject.ts<gh_stars>10-100 import {ArrowTypeEnum} from './arrawTypeEnum' import {Color} from './color' import {ShapeEnum} from './shapeEnum' import {StyleEnum} from './styleEnum' import {RankEnum} from './rankEnum' import {DirTypeEnum, OrderingEnum} from './dotparser' i...
msaglJS/msagl-js
src/routing/SingleSourceSingleTargetShortestPathOnVisibilityGraph.ts
<reponame>msaglJS/msagl-js // using System.Collections.Generic; // using System.Diagnostics; // using System.Linq; // using Microsoft.Msagl.Core.DataStructures; // using Microsoft.Msagl.Core.Geometry.Curves; // using Microsoft.Msagl.GraphmapsWithMesh; // using Microsoft.Msagl.Routing.Visibility; // namespace Microsoft...
Masterchef365/speedruns
src/components/leaderboard-table.tsx
import styles from "~/components/styles.module.scss"; import * as schema from "~/components/schema"; import RunDate from "~/components/run-date"; import RunDuration from "~/components/run-duration"; import RunPlayers from "~/components/run-players"; import RunRank from "~/components/run-rank"; import Link from "next/l...
Masterchef365/speedruns
src/pages/node/[node].tsx
<filename>src/pages/node/[node].tsx import { useQuery } from "@apollo/react-hooks"; import gql from "graphql-tag"; import { NextPage } from "next"; import Head from "next/head"; import { useRouter } from "next/router"; import React from "react"; import * as schema from "~/components/schema"; import styles from "~/comp...
Masterchef365/speedruns
src/components/run-date.tsx
<filename>src/components/run-date.tsx import AutoColor from "~/components/auto-color"; const RunDate: React.FC<{ date: number | null }> = ({ date }) => { if (date) { return ( <AutoColor> {new Date(date * 1000).toISOString().slice(0, "YYYY-MM-DD".length)} </AutoColor> ); } else { ret...
Masterchef365/speedruns
src/components/run-links.tsx
import { FaYoutube, FaTwitch, FaLink } from "react-icons/fa"; import { GetGamePage_game_gameCategories_leaderboard_run, GetGamePage_game_gameCategories_progression_run, } from "~/components/schema"; const RunLinks = ({ run, }: { run: | GetGamePage_game_gameCategories_leaderboard_run | GetGamePage_game...
Masterchef365/speedruns
src/pages/[game]/index.tsx
import { useQuery } from "@apollo/react-hooks"; import gql from "graphql-tag"; import { NextPage } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import Head from "next/head"; import React from "react"; import ProgressionTable from "~/components/progression-table"; import Leaderboa...
Masterchef365/speedruns
src/components/run-rank.tsx
<gh_stars>1-10 import styles from "~/components/styles.module.scss"; const RunRank: React.FC<{ rank?: number | null }> = ({ rank }) => { if (rank) { return <>{rank}</>; } else { return ( <span className={styles.obsolete} title="obsolete: this run is no longer on the leaderboard becaus...
Masterchef365/speedruns
src/components/run-players.tsx
<filename>src/components/run-players.tsx<gh_stars>1-10 import AutoColor from "~/components/auto-color"; import * as schema from "~/components/schema"; const RunPlayers: React.FC<{ players: schema.GameRun_players[] }> = ({ players, }) => { if (players?.length) { return <AutoColor>{players.map(p => p.name).join(...
Masterchef365/speedruns
src/pages/_app.tsx
<gh_stars>1-10 import App from "next/app"; import Head from "next/head"; import Router from "next/router"; import styles from "~/components/styles.module.scss"; import { inc, dec } from "~/components/hooks/use-nprogress"; import Header from "~/components/header"; import Footer from "~/components/footer"; Router.event...
Masterchef365/speedruns
src/components/loading-block.tsx
<gh_stars>1-10 const LoadingBlock = () => <div style={{ height: "256px" }}></div>; export default LoadingBlock;
Masterchef365/speedruns
src/components/header.tsx
<reponame>Masterchef365/speedruns import Link from "next/link"; import React from "react"; import styles from "~/components/styles.module.scss"; // XXX: This link doesn't seem to be handled by Next, but that might be // this issue which is apparently fixed in the next release: // https://github.com/zeit/next-plugins/...
Masterchef365/speedruns
src/components/hooks/use-debounced.ts
<reponame>Masterchef365/speedruns import { useState, useEffect } from "react"; export const useDebounced = <T>(value: T, interval: number) => { const [debouncedValue, setDebouncedValue] = useState<T>(value); useEffect(() => { const timeout = setTimeout(() => void setDebouncedValue(value), interval); retur...
Masterchef365/speedruns
src/components/footer.tsx
import React from "react"; import styles from "~/components/styles.module.scss"; const Footer: React.FC = () => ( <footer className={styles.footer}> <p> <strong> The information on this site may be incomplete or aggregated incorrectly. </strong>{" "} Refer to <a href="https://w...
Masterchef365/speedruns
src/components/progression-table.tsx
<filename>src/components/progression-table.tsx<gh_stars>1-10 import styles from "~/components/styles.module.scss"; import * as schema from "~/components/schema"; import RunDate from "~/components/run-date"; import RunDuration from "~/components/run-duration"; import RunPlayers from "~/components/run-players"; import Ru...
Masterchef365/speedruns
src/pages/[game]/run/[runSrcId].tsx
<filename>src/pages/[game]/run/[runSrcId].tsx<gh_stars>1-10 import { useQuery } from "@apollo/react-hooks"; import gql from "graphql-tag"; import { NextPage } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import Head from "next/head"; import React from "react"; import YouTube from ...
Masterchef365/speedruns
src/pages/index.tsx
import { NextPage } from "next"; import { useQuery } from "@apollo/react-hooks"; import gql from "graphql-tag"; import Link from "next/link"; import React, { useState, useMemo, useRef, useEffect } from "react"; import styles from "~/components/styles.module.scss"; import * as schema from "~/components/schema"; import ...
Masterchef365/speedruns
src/components/schema.ts
/* tslint:disable */ /* eslint-disable */ // @generated // This file was automatically generated and should not be edited. // ==================================================== // GraphQL query operation: GetGamePagePreview // ==================================================== export interface GetGamePagePreview_...
Masterchef365/speedruns
src/pages/_document.tsx
<reponame>Masterchef365/speedruns import Document, { Head, Html, Main, NextScript } from "next/document"; import styles from "~/components/styles.module.scss"; class MyDocument extends Document { public render() { return ( <Html className={styles.document}> <Head> <meta charSet="utf-8" /...
Masterchef365/speedruns
src/pages/graphql/playground.tsx
import { NextPage } from "next"; import { useEffect, useState } from "react"; import NoSSR from "react-no-ssr"; import { Provider } from "react-redux"; import styles from "~/components/styles.module.scss"; import { GRAPHQL_ENDPOINT } from "~/components/hooks/with-apollo"; const PlaygroundPage: NextPage<{}> = () => ( ...
Masterchef365/speedruns
src/components/auto-color.tsx
<reponame>Masterchef365/speedruns import space from "color-space"; import sha256 from "fast-sha256"; import styles from "~/components/styles.module.scss"; const AutoColor: React.FC<{ children?: string }> = ({ children }) => { const seed = "2"; const bytes = Array.from( sha256( Uint8Array.from( ...
Masterchef365/speedruns
src/components/hooks/use-nprogress.tsx
<filename>src/components/hooks/use-nprogress.tsx import { useEffect } from "react"; import NProgress from "nprogress"; const startDelay = 10; const doneDelay = 10; // GLOBAL STATE! let progressStack = 0; let startTimeout: undefined | NodeJS.Timeout; let doneTimeout: undefined | NodeJS.Timeout; NProgress.configure({ ...
pwais/alluxio
alluxio-ui/common/src/components/Header/Header.tsx
<filename>alluxio-ui/common/src/components/Header/Header.tsx /* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is...
pwais/alluxio
alluxio-ui/worker/src/containers/pages/BlockInfo/BlockInfo.tsx
<filename>alluxio-ui/worker/src/containers/pages/BlockInfo/BlockInfo.tsx<gh_stars>0 /* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0...
pwais/alluxio
alluxio-ui/common/src/components/LoadingMessage/LoadingMessage.tsx
/* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDI...
pwais/alluxio
alluxio-ui/master/src/containers/pages/Data/Data.tsx
/* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDI...
pwais/alluxio
alluxio-ui/common/src/components/Footer/Footer.tsx
<reponame>pwais/alluxio<filename>alluxio-ui/common/src/components/Footer/Footer.tsx<gh_stars>0 /* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/...
pwais/alluxio
alluxio-ui/master/src/containers/pages/Logs/Logs.tsx
/* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDI...
pwais/alluxio
alluxio-ui/common/src/index.tsx
<gh_stars>0 /* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANT...
pwais/alluxio
alluxio-ui/common/src/components/FileView/FileView.tsx
<gh_stars>0 /* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANT...
pwais/alluxio
alluxio-ui/master/src/containers/pages/Metrics/Metrics.tsx
<filename>alluxio-ui/master/src/containers/pages/Metrics/Metrics.tsx /* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This sof...
pwais/alluxio
alluxio-ui/common/src/utilities/handlers/getInputValidator.tsx
/* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDI...
pwais/alluxio
alluxio-ui/common/src/utilities/validators/isNotEmpty.tsx
/* * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 * (the "License"). You may not use this work except in compliance with the License, which is * available at www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDI...