@mapxus/mapxus-visual-jp 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitbucket-pipelines.yml +50 -0
- package/config/rollup.js +33 -0
- package/config/rollup.serve.config.js +3 -0
- package/debug/circlemarker.html +444 -0
- package/debug/create_tags.html +474 -0
- package/debug/distance.html +220 -0
- package/debug/index.html +92 -0
- package/debug/integration.html +1084 -0
- package/debug/leaflet.html +54 -0
- package/debug/markers.html +115 -0
- package/debug/multi_monitor_sync.html +377 -0
- package/debug/outdoor.html +1026 -0
- package/debug/rect_tags.html +147 -0
- package/debug/rotate.html +236 -0
- package/debug/sample.html +324 -0
- package/debug/sequence.html +75 -0
- package/debug/tags.html +218 -0
- package/package.json +34 -10
- package/rollup.config.js +39 -0
- package/server.js +35 -0
- package/spec/api/APIv3.spec.ts +86 -0
- package/spec/component/Component.spec.ts +68 -0
- package/spec/component/StatsComponent.spec.ts +33 -0
- package/spec/component/direction/DirectionComponent.spec.ts +163 -0
- package/spec/component/direction/DirectionDOMRenderer.spec.ts +233 -0
- package/spec/component/keyboard/KeyZoomHandler.spec.ts +236 -0
- package/spec/component/marker/Marker.spec.ts +104 -0
- package/spec/component/marker/MarkerComponent.spec.ts +88 -0
- package/spec/component/marker/MarkerScene.spec.ts +223 -0
- package/spec/component/marker/MarkerSet.spec.ts +453 -0
- package/spec/component/mouse/DoubleClickZoomHandler.spec.ts +211 -0
- package/spec/component/popup/Popup.spec.ts +479 -0
- package/spec/component/popup/PopupComponent.spec.ts +414 -0
- package/spec/component/tag/CreateHandlerBase.spec.ts +83 -0
- package/spec/component/tag/CreatePointHandler.spec.ts +190 -0
- package/spec/component/tag/OutlineRenderTag.spec.ts +91 -0
- package/spec/component/tag/PointGeometry.spec.ts +131 -0
- package/spec/component/tag/PolygonGeometry.spec.ts +497 -0
- package/spec/component/tag/RectGeometry.spec.ts +1157 -0
- package/spec/component/tag/TagComponent.spec.ts +513 -0
- package/spec/component/tag/TagScene.spec.ts +346 -0
- package/spec/component/tag/TagSet.spec.ts +241 -0
- package/spec/component/utils/HandlerBase.spec.ts +203 -0
- package/spec/geo/Camera.spec.ts +250 -0
- package/spec/geo/GeoCoords.spec.ts +364 -0
- package/spec/geo/Spatial.spec.ts +711 -0
- package/spec/geo/Transform.spec.ts +850 -0
- package/spec/geo/ViewportCoords.spec.ts +534 -0
- package/spec/graph/FilterCreator.spec.ts +892 -0
- package/spec/graph/Graph.spec.ts +2078 -0
- package/spec/graph/GraphCalculator.spec.ts +263 -0
- package/spec/graph/GraphService.spec.ts +663 -0
- package/spec/graph/Node.spec.ts +373 -0
- package/spec/graph/NodeCache.spec.ts +206 -0
- package/spec/graph/Sequence.spec.ts +37 -0
- package/spec/graph/edge/EdgeCalculator.Pano.spec.ts +963 -0
- package/spec/graph/edge/EdgeCalculator.Sequence.spec.ts +108 -0
- package/spec/graph/edge/EdgeCalculator.Similar.spec.ts +272 -0
- package/spec/graph/edge/EdgeCalculator.Step.spec.ts +383 -0
- package/spec/graph/edge/EdgeCalculator.Turn.spec.ts +278 -0
- package/spec/graph/edge/EdgeCalculator.spec.ts +747 -0
- package/spec/helper/ContainerMockCreator.spec.ts +33 -0
- package/spec/helper/DOMRendererMockCreator.spec.ts +22 -0
- package/spec/helper/EdgeCalculatorHelper.spec.ts +96 -0
- package/spec/helper/EventHelper.spec.ts +92 -0
- package/spec/helper/GLRendererMockCreator.spec.ts +23 -0
- package/spec/helper/GeoHelper.spec.ts +16 -0
- package/spec/helper/ImageLoadingServiceMockCreator.spec.ts +24 -0
- package/spec/helper/KeyboardServiceMockCreator.spec.ts +21 -0
- package/spec/helper/LoadingServiceMockCreator.spec.ts +21 -0
- package/spec/helper/MockCreator.spec.ts +18 -0
- package/spec/helper/MockCreatorBase.spec.ts +17 -0
- package/spec/helper/MouseServiceMockCreator.spec.ts +38 -0
- package/spec/helper/NavigatorMockCreator.spec.ts +28 -0
- package/spec/helper/NodeHelper.spec.ts +77 -0
- package/spec/helper/NodeMockCreator.spec.ts +19 -0
- package/spec/helper/RenderServiceMockCreator.spec.ts +25 -0
- package/spec/helper/SpriteServiceMockCreator.spec.ts +22 -0
- package/spec/helper/StateServiceMockCreator.spec.ts +33 -0
- package/spec/helper/TouchServiceMockCreator.spec.ts +29 -0
- package/spec/helper/TransformHelper.spec.ts +17 -0
- package/spec/render/DOMRenderer.spec.ts +112 -0
- package/spec/render/GLRenderer.spec.ts +453 -0
- package/spec/render/RenderCamera.spec.ts +535 -0
- package/spec/render/RenderService.spec.ts +531 -0
- package/spec/state/StateBase.spec.ts +369 -0
- package/spec/state/StateService.spec.ts +9 -0
- package/spec/state/TraversingState.spec.ts +262 -0
- package/spec/state/WaitingState.spec.ts +319 -0
- package/spec/tiles/TextureProvider.spec.ts +653 -0
- package/spec/utils/EventEmitter.spec.ts +71 -0
- package/spec/utils/Support.spec.ts +54 -0
- package/spec/viewer/CacheService.spec.ts +160 -0
- package/spec/viewer/ComponentController.spec.ts +310 -0
- package/spec/viewer/LoadingService.spec.ts +19 -0
- package/spec/viewer/MouseService.spec.ts +1344 -0
- package/spec/viewer/Navigator.spec.ts +970 -0
- package/spec/viewer/Observer.spec.ts +96 -0
- package/spec/viewer/SpriteService.spec.ts +224 -0
- package/src/API.ts +3 -0
- package/src/Component.ts +77 -0
- package/src/Edge.ts +6 -0
- package/src/Error.ts +3 -0
- package/src/FilterRender.ts +27 -0
- package/src/Geo.ts +7 -0
- package/src/Graph.ts +19 -0
- package/src/MapxusVisual.ts +66 -0
- package/src/Render.ts +7 -0
- package/src/State.ts +8 -0
- package/src/Support.ts +35 -0
- package/src/Tiles.ts +5 -0
- package/src/Utils.ts +6 -0
- package/src/Viewer.ts +16 -0
- package/src/api/API.ts +396 -0
- package/src/api/Auth.ts +76 -0
- package/src/api/AuthStore.ts +11 -0
- package/src/api/GraphQLCreator.ts +100 -0
- package/src/api/interfaces/IAuth.ts +7 -0
- package/src/api/interfaces/IBuildingBase.ts +7 -0
- package/src/api/interfaces/IBuildingInfo.ts +19 -0
- package/src/api/interfaces/ICoreNode.ts +28 -0
- package/src/api/interfaces/IFillNode.ts +96 -0
- package/src/api/interfaces/IFloorInfo.ts +10 -0
- package/src/api/interfaces/IFullNode.ts +10 -0
- package/src/api/interfaces/IGPano.ts +38 -0
- package/src/api/interfaces/IImageTagInfo.ts +14 -0
- package/src/api/interfaces/IKey.ts +13 -0
- package/src/api/interfaces/ILatLon.ts +19 -0
- package/src/api/interfaces/IOutdoor.ts +14 -0
- package/src/api/interfaces/IPathNode.ts +37 -0
- package/src/api/interfaces/IProject.ts +8 -0
- package/src/api/interfaces/IQueryBuilding.ts +37 -0
- package/src/api/interfaces/IResponse.ts +7 -0
- package/src/api/interfaces/ISequence.ts +16 -0
- package/src/api/interfaces/IUser.ts +13 -0
- package/src/api/interfaces/interfaces.ts +17 -0
- package/src/component/AttributionComponent.ts +48 -0
- package/src/component/BackgroundComponent.ts +39 -0
- package/src/component/BearingComponent.ts +282 -0
- package/src/component/CacheComponent.ts +295 -0
- package/src/component/Component.ts +130 -0
- package/src/component/ComponentService.ts +150 -0
- package/src/component/CoverComponent.ts +132 -0
- package/src/component/DebugComponent.ts +157 -0
- package/src/component/ImageComponent.ts +96 -0
- package/src/component/LoadingComponent.ts +85 -0
- package/src/component/NavigationComponent.ts +233 -0
- package/src/component/RouteComponent.ts +354 -0
- package/src/component/StatsComponent.ts +100 -0
- package/src/component/direction/DirectionComponent.ts +254 -0
- package/src/component/direction/DirectionDOMCalculator.ts +243 -0
- package/src/component/direction/DirectionDOMRenderer.ts +631 -0
- package/src/component/imageplane/ImagePlaneComponent.ts +497 -0
- package/src/component/imageplane/ImagePlaneFactory.ts +314 -0
- package/src/component/imageplane/ImagePlaneGLRenderer.ts +247 -0
- package/src/component/imageplane/ImagePlaneScene.ts +87 -0
- package/src/component/imageplane/ImagePlaneShaders.ts +16 -0
- package/src/component/imageplane/SliderComponent.ts +697 -0
- package/src/component/imageplane/interfaces/IBBoxShaderMaterial.ts +10 -0
- package/src/component/imageplane/interfaces/IShaderMaterial.ts +9 -0
- package/src/component/imageplane/interfaces/interfaces.ts +2 -0
- package/src/component/imageplane/shaders/equirectangular.fragment.glsl.ts +26 -0
- package/src/component/imageplane/shaders/equirectangular.vertex.glsl.ts +15 -0
- package/src/component/imageplane/shaders/perspective.fragment.glsl.ts +27 -0
- package/src/component/imageplane/shaders/perspective.vertex.glsl.ts +15 -0
- package/src/component/interfaces/ICacheConfiguration.ts +72 -0
- package/src/component/interfaces/IComponentConfiguration.ts +5 -0
- package/src/component/interfaces/ICoverConfiguration.ts +15 -0
- package/src/component/interfaces/IDirectionConfiguration.ts +63 -0
- package/src/component/interfaces/IImagePlaneConfiguration.ts +17 -0
- package/src/component/interfaces/IKeyboardConfiguration.ts +44 -0
- package/src/component/interfaces/IMarkerConfiguration.ts +31 -0
- package/src/component/interfaces/IMouseConfiguration.ts +52 -0
- package/src/component/interfaces/INavigationConfiguration.ts +35 -0
- package/src/component/interfaces/IRouteConfiguration.ts +20 -0
- package/src/component/interfaces/ISequenceConfiguration.ts +72 -0
- package/src/component/interfaces/IShader.ts +6 -0
- package/src/component/interfaces/ISliderConfiguration.ts +61 -0
- package/src/component/interfaces/ITagConfiguration.ts +40 -0
- package/src/component/interfaces/interfaces.ts +17 -0
- package/src/component/keyboard/KeySequenceNavigationHandler.ts +86 -0
- package/src/component/keyboard/KeySpatialNavigationHandler.ts +216 -0
- package/src/component/keyboard/KeyZoomHandler.ts +106 -0
- package/src/component/keyboard/KeyboardComponent.ts +125 -0
- package/src/component/marker/Marker.ts +5 -0
- package/src/component/marker/MarkerComponent.ts +856 -0
- package/src/component/marker/MarkerScene.ts +145 -0
- package/src/component/marker/MarkerSet.ts +142 -0
- package/src/component/marker/interfaces/IArrowMarkerOptions.ts +41 -0
- package/src/component/marker/interfaces/ICircleMarkerOptions.ts +30 -0
- package/src/component/marker/interfaces/IDotMarkerOptions.ts +18 -0
- package/src/component/marker/interfaces/IMarkerEvent.ts +28 -0
- package/src/component/marker/interfaces/ISimpleMarkerOptions.ts +54 -0
- package/src/component/marker/interfaces/interfaces.ts +5 -0
- package/src/component/marker/marker/ArrowMarker.ts +84 -0
- package/src/component/marker/marker/CircleMarker.ts +82 -0
- package/src/component/marker/marker/DotMarker.ts +68 -0
- package/src/component/marker/marker/ImageMarker.ts +45 -0
- package/src/component/marker/marker/Marker.ts +99 -0
- package/src/component/marker/marker/SimpleMarker.ts +187 -0
- package/src/component/mouse/BounceHandler.ts +148 -0
- package/src/component/mouse/DoubleClickZoomHandler.ts +106 -0
- package/src/component/mouse/DragPanHandler.ts +489 -0
- package/src/component/mouse/HandlerTypes.ts +13 -0
- package/src/component/mouse/MouseComponent.ts +170 -0
- package/src/component/mouse/ScrollZoomHandler.ts +137 -0
- package/src/component/mouse/TouchZoomHandler.ts +136 -0
- package/src/component/path/PathComponent.ts +75 -0
- package/src/component/path/PathEvent.ts +245 -0
- package/src/component/path/PathMarker.ts +42 -0
- package/src/component/path/PathRender.ts +163 -0
- package/src/component/popup/Popup.ts +2 -0
- package/src/component/popup/PopupComponent.ts +244 -0
- package/src/component/popup/interfaces/IPopupOffset.ts +37 -0
- package/src/component/popup/interfaces/IPopupOptions.ts +81 -0
- package/src/component/popup/popup/Popup.ts +594 -0
- package/src/component/popup/popup/PopupAlignment.ts +3 -0
- package/src/component/sequence/SequenceComponent.ts +500 -0
- package/src/component/sequence/SequenceDOMInteraction.ts +23 -0
- package/src/component/sequence/SequenceDOMRenderer.ts +179 -0
- package/src/component/tag/Tag.ts +9 -0
- package/src/component/tag/TagComponent.ts +787 -0
- package/src/component/tag/TagCreator.ts +138 -0
- package/src/component/tag/TagDOMRenderer.ts +35 -0
- package/src/component/tag/TagMode.ts +37 -0
- package/src/component/tag/TagOperation.ts +7 -0
- package/src/component/tag/TagScene.ts +216 -0
- package/src/component/tag/TagSet.ts +186 -0
- package/src/component/tag/error/GeometryTagError.ts +11 -0
- package/src/component/tag/geometry/Geometry.ts +62 -0
- package/src/component/tag/geometry/PointGeometry.ts +89 -0
- package/src/component/tag/geometry/PolygonGeometry.ts +349 -0
- package/src/component/tag/geometry/RectGeometry.ts +759 -0
- package/src/component/tag/geometry/VertexGeometry.ts +185 -0
- package/src/component/tag/handlers/CreateHandlerBase.ts +81 -0
- package/src/component/tag/handlers/CreatePointHandler.ts +35 -0
- package/src/component/tag/handlers/CreatePolygonHandler.ts +33 -0
- package/src/component/tag/handlers/CreateRectDragHandler.ts +199 -0
- package/src/component/tag/handlers/CreateRectHandler.ts +57 -0
- package/src/component/tag/handlers/CreateVertexHandler.ts +165 -0
- package/src/component/tag/handlers/EditVertexHandler.ts +275 -0
- package/src/component/tag/handlers/TagHandlerBase.ts +57 -0
- package/src/component/tag/interfaces/IInteraction.ts +14 -0
- package/src/component/tag/interfaces/IOutlineCreateTagOptions.ts +15 -0
- package/src/component/tag/interfaces/IOutlineTagOptions.ts +89 -0
- package/src/component/tag/interfaces/ISpotTagOptions.ts +37 -0
- package/src/component/tag/interfaces/interfaces.ts +4 -0
- package/src/component/tag/tag/OutlineCreateTag.ts +330 -0
- package/src/component/tag/tag/OutlineRenderTag.ts +569 -0
- package/src/component/tag/tag/OutlineTag.ts +380 -0
- package/src/component/tag/tag/RenderTag.ts +50 -0
- package/src/component/tag/tag/SpotRenderTag.ts +160 -0
- package/src/component/tag/tag/SpotTag.ts +170 -0
- package/src/component/tag/tag/Tag.ts +103 -0
- package/src/component/utils/HandlerBase.ts +71 -0
- package/src/error/ArgumentBeeviewError.ts +11 -0
- package/src/error/BeeviewError.ts +9 -0
- package/src/error/GraphBeeviewError.ts +11 -0
- package/src/geo/Camera.ts +149 -0
- package/src/geo/GeoCoords.ts +280 -0
- package/src/geo/GeoRBush.ts +25 -0
- package/src/geo/Spatial.ts +259 -0
- package/src/geo/Transform.ts +543 -0
- package/src/geo/ViewportCoords.ts +518 -0
- package/src/geo/interfaces/ILatLonAlt.ts +7 -0
- package/src/geo/interfaces/interfaces.ts +1 -0
- package/src/graph/FilterCreator.ts +106 -0
- package/src/graph/FilterExpression.ts +16 -0
- package/src/graph/Graph.ts +1516 -0
- package/src/graph/GraphCalculator.ts +197 -0
- package/src/graph/GraphService.ts +516 -0
- package/src/graph/ImageLoadingService.ts +44 -0
- package/src/graph/MeshReader.ts +19 -0
- package/src/graph/Node.ts +622 -0
- package/src/graph/NodeCache.ts +548 -0
- package/src/graph/Sequence.ts +117 -0
- package/src/graph/edge/EdgeCalculator.ts +919 -0
- package/src/graph/edge/EdgeCalculatorCoefficients.ts +43 -0
- package/src/graph/edge/EdgeCalculatorDirections.ts +80 -0
- package/src/graph/edge/EdgeCalculatorSettings.ts +61 -0
- package/src/graph/edge/EdgeDirection.ts +63 -0
- package/src/graph/edge/interfaces/IEdge.ts +26 -0
- package/src/graph/edge/interfaces/IEdgeData.ts +22 -0
- package/src/graph/edge/interfaces/IPano.ts +8 -0
- package/src/graph/edge/interfaces/IPotentialEdge.ts +106 -0
- package/src/graph/edge/interfaces/IStep.ts +7 -0
- package/src/graph/edge/interfaces/ITurn.ts +7 -0
- package/src/graph/edge/interfaces/interfaces.ts +6 -0
- package/src/graph/interfaces/IEdgeStatus.ts +25 -0
- package/src/graph/interfaces/IGraphConfiguration.ts +26 -0
- package/src/graph/interfaces/ILoadStatus.ts +18 -0
- package/src/graph/interfaces/ILoadStatusObject.ts +8 -0
- package/src/graph/interfaces/IMesh.ts +20 -0
- package/src/graph/interfaces/interfaces.ts +5 -0
- package/src/render/DOMRenderer.ts +288 -0
- package/src/render/GLRenderStage.ts +6 -0
- package/src/render/GLRenderer.ts +436 -0
- package/src/render/RenderCamera.ts +212 -0
- package/src/render/RenderMode.ts +34 -0
- package/src/render/RenderService.ts +264 -0
- package/src/render/interfaces/IGLRender.ts +10 -0
- package/src/render/interfaces/IGLRenderFunction.ts +10 -0
- package/src/render/interfaces/IGLRenderHash.ts +8 -0
- package/src/render/interfaces/ISize.ts +6 -0
- package/src/render/interfaces/IVNodeHash.ts +8 -0
- package/src/render/interfaces/interfaces.ts +5 -0
- package/src/state/FrameGenerator.ts +36 -0
- package/src/state/State.ts +6 -0
- package/src/state/StateContext.ts +180 -0
- package/src/state/StateService.ts +600 -0
- package/src/state/StateTransitionMatrix.ts +58 -0
- package/src/state/interfaces/ICurrentState.ts +21 -0
- package/src/state/interfaces/IFrame.ts +9 -0
- package/src/state/interfaces/IRotation.ts +6 -0
- package/src/state/interfaces/IState.ts +11 -0
- package/src/state/interfaces/IStateContext.ts +31 -0
- package/src/state/interfaces/interfaces.ts +5 -0
- package/src/state/states/StateBase.ts +425 -0
- package/src/state/states/TraversingState.ts +861 -0
- package/src/state/states/WaitingState.ts +109 -0
- package/src/tiles/ImageTileLoader.ts +121 -0
- package/src/tiles/ImageTileStore.ts +70 -0
- package/src/tiles/RegionOfInterestCalculator.ts +158 -0
- package/src/tiles/TextureProvider.ts +609 -0
- package/src/tiles/interfaces/IBoundingBox.ts +28 -0
- package/src/tiles/interfaces/IRegionOfInterest.ts +25 -0
- package/src/tiles/interfaces/interfaces.ts +2 -0
- package/src/utils/DOM.ts +28 -0
- package/src/utils/EventEmitter.ts +61 -0
- package/src/utils/Func.ts +3 -0
- package/src/utils/Settings.ts +39 -0
- package/src/utils/Support.ts +70 -0
- package/src/utils/Urls.ts +43 -0
- package/src/viewer/Alignment.ts +53 -0
- package/src/viewer/CacheService.ts +75 -0
- package/src/viewer/ComponentController.ts +237 -0
- package/src/viewer/Container.ts +100 -0
- package/src/viewer/EventNames.ts +192 -0
- package/src/viewer/ImageSize.ts +28 -0
- package/src/viewer/KeyboardService.ts +15 -0
- package/src/viewer/LoadingService.ts +66 -0
- package/src/viewer/MouseService.ts +541 -0
- package/src/viewer/Navigator.ts +362 -0
- package/src/viewer/Observer.ts +441 -0
- package/src/viewer/Projection.ts +162 -0
- package/src/viewer/SpriteService.ts +281 -0
- package/src/viewer/TouchService.ts +336 -0
- package/src/viewer/Viewer.ts +1132 -0
- package/src/viewer/interfaces/IComponentOptions.ts +176 -0
- package/src/viewer/interfaces/IMouseClaim.ts +6 -0
- package/src/viewer/interfaces/IMouseDeferPixels.ts +6 -0
- package/src/viewer/interfaces/IPinch.ts +81 -0
- package/src/viewer/interfaces/ISpriteAtlas.ts +12 -0
- package/src/viewer/interfaces/IUnprojection.ts +9 -0
- package/src/viewer/interfaces/IViewerMouseEvent.ts +56 -0
- package/src/viewer/interfaces/IViewerOptions.ts +88 -0
- package/src/viewer/interfaces/PointOfView.ts +19 -0
- package/src/viewer/interfaces/interfaces.ts +9 -0
- package/styles/AttributionComponent.css +26 -0
- package/styles/BackgroundComponent.css +21 -0
- package/styles/BearingComponent.css +48 -0
- package/styles/CoverComponent.css +169 -0
- package/styles/DebugComponent.css +28 -0
- package/styles/DirectionComponent.css +154 -0
- package/styles/LoadingComponent.css +14 -0
- package/styles/NavigationComponent.css +64 -0
- package/styles/NorthBg.png +0 -0
- package/styles/PopupComponent.css +188 -0
- package/styles/RouteComponent.css +21 -0
- package/styles/SequenceComponent.css +120 -0
- package/styles/SliderComponent.css +82 -0
- package/styles/TagComponent.css +105 -0
- package/styles/cover-logo.png +0 -0
- package/styles/mapillary-js.css +29 -0
- package/styles/pano-indicator.svg +3 -0
- package/styles/pano.svg +20 -0
- package/styles/pointer-wheat.svg +3 -0
- package/styles/pointer-white.svg +3 -0
- package/styles/spinner.svg +1 -0
- package/styles/stepper-left.svg +1 -0
- package/styles/stepper-play.svg +1 -0
- package/styles/stepper-right.svg +1 -0
- package/styles/stepper-stop.svg +1 -0
- package/styles/turn-around.svg +3 -0
- package/styles/turn.svg +3 -0
- package/tsconfig.json +28 -0
- package/tslint.json +81 -0
- package/types/graphql/index.d.ts +28 -0
- package/types/graphql/language/ast/index.d.ts +7 -0
- package/types/images/index.d.ts +7 -0
- package/types/pbf/index.d.ts +16 -0
- package/types/rbush/index.d.ts +28 -0
- package/version/beeview-0.1.0.css +2 -0
- package/version/beeview-0.1.0.js +1 -0
- package/version/beeview-0.1.1.css +2 -0
- package/version/beeview-0.1.1.js +1 -0
- package/version/beeview-0.1.2.css +2 -0
- package/version/beeview-0.1.2.js +1 -0
- package/version/beeview-0.2.0.css +2 -0
- package/version/beeview-0.2.0.js +1 -0
- package/version/beeview-0.2.1.css +2 -0
- package/version/beeview-0.2.1.js +1 -0
- package/version/beeview-0.3.0.css +2 -0
- package/version/beeview-0.3.0.js +1 -0
- package/version/beeview-0.4.0.css +2 -0
- package/version/beeview-0.4.0.js +1 -0
- package/version/beeview-0.4.1.css +2 -0
- package/version/beeview-0.4.1.js +1 -0
- package/version/mapxus-visual-1.0.0.css +2 -0
- package/version/mapxus-visual-1.0.0.js +1 -0
- package/version/mapxus-visual-1.1.0.css +2 -0
- package/version/mapxus-visual-1.1.0.js +1 -0
- package/version/mapxus-visual-1.1.1.css +2 -0
- package/version/mapxus-visual-1.1.1.js +1 -0
- package/version/mapxus-visual-1.1.2.css +2 -0
- package/version/mapxus-visual-1.1.2.js +1 -0
- package/version/mapxus-visual-1.2.0.css +2 -0
- package/version/mapxus-visual-1.2.0.js +1 -0
- package/version/mapxus-visual-1.3.0.css +2 -0
- package/version/mapxus-visual-1.3.0.js +1 -0
- package/LICENSE +0 -11
- package/README.md +0 -28
- package/index.css +0 -2
- package/index.d.ts +0 -163
- package/index.js +0 -1
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
/// <reference path="../../typings/index.d.ts" />
|
|
2
|
+
|
|
3
|
+
import {Observable} from "rxjs/Observable";
|
|
4
|
+
import {Subject} from "rxjs/Subject";
|
|
5
|
+
|
|
6
|
+
import {NodeHelper} from "../helper/NodeHelper.spec";
|
|
7
|
+
|
|
8
|
+
import {API, ICoreNode} from "../../src/API";
|
|
9
|
+
import {
|
|
10
|
+
Graph,
|
|
11
|
+
GraphService,
|
|
12
|
+
IEdgeStatus,
|
|
13
|
+
ImageLoadingService,
|
|
14
|
+
Node,
|
|
15
|
+
} from "../../src/Graph";
|
|
16
|
+
|
|
17
|
+
describe("GraphService.ctor", () => {
|
|
18
|
+
it("should create a graph service", () => {
|
|
19
|
+
let api: API = new API();
|
|
20
|
+
let graph: Graph = new Graph(api);
|
|
21
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
22
|
+
|
|
23
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
24
|
+
|
|
25
|
+
expect(graphService).toBeDefined();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("GraphService.cacheSequence$", () => {
|
|
30
|
+
it("should cache sequence when graph does not have sequence", () => {
|
|
31
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
32
|
+
|
|
33
|
+
let api: API = new API();
|
|
34
|
+
let graph: Graph = new Graph(api);
|
|
35
|
+
|
|
36
|
+
spyOn(graph, "isCachingSequence").and.returnValue(false);
|
|
37
|
+
spyOn(graph, "hasSequence").and.returnValue(false);
|
|
38
|
+
|
|
39
|
+
let cacheSequence$: Subject<Graph> = new Subject<Graph>();
|
|
40
|
+
let cacheSequenceSpy: jasmine.Spy = spyOn(graph, "cacheSequence$");
|
|
41
|
+
cacheSequenceSpy.and.returnValue(cacheSequence$);
|
|
42
|
+
|
|
43
|
+
let getSequenceSpy: jasmine.Spy = spyOn(graph, "getSequence");
|
|
44
|
+
getSequenceSpy.and.returnValue(graph);
|
|
45
|
+
|
|
46
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
47
|
+
|
|
48
|
+
graphService.cacheSequence$("sequenceKey").subscribe(() => { /*noop*/ });
|
|
49
|
+
|
|
50
|
+
cacheSequence$.next(graph);
|
|
51
|
+
|
|
52
|
+
expect(cacheSequenceSpy.calls.count()).toBe(1);
|
|
53
|
+
expect(getSequenceSpy.calls.count()).toBe(1);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("should cache sequence when graph is caching sequence", () => {
|
|
57
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
58
|
+
|
|
59
|
+
let api: API = new API();
|
|
60
|
+
let graph: Graph = new Graph(api);
|
|
61
|
+
|
|
62
|
+
spyOn(graph, "isCachingSequence").and.returnValue(true);
|
|
63
|
+
spyOn(graph, "hasSequence").and.returnValue(false);
|
|
64
|
+
|
|
65
|
+
let cacheSequence$: Subject<Graph> = new Subject<Graph>();
|
|
66
|
+
let cacheSequenceSpy: jasmine.Spy = spyOn(graph, "cacheSequence$");
|
|
67
|
+
cacheSequenceSpy.and.returnValue(cacheSequence$);
|
|
68
|
+
|
|
69
|
+
let getSequenceSpy: jasmine.Spy = spyOn(graph, "getSequence");
|
|
70
|
+
getSequenceSpy.and.returnValue(graph);
|
|
71
|
+
|
|
72
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
73
|
+
|
|
74
|
+
graphService.cacheSequence$("sequenceKey").subscribe(() => { /*noop*/ });
|
|
75
|
+
|
|
76
|
+
cacheSequence$.next(graph);
|
|
77
|
+
|
|
78
|
+
expect(cacheSequenceSpy.calls.count()).toBe(1);
|
|
79
|
+
expect(getSequenceSpy.calls.count()).toBe(1);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("should not cache sequence when graph have sequence", () => {
|
|
83
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
84
|
+
|
|
85
|
+
let api: API = new API();
|
|
86
|
+
let graph: Graph = new Graph(api);
|
|
87
|
+
|
|
88
|
+
spyOn(graph, "isCachingSequence").and.returnValue(false);
|
|
89
|
+
spyOn(graph, "hasSequence").and.returnValue(true);
|
|
90
|
+
|
|
91
|
+
let cacheSequence$: Subject<Graph> = new Subject<Graph>();
|
|
92
|
+
let cacheSequenceSpy: jasmine.Spy = spyOn(graph, "cacheSequence$");
|
|
93
|
+
cacheSequenceSpy.and.returnValue(cacheSequence$);
|
|
94
|
+
|
|
95
|
+
let getSequenceSpy: jasmine.Spy = spyOn(graph, "getSequence");
|
|
96
|
+
getSequenceSpy.and.returnValue(graph);
|
|
97
|
+
|
|
98
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
99
|
+
|
|
100
|
+
graphService.cacheSequence$("sequenceKey").subscribe(() => { /*noop*/ });
|
|
101
|
+
|
|
102
|
+
cacheSequence$.next(graph);
|
|
103
|
+
|
|
104
|
+
expect(cacheSequenceSpy.calls.count()).toBe(0);
|
|
105
|
+
expect(getSequenceSpy.calls.count()).toBe(1);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
class TestNode extends Node {
|
|
110
|
+
private _assetsCached: boolean;
|
|
111
|
+
private _sequenceEdges: IEdgeStatus;
|
|
112
|
+
private _spatialEdges: IEdgeStatus;
|
|
113
|
+
|
|
114
|
+
constructor(core: ICoreNode) {
|
|
115
|
+
super(core);
|
|
116
|
+
|
|
117
|
+
this._assetsCached = false;
|
|
118
|
+
this._sequenceEdges = { cached: false, edges: [] };
|
|
119
|
+
this._spatialEdges = { cached: false, edges: [] };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
public get assetsCached(): boolean {
|
|
123
|
+
return this._assetsCached;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
public set assetsCached(value: boolean) {
|
|
127
|
+
this._assetsCached = value;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
public get sequenceEdges(): IEdgeStatus {
|
|
131
|
+
return this._sequenceEdges;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public get spatialEdges(): IEdgeStatus {
|
|
135
|
+
return this._spatialEdges;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
describe("GraphService.cacheNode$", () => {
|
|
140
|
+
let helper: NodeHelper;
|
|
141
|
+
|
|
142
|
+
beforeEach(() => {
|
|
143
|
+
helper = new NodeHelper();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("should cache and return node", (done: Function) => {
|
|
147
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
148
|
+
let loadNodeSpy: jasmine.Spy = spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
149
|
+
|
|
150
|
+
let api: API = new API();
|
|
151
|
+
let graph: Graph = new Graph(api);
|
|
152
|
+
|
|
153
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
154
|
+
spyOn(graph, "hasNode").and.returnValue(false);
|
|
155
|
+
|
|
156
|
+
let cacheFull$: Subject<Graph> = new Subject<Graph>();
|
|
157
|
+
let cacheFullSpy: jasmine.Spy = spyOn(graph, "cacheFull$");
|
|
158
|
+
cacheFullSpy.and.returnValue(cacheFull$);
|
|
159
|
+
|
|
160
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(false);
|
|
161
|
+
let initializeCacheSpy: jasmine.Spy = spyOn(graph, "initializeCache").and.stub();
|
|
162
|
+
|
|
163
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
164
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(false);
|
|
165
|
+
|
|
166
|
+
let cacheNodeSequence$: Subject<Graph> = new Subject<Graph>();
|
|
167
|
+
spyOn(graph, "cacheNodeSequence$").and.returnValue(cacheNodeSequence$);
|
|
168
|
+
|
|
169
|
+
spyOn(graph, "hasTiles").and.returnValue(false);
|
|
170
|
+
|
|
171
|
+
let cacheTiles$: Subject<Graph> = new Subject<Graph>();
|
|
172
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
173
|
+
|
|
174
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
175
|
+
|
|
176
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
177
|
+
|
|
178
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
179
|
+
let cacheAssetsSpy: jasmine.Spy = spyOn(node, "cacheAssets$");
|
|
180
|
+
cacheAssetsSpy.and.returnValue(cacheAssets$);
|
|
181
|
+
|
|
182
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
183
|
+
|
|
184
|
+
graphService.cacheNode$(node.key)
|
|
185
|
+
.subscribe(
|
|
186
|
+
(n: Node): void => {
|
|
187
|
+
expect(cacheFullSpy.calls.count()).toBe(1);
|
|
188
|
+
expect(initializeCacheSpy.calls.count()).toBe(1);
|
|
189
|
+
expect(cacheAssetsSpy.calls.count()).toBe(1);
|
|
190
|
+
|
|
191
|
+
expect(loadNodeSpy.calls.count()).toBe(1);
|
|
192
|
+
|
|
193
|
+
done();
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
cacheFull$.next(graph);
|
|
197
|
+
|
|
198
|
+
node.assetsCached = true;
|
|
199
|
+
cacheAssets$.next(node);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it("should fill and return node", (done: Function) => {
|
|
203
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
204
|
+
spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
205
|
+
|
|
206
|
+
let api: API = new API();
|
|
207
|
+
let graph: Graph = new Graph(api);
|
|
208
|
+
|
|
209
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
210
|
+
spyOn(graph, "hasNode").and.returnValue(true);
|
|
211
|
+
spyOn(graph, "isCachingFill").and.returnValue(false);
|
|
212
|
+
|
|
213
|
+
let cacheFill$: Subject<Graph> = new Subject<Graph>();
|
|
214
|
+
let cacheFillSpy: jasmine.Spy = spyOn(graph, "cacheFill$");
|
|
215
|
+
cacheFillSpy.and.returnValue(cacheFill$);
|
|
216
|
+
|
|
217
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(false);
|
|
218
|
+
spyOn(graph, "initializeCache").and.stub();
|
|
219
|
+
|
|
220
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
221
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(false);
|
|
222
|
+
|
|
223
|
+
let cacheNodeSequence$: Subject<Graph> = new Subject<Graph>();
|
|
224
|
+
spyOn(graph, "cacheNodeSequence$").and.returnValue(cacheNodeSequence$);
|
|
225
|
+
|
|
226
|
+
spyOn(graph, "hasTiles").and.returnValue(false);
|
|
227
|
+
|
|
228
|
+
let cacheTiles$: Subject<Graph> = new Subject<Graph>();
|
|
229
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
230
|
+
|
|
231
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
232
|
+
|
|
233
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
234
|
+
|
|
235
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
236
|
+
let cacheAssetsSpy: jasmine.Spy = spyOn(node, "cacheAssets$");
|
|
237
|
+
cacheAssetsSpy.and.returnValue(cacheAssets$);
|
|
238
|
+
|
|
239
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
240
|
+
|
|
241
|
+
graphService.cacheNode$(node.key)
|
|
242
|
+
.subscribe(
|
|
243
|
+
(n: Node): void => {
|
|
244
|
+
expect(cacheFillSpy.calls.count()).toBe(1);
|
|
245
|
+
|
|
246
|
+
done();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
cacheFill$.next(graph);
|
|
250
|
+
|
|
251
|
+
node.assetsCached = true;
|
|
252
|
+
cacheAssets$.next(node);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("should cache node sequence and sequence edges", () => {
|
|
256
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
257
|
+
spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
258
|
+
|
|
259
|
+
let api: API = new API();
|
|
260
|
+
let graph: Graph = new Graph(api);
|
|
261
|
+
|
|
262
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
263
|
+
spyOn(graph, "hasNode").and.returnValue(false);
|
|
264
|
+
|
|
265
|
+
let cacheFull$: Subject<Graph> = new Subject<Graph>();
|
|
266
|
+
spyOn(graph, "cacheFull$").and.returnValue(cacheFull$);
|
|
267
|
+
|
|
268
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(false);
|
|
269
|
+
spyOn(graph, "initializeCache").and.stub();
|
|
270
|
+
|
|
271
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
272
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(false);
|
|
273
|
+
|
|
274
|
+
let cacheNodeSequence$: Subject<Graph> = new Subject<Graph>();
|
|
275
|
+
let cacheNodeSequenceSpy: jasmine.Spy = spyOn(graph, "cacheNodeSequence$");
|
|
276
|
+
cacheNodeSequenceSpy.and.returnValue(cacheNodeSequence$);
|
|
277
|
+
|
|
278
|
+
let cacheSequenceEdgesSpy: jasmine.Spy = spyOn(graph, "cacheSequenceEdges").and.stub();
|
|
279
|
+
|
|
280
|
+
spyOn(graph, "hasTiles").and.returnValue(false);
|
|
281
|
+
|
|
282
|
+
let cacheTiles$: Subject<Graph> = new Subject<Graph>();
|
|
283
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
284
|
+
|
|
285
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
286
|
+
|
|
287
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
288
|
+
|
|
289
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
290
|
+
spyOn(node, "cacheAssets$").and.returnValue(cacheAssets$);
|
|
291
|
+
|
|
292
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
293
|
+
|
|
294
|
+
graphService.cacheNode$(node.key).subscribe(() => { /*noop*/ });
|
|
295
|
+
|
|
296
|
+
cacheFull$.next(graph);
|
|
297
|
+
|
|
298
|
+
cacheNodeSequence$.next(graph);
|
|
299
|
+
|
|
300
|
+
expect(cacheNodeSequenceSpy.calls.count()).toBe(1);
|
|
301
|
+
expect(cacheNodeSequenceSpy.calls.first().args.length).toBe(1);
|
|
302
|
+
expect(cacheNodeSequenceSpy.calls.first().args[0]).toBe(node.key);
|
|
303
|
+
|
|
304
|
+
expect(cacheSequenceEdgesSpy.calls.count()).toBe(1);
|
|
305
|
+
expect(cacheSequenceEdgesSpy.calls.first().args.length).toBe(1);
|
|
306
|
+
expect(cacheSequenceEdgesSpy.calls.first().args[0]).toBe(node.key);
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
it("should cache spatial edges", () => {
|
|
310
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
311
|
+
spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
312
|
+
|
|
313
|
+
let api: API = new API();
|
|
314
|
+
let graph: Graph = new Graph(api);
|
|
315
|
+
|
|
316
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
317
|
+
spyOn(graph, "hasNode").and.returnValue(false);
|
|
318
|
+
|
|
319
|
+
let cacheFull$: Subject<Graph> = new Subject<Graph>();
|
|
320
|
+
spyOn(graph, "cacheFull$").and.returnValue(cacheFull$);
|
|
321
|
+
|
|
322
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(true);
|
|
323
|
+
|
|
324
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
325
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(true);
|
|
326
|
+
|
|
327
|
+
spyOn(graph, "hasTiles").and.returnValue(true);
|
|
328
|
+
spyOn(graph, "hasSpatialArea").and.returnValue(true);
|
|
329
|
+
|
|
330
|
+
let cacheSpatialEdgesSpy: jasmine.Spy = spyOn(graph, "cacheSpatialEdges").and.stub();
|
|
331
|
+
|
|
332
|
+
let cacheTiles$: Subject<Graph> = new Subject<Graph>();
|
|
333
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
334
|
+
|
|
335
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
336
|
+
|
|
337
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
338
|
+
node.sequenceEdges.cached = true;
|
|
339
|
+
|
|
340
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
341
|
+
spyOn(node, "cacheAssets$").and.returnValue(cacheAssets$);
|
|
342
|
+
|
|
343
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
344
|
+
|
|
345
|
+
graphService.cacheNode$(node.key).subscribe(() => { /*noop*/ });
|
|
346
|
+
|
|
347
|
+
cacheFull$.next(graph);
|
|
348
|
+
|
|
349
|
+
expect(cacheSpatialEdgesSpy.calls.count()).toBe(1);
|
|
350
|
+
expect(cacheSpatialEdgesSpy.calls.first().args.length).toBe(1);
|
|
351
|
+
expect(cacheSpatialEdgesSpy.calls.first().args[0]).toBe(node.key);
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
describe("GraphService.reset$", () => {
|
|
356
|
+
let helper: NodeHelper;
|
|
357
|
+
|
|
358
|
+
beforeEach(() => {
|
|
359
|
+
helper = new NodeHelper();
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
it("should abort node caching and throw", () => {
|
|
363
|
+
spyOn(console, "error").and.stub();
|
|
364
|
+
|
|
365
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
366
|
+
spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
367
|
+
|
|
368
|
+
let api: API = new API();
|
|
369
|
+
let graph: Graph = new Graph(api);
|
|
370
|
+
|
|
371
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
372
|
+
spyOn(graph, "hasNode").and.returnValue(false);
|
|
373
|
+
|
|
374
|
+
let cacheFull$: Subject<Graph> = new Subject<Graph>();
|
|
375
|
+
let cacheFullSpy: jasmine.Spy = spyOn(graph, "cacheFull$");
|
|
376
|
+
cacheFullSpy.and.returnValue(cacheFull$);
|
|
377
|
+
|
|
378
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(false);
|
|
379
|
+
let initializeCacheSpy: jasmine.Spy = spyOn(graph, "initializeCache").and.stub();
|
|
380
|
+
|
|
381
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
382
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(false);
|
|
383
|
+
|
|
384
|
+
let cacheNodeSequence$: Subject<Graph> = new Subject<Graph>();
|
|
385
|
+
spyOn(graph, "cacheNodeSequence$").and.returnValue(cacheNodeSequence$);
|
|
386
|
+
|
|
387
|
+
spyOn(graph, "hasTiles").and.returnValue(false);
|
|
388
|
+
|
|
389
|
+
let cacheTiles$: Subject<Graph> = new Subject<Graph>();
|
|
390
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
391
|
+
|
|
392
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
393
|
+
|
|
394
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
395
|
+
|
|
396
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
397
|
+
let cacheAssetsSpy: jasmine.Spy = spyOn(node, "cacheAssets$");
|
|
398
|
+
cacheAssetsSpy.and.returnValue(cacheAssets$);
|
|
399
|
+
|
|
400
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
401
|
+
|
|
402
|
+
graphService.cacheNode$(node.key)
|
|
403
|
+
.subscribe(
|
|
404
|
+
(n: Node): void => { return; },
|
|
405
|
+
(e: Error): void => {
|
|
406
|
+
expect(e).toBeDefined();
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
graphService.reset$([]);
|
|
410
|
+
|
|
411
|
+
cacheFull$.next(graph);
|
|
412
|
+
|
|
413
|
+
node.assetsCached = true;
|
|
414
|
+
cacheAssets$.next(node);
|
|
415
|
+
|
|
416
|
+
expect(cacheFullSpy.calls.count()).toBe(1);
|
|
417
|
+
expect(initializeCacheSpy.calls.count()).toBe(0);
|
|
418
|
+
expect(cacheAssetsSpy.calls.count()).toBe(0);
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
it("should cancel sequence edge caching", () => {
|
|
422
|
+
spyOn(console, "error").and.stub();
|
|
423
|
+
|
|
424
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
425
|
+
spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
426
|
+
|
|
427
|
+
let api: API = new API();
|
|
428
|
+
let graph: Graph = new Graph(api);
|
|
429
|
+
|
|
430
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
431
|
+
spyOn(graph, "hasNode").and.returnValue(false);
|
|
432
|
+
|
|
433
|
+
let cacheFull$: Subject<Graph> = new Subject<Graph>();
|
|
434
|
+
let cacheFullSpy: jasmine.Spy = spyOn(graph, "cacheFull$");
|
|
435
|
+
cacheFullSpy.and.returnValue(cacheFull$);
|
|
436
|
+
|
|
437
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(false);
|
|
438
|
+
spyOn(graph, "initializeCache").and.stub();
|
|
439
|
+
|
|
440
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
441
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(false);
|
|
442
|
+
|
|
443
|
+
let cacheNodeSequence$: Subject<Graph> = new Subject<Graph>();
|
|
444
|
+
spyOn(graph, "cacheNodeSequence$").and.returnValue(cacheNodeSequence$);
|
|
445
|
+
|
|
446
|
+
let cacheSequenceEdgesSpy: jasmine.Spy = spyOn(graph, "cacheSequenceEdges").and.stub();
|
|
447
|
+
|
|
448
|
+
spyOn(graph, "hasTiles").and.returnValue(false);
|
|
449
|
+
|
|
450
|
+
let cacheTiles$: Subject<Graph> = new Subject<Graph>();
|
|
451
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
452
|
+
|
|
453
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
454
|
+
|
|
455
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
456
|
+
node.spatialEdges.cached = false;
|
|
457
|
+
|
|
458
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
459
|
+
let cacheAssetsSpy: jasmine.Spy = spyOn(node, "cacheAssets$");
|
|
460
|
+
cacheAssetsSpy.and.returnValue(cacheAssets$);
|
|
461
|
+
|
|
462
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
463
|
+
|
|
464
|
+
graphService.cacheNode$(node.key)
|
|
465
|
+
.subscribe(
|
|
466
|
+
(n: Node): void => {
|
|
467
|
+
expect(n).toBeDefined();
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
cacheFull$.next(graph);
|
|
471
|
+
|
|
472
|
+
node.assetsCached = true;
|
|
473
|
+
cacheAssets$.next(node);
|
|
474
|
+
|
|
475
|
+
graphService.reset$([]);
|
|
476
|
+
|
|
477
|
+
cacheNodeSequence$.next(graph);
|
|
478
|
+
|
|
479
|
+
expect(cacheSequenceEdgesSpy.calls.count()).toBe(0);
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
it("should cancel spatial edge caching", () => {
|
|
483
|
+
spyOn(console, "error").and.stub();
|
|
484
|
+
|
|
485
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
486
|
+
spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
487
|
+
|
|
488
|
+
let api: API = new API();
|
|
489
|
+
let graph: Graph = new Graph(api);
|
|
490
|
+
|
|
491
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
492
|
+
spyOn(graph, "hasNode").and.returnValue(false);
|
|
493
|
+
|
|
494
|
+
let cacheFull$: Subject<Graph> = new Subject<Graph>();
|
|
495
|
+
let cacheFullSpy: jasmine.Spy = spyOn(graph, "cacheFull$");
|
|
496
|
+
cacheFullSpy.and.returnValue(cacheFull$);
|
|
497
|
+
|
|
498
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(false);
|
|
499
|
+
spyOn(graph, "initializeCache").and.stub();
|
|
500
|
+
|
|
501
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
502
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(false);
|
|
503
|
+
|
|
504
|
+
let cacheNodeSequence$: Subject<Graph> = new Subject<Graph>();
|
|
505
|
+
spyOn(graph, "cacheNodeSequence$").and.returnValue(cacheNodeSequence$);
|
|
506
|
+
|
|
507
|
+
spyOn(graph, "hasTiles").and.returnValue(false);
|
|
508
|
+
|
|
509
|
+
let cacheTiles$: Subject<Observable<Graph>[]> = new Subject<Observable<Graph>[]>();
|
|
510
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
511
|
+
|
|
512
|
+
let hasSpatialAreaSpy: jasmine.Spy = spyOn(graph, "hasSpatialArea").and.stub();
|
|
513
|
+
|
|
514
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
515
|
+
|
|
516
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
517
|
+
node.spatialEdges.cached = false;
|
|
518
|
+
|
|
519
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
520
|
+
let cacheAssetsSpy: jasmine.Spy = spyOn(node, "cacheAssets$");
|
|
521
|
+
cacheAssetsSpy.and.returnValue(cacheAssets$);
|
|
522
|
+
|
|
523
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
524
|
+
|
|
525
|
+
graphService.cacheNode$(node.key)
|
|
526
|
+
.subscribe(
|
|
527
|
+
(n: Node): void => {
|
|
528
|
+
expect(n).toBeDefined();
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
cacheFull$.next(graph);
|
|
532
|
+
|
|
533
|
+
node.assetsCached = true;
|
|
534
|
+
cacheAssets$.next(node);
|
|
535
|
+
|
|
536
|
+
graphService.reset$([]);
|
|
537
|
+
|
|
538
|
+
cacheTiles$.next([Observable.of<Graph>(graph)]);
|
|
539
|
+
|
|
540
|
+
expect(hasSpatialAreaSpy.calls.count()).toBe(0);
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
describe("GraphService.setFilter$", () => {
|
|
545
|
+
let helper: NodeHelper;
|
|
546
|
+
|
|
547
|
+
beforeEach(() => {
|
|
548
|
+
helper = new NodeHelper();
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
it("should reset spatial edges and set filter", () => {
|
|
552
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
553
|
+
|
|
554
|
+
let api: API = new API();
|
|
555
|
+
let graph: Graph = new Graph(api);
|
|
556
|
+
|
|
557
|
+
let resetSpatialEdgesSpy: jasmine.Spy = spyOn(graph, "resetSpatialEdges").and.stub();
|
|
558
|
+
let setFilterSpy: jasmine.Spy = spyOn(graph, "setFilter").and.stub();
|
|
559
|
+
|
|
560
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
561
|
+
|
|
562
|
+
graphService.setFilter$(["==", "sequenceKey", "skey"]).subscribe(() => { /*noop*/ });
|
|
563
|
+
|
|
564
|
+
expect(resetSpatialEdgesSpy.calls.count()).toBe(1);
|
|
565
|
+
|
|
566
|
+
expect(setFilterSpy.calls.count()).toBe(1);
|
|
567
|
+
expect(setFilterSpy.calls.first().args.length).toBe(1);
|
|
568
|
+
expect(setFilterSpy.calls.first().args[0].length).toBe(3);
|
|
569
|
+
expect(setFilterSpy.calls.first().args[0][0]).toBe("==");
|
|
570
|
+
expect(setFilterSpy.calls.first().args[0][1]).toBe("sequenceKey");
|
|
571
|
+
expect(setFilterSpy.calls.first().args[0][2]).toBe("skey");
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
it("should cancel spatial subscriptions", () => {
|
|
575
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
576
|
+
spyOn(imageLoadingService.loadnode$, "next").and.stub();
|
|
577
|
+
|
|
578
|
+
let api: API = new API();
|
|
579
|
+
let graph: Graph = new Graph(api);
|
|
580
|
+
|
|
581
|
+
spyOn(graph, "isCachingFull").and.returnValue(false);
|
|
582
|
+
spyOn(graph, "hasNode").and.returnValue(false);
|
|
583
|
+
|
|
584
|
+
let cacheFull$: Subject<Graph> = new Subject<Graph>();
|
|
585
|
+
let cacheFullSpy: jasmine.Spy = spyOn(graph, "cacheFull$");
|
|
586
|
+
cacheFullSpy.and.returnValue(cacheFull$);
|
|
587
|
+
|
|
588
|
+
spyOn(graph, "hasInitializedCache").and.returnValue(false);
|
|
589
|
+
spyOn(graph, "initializeCache").and.stub();
|
|
590
|
+
|
|
591
|
+
spyOn(graph, "isCachingNodeSequence").and.returnValue(false);
|
|
592
|
+
spyOn(graph, "hasNodeSequence").and.returnValue(false);
|
|
593
|
+
|
|
594
|
+
let cacheNodeSequence$: Subject<Graph> = new Subject<Graph>();
|
|
595
|
+
spyOn(graph, "cacheNodeSequence$").and.returnValue(cacheNodeSequence$);
|
|
596
|
+
|
|
597
|
+
spyOn(graph, "hasTiles").and.returnValue(false);
|
|
598
|
+
|
|
599
|
+
let cacheTiles$: Subject<Observable<Graph>[]> = new Subject<Observable<Graph>[]>();
|
|
600
|
+
spyOn(graph, "cacheTiles$").and.returnValue(cacheTiles$);
|
|
601
|
+
|
|
602
|
+
let hasSpatialAreaSpy: jasmine.Spy = spyOn(graph, "hasSpatialArea").and.stub();
|
|
603
|
+
|
|
604
|
+
spyOn(graph, "resetSpatialEdges").and.stub();
|
|
605
|
+
spyOn(graph, "setFilter").and.stub();
|
|
606
|
+
|
|
607
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
608
|
+
|
|
609
|
+
let node: TestNode = new TestNode(helper.createCoreNode());
|
|
610
|
+
node.spatialEdges.cached = false;
|
|
611
|
+
|
|
612
|
+
let cacheAssets$: Subject<Node> = new Subject<Node>();
|
|
613
|
+
let cacheAssetsSpy: jasmine.Spy = spyOn(node, "cacheAssets$");
|
|
614
|
+
cacheAssetsSpy.and.returnValue(cacheAssets$);
|
|
615
|
+
|
|
616
|
+
spyOn(graph, "getNode").and.returnValue(node);
|
|
617
|
+
|
|
618
|
+
graphService.cacheNode$(node.key)
|
|
619
|
+
.subscribe(
|
|
620
|
+
(n: Node): void => {
|
|
621
|
+
expect(n).toBeDefined();
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
cacheFull$.next(graph);
|
|
625
|
+
|
|
626
|
+
node.assetsCached = true;
|
|
627
|
+
cacheAssets$.next(node);
|
|
628
|
+
|
|
629
|
+
graphService.setFilter$(["==", "sequenceKey", "skey"]).subscribe(() => { /*noop*/ });
|
|
630
|
+
|
|
631
|
+
cacheTiles$.next([Observable.of<Graph>(graph)]);
|
|
632
|
+
|
|
633
|
+
expect(hasSpatialAreaSpy.calls.count()).toBe(0);
|
|
634
|
+
});
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
describe("GraphService.uncache$", () => {
|
|
638
|
+
let helper: NodeHelper;
|
|
639
|
+
|
|
640
|
+
beforeEach(() => {
|
|
641
|
+
helper = new NodeHelper();
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
it("should reset spatial edges and set filter", () => {
|
|
645
|
+
let imageLoadingService: ImageLoadingService = new ImageLoadingService();
|
|
646
|
+
|
|
647
|
+
let api: API = new API();
|
|
648
|
+
let graph: Graph = new Graph(api);
|
|
649
|
+
|
|
650
|
+
let uncacheSpy: jasmine.Spy = spyOn(graph, "uncache").and.stub();
|
|
651
|
+
|
|
652
|
+
let graphService: GraphService = new GraphService(graph, imageLoadingService);
|
|
653
|
+
|
|
654
|
+
graphService.uncache$(["nKey"]).subscribe(() => { /*noop*/ });
|
|
655
|
+
|
|
656
|
+
expect(uncacheSpy.calls.count()).toBe(1);
|
|
657
|
+
|
|
658
|
+
expect(uncacheSpy.calls.count()).toBe(1);
|
|
659
|
+
expect(uncacheSpy.calls.first().args.length).toBe(1);
|
|
660
|
+
expect(uncacheSpy.calls.first().args[0].length).toBe(1);
|
|
661
|
+
expect(uncacheSpy.calls.first().args[0][0]).toBe("nKey");
|
|
662
|
+
});
|
|
663
|
+
});
|