@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,233 @@
|
|
|
1
|
+
import * as vd from "virtual-dom";
|
|
2
|
+
import { Observable, Subscription, combineLatest, of } from "rxjs";
|
|
3
|
+
import type { IEdge } from "../graph/edge/interfaces/interfaces";
|
|
4
|
+
import { EdgeDirection } from "../graph/edge/EdgeDirection";
|
|
5
|
+
import type { IEdgeStatus } from "../graph/interfaces/interfaces";
|
|
6
|
+
import { Node } from "../graph/Node";
|
|
7
|
+
import { Container } from "../viewer/Container";
|
|
8
|
+
import { Navigator } from "../viewer/Navigator";
|
|
9
|
+
import type {
|
|
10
|
+
IComponentConfiguration,
|
|
11
|
+
INavigationConfiguration,
|
|
12
|
+
} from "./interfaces/interfaces";
|
|
13
|
+
import { Component } from "./Component";
|
|
14
|
+
import { ComponentService } from "./ComponentService";
|
|
15
|
+
import type { IVNodeHash } from "../render/interfaces/interfaces";
|
|
16
|
+
import { map, switchMap } from "rxjs/operators";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @class NavigationComponent
|
|
20
|
+
*
|
|
21
|
+
* @classdesc Fallback navigation component for environments without WebGL support.
|
|
22
|
+
*
|
|
23
|
+
* Replaces the functionality in the Direction and Sequence components.
|
|
24
|
+
*/
|
|
25
|
+
export class NavigationComponent extends Component<IComponentConfiguration> {
|
|
26
|
+
public static componentName: string = "navigation";
|
|
27
|
+
|
|
28
|
+
private _renderSubscription: Subscription;
|
|
29
|
+
|
|
30
|
+
private _seqNames: { [dir: string]: string };
|
|
31
|
+
private _spaTopNames: { [dir: string]: string };
|
|
32
|
+
private _spaBottomNames: { [dir: string]: string };
|
|
33
|
+
|
|
34
|
+
constructor(name: string, container: Container, navigator: Navigator) {
|
|
35
|
+
super(name, container, navigator);
|
|
36
|
+
|
|
37
|
+
this._seqNames = {};
|
|
38
|
+
this._seqNames[EdgeDirection[EdgeDirection.Prev]] = "Prev";
|
|
39
|
+
this._seqNames[EdgeDirection[EdgeDirection.Next]] = "Next";
|
|
40
|
+
|
|
41
|
+
this._spaTopNames = {};
|
|
42
|
+
this._spaTopNames[EdgeDirection[EdgeDirection.TurnLeft]] = "Turnleft";
|
|
43
|
+
this._spaTopNames[EdgeDirection[EdgeDirection.StepLeft]] = "Left";
|
|
44
|
+
this._spaTopNames[EdgeDirection[EdgeDirection.StepForward]] = "Forward";
|
|
45
|
+
this._spaTopNames[EdgeDirection[EdgeDirection.StepRight]] = "Right";
|
|
46
|
+
this._spaTopNames[EdgeDirection[EdgeDirection.TurnRight]] = "Turnright";
|
|
47
|
+
|
|
48
|
+
this._spaBottomNames = {};
|
|
49
|
+
this._spaBottomNames[EdgeDirection[EdgeDirection.TurnU]] = "Turnaround";
|
|
50
|
+
this._spaBottomNames[EdgeDirection[EdgeDirection.StepBackward]] =
|
|
51
|
+
"Backward";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
protected _activate(): void {
|
|
55
|
+
this._renderSubscription = combineLatest(
|
|
56
|
+
this._navigator.stateService.currentNode$,
|
|
57
|
+
this._configuration$,
|
|
58
|
+
)
|
|
59
|
+
.pipe(
|
|
60
|
+
switchMap(
|
|
61
|
+
([node, configuration]: [
|
|
62
|
+
Node,
|
|
63
|
+
INavigationConfiguration,
|
|
64
|
+
]): Observable<EdgeDirection[]> => {
|
|
65
|
+
const sequenceEdges$: Observable<EdgeDirection[]> =
|
|
66
|
+
configuration.sequence
|
|
67
|
+
? node.sequenceEdges$.pipe(
|
|
68
|
+
map(
|
|
69
|
+
(
|
|
70
|
+
status: IEdgeStatus,
|
|
71
|
+
): EdgeDirection[] => {
|
|
72
|
+
return status.edges.map(
|
|
73
|
+
(
|
|
74
|
+
edge: IEdge,
|
|
75
|
+
): EdgeDirection => {
|
|
76
|
+
return edge.data
|
|
77
|
+
.direction;
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
: of<EdgeDirection[]>([]);
|
|
84
|
+
|
|
85
|
+
const spatialEdges$: Observable<EdgeDirection[]> =
|
|
86
|
+
!node.pano && configuration.spatial
|
|
87
|
+
? node.spatialEdges$.pipe(
|
|
88
|
+
map(
|
|
89
|
+
(
|
|
90
|
+
status: IEdgeStatus,
|
|
91
|
+
): EdgeDirection[] => {
|
|
92
|
+
return status.edges.map(
|
|
93
|
+
(
|
|
94
|
+
edge: IEdge,
|
|
95
|
+
): EdgeDirection => {
|
|
96
|
+
return edge.data
|
|
97
|
+
.direction;
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
},
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
: of<EdgeDirection[]>([]);
|
|
104
|
+
|
|
105
|
+
return combineLatest(
|
|
106
|
+
sequenceEdges$,
|
|
107
|
+
spatialEdges$,
|
|
108
|
+
).pipe(
|
|
109
|
+
map(
|
|
110
|
+
([seq, spa]: [
|
|
111
|
+
EdgeDirection[],
|
|
112
|
+
EdgeDirection[],
|
|
113
|
+
]): EdgeDirection[] => {
|
|
114
|
+
return seq.concat(spa);
|
|
115
|
+
},
|
|
116
|
+
),
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
),
|
|
120
|
+
map((edgeDirections: EdgeDirection[]): IVNodeHash => {
|
|
121
|
+
const seqs: vd.VNode[] = this._createArrowRow(
|
|
122
|
+
this._seqNames,
|
|
123
|
+
edgeDirections,
|
|
124
|
+
);
|
|
125
|
+
const spaTops: vd.VNode[] = this._createArrowRow(
|
|
126
|
+
this._spaTopNames,
|
|
127
|
+
edgeDirections,
|
|
128
|
+
);
|
|
129
|
+
const spaBottoms: vd.VNode[] = this._createArrowRow(
|
|
130
|
+
this._spaBottomNames,
|
|
131
|
+
edgeDirections,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const seqContainer: vd.VNode = vd.h(
|
|
135
|
+
`div.NavigationSequence`,
|
|
136
|
+
seqs,
|
|
137
|
+
);
|
|
138
|
+
const spaTopContainer: vd.VNode = vd.h(
|
|
139
|
+
`div.NavigationSpatialTop`,
|
|
140
|
+
spaTops,
|
|
141
|
+
);
|
|
142
|
+
const spaBottomContainer: vd.VNode = vd.h(
|
|
143
|
+
`div.NavigationSpatialBottom`,
|
|
144
|
+
spaBottoms,
|
|
145
|
+
);
|
|
146
|
+
const spaContainer: vd.VNode = vd.h(
|
|
147
|
+
`div.NavigationSpatial`,
|
|
148
|
+
[spaTopContainer, spaBottomContainer],
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
name: this._name,
|
|
153
|
+
vnode: vd.h(`div.NavigationContainer`, [
|
|
154
|
+
seqContainer,
|
|
155
|
+
spaContainer,
|
|
156
|
+
]),
|
|
157
|
+
};
|
|
158
|
+
}),
|
|
159
|
+
)
|
|
160
|
+
.subscribe(this._container.domRenderer.render$);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
protected _deactivate(): void {
|
|
164
|
+
this._renderSubscription.unsubscribe();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
protected _getDefaultConfiguration(): INavigationConfiguration {
|
|
168
|
+
return { sequence: true, spatial: true };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
private _createArrowRow(
|
|
172
|
+
arrowNames: { [dir: string]: string },
|
|
173
|
+
edgeDirections: EdgeDirection[],
|
|
174
|
+
): vd.VNode[] {
|
|
175
|
+
const arrows: vd.VNode[] = [];
|
|
176
|
+
|
|
177
|
+
for (const arrowName in arrowNames) {
|
|
178
|
+
if (!arrowNames.hasOwnProperty(arrowName)) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const direction: EdgeDirection =
|
|
183
|
+
EdgeDirection[<keyof typeof EdgeDirection>arrowName];
|
|
184
|
+
if (edgeDirections.indexOf(direction) !== -1) {
|
|
185
|
+
arrows.push(
|
|
186
|
+
this._createVNode(
|
|
187
|
+
direction,
|
|
188
|
+
arrowNames[arrowName],
|
|
189
|
+
"visible",
|
|
190
|
+
),
|
|
191
|
+
);
|
|
192
|
+
} else {
|
|
193
|
+
arrows.push(
|
|
194
|
+
this._createVNode(
|
|
195
|
+
direction,
|
|
196
|
+
arrowNames[arrowName],
|
|
197
|
+
"hidden",
|
|
198
|
+
),
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return arrows;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private _createVNode(
|
|
207
|
+
direction: EdgeDirection,
|
|
208
|
+
name: string,
|
|
209
|
+
visibility: string,
|
|
210
|
+
): vd.VNode {
|
|
211
|
+
return vd.h(
|
|
212
|
+
`span.Direction.Direction${name}`,
|
|
213
|
+
{
|
|
214
|
+
onclick: (ev: Event): void => {
|
|
215
|
+
this._navigator.moveDir$(direction).subscribe(
|
|
216
|
+
(node: Node): void => {
|
|
217
|
+
return;
|
|
218
|
+
},
|
|
219
|
+
(error: Error): void => {
|
|
220
|
+
console.error(error);
|
|
221
|
+
},
|
|
222
|
+
);
|
|
223
|
+
},
|
|
224
|
+
style: {
|
|
225
|
+
visibility: visibility,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
[],
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export default NavigationComponent;
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import * as _ from "underscore";
|
|
2
|
+
import * as vd from "virtual-dom";
|
|
3
|
+
import { Observable, Subscription, from, of } from "rxjs";
|
|
4
|
+
import type { ISequence } from "../api/interfaces/ISequence";
|
|
5
|
+
import type {
|
|
6
|
+
IRouteConfiguration,
|
|
7
|
+
IRoutePath,
|
|
8
|
+
} from "../component/interfaces/interfaces";
|
|
9
|
+
import { ComponentService } from "../component/ComponentService";
|
|
10
|
+
import { Component } from "../component/Component";
|
|
11
|
+
import { Node } from "../graph/Node";
|
|
12
|
+
import type { IVNodeHash } from "../render/interfaces/interfaces";
|
|
13
|
+
import type { IFrame } from "../state/interfaces/interfaces";
|
|
14
|
+
import { Container } from "../viewer/Container";
|
|
15
|
+
import { Navigator } from "../viewer/Navigator";
|
|
16
|
+
import {
|
|
17
|
+
filter,
|
|
18
|
+
distinctUntilChanged,
|
|
19
|
+
mergeMap,
|
|
20
|
+
distinct,
|
|
21
|
+
map,
|
|
22
|
+
combineLatest,
|
|
23
|
+
scan,
|
|
24
|
+
pluck,
|
|
25
|
+
} from "rxjs/operators";
|
|
26
|
+
|
|
27
|
+
interface IRtAndFrame {
|
|
28
|
+
routeTrack: RouteTrack;
|
|
29
|
+
frame: IFrame;
|
|
30
|
+
conf: IRouteConfiguration;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface IConfAndNode {
|
|
34
|
+
conf: IRouteConfiguration;
|
|
35
|
+
node: Node;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface INodeInstruction {
|
|
39
|
+
key: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface IInstructionPlace {
|
|
44
|
+
place: number;
|
|
45
|
+
nodeInstructions: INodeInstruction[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
class DescriptionState {
|
|
49
|
+
public description: string;
|
|
50
|
+
public showsLeft: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
class RouteState {
|
|
54
|
+
public routeTrack: RouteTrack;
|
|
55
|
+
public currentNode: Node;
|
|
56
|
+
public lastNode: Node;
|
|
57
|
+
public playing: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class RouteTrack {
|
|
61
|
+
public nodeInstructions: INodeInstruction[] = [];
|
|
62
|
+
public nodeInstructionsOrdered: INodeInstruction[][] = [];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class RouteComponent extends Component<IRouteConfiguration> {
|
|
66
|
+
public static componentName: string = "route";
|
|
67
|
+
|
|
68
|
+
private _disposable: Subscription;
|
|
69
|
+
private _disposableDescription: Subscription;
|
|
70
|
+
|
|
71
|
+
constructor(name: string, container: Container, navigator: Navigator) {
|
|
72
|
+
super(name, container, navigator);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public play(): void {
|
|
76
|
+
this.configure({ playing: true });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public stop(): void {
|
|
80
|
+
this.configure({ playing: false });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
protected _activate(): void {
|
|
84
|
+
let _slowedStream$: Observable<IFrame>;
|
|
85
|
+
|
|
86
|
+
_slowedStream$ = this._navigator.stateService.currentState$.pipe(
|
|
87
|
+
filter((frame: IFrame) => {
|
|
88
|
+
return frame.id % 2 === 0;
|
|
89
|
+
}),
|
|
90
|
+
filter((frame: IFrame) => {
|
|
91
|
+
return frame.state.nodesAhead < 15;
|
|
92
|
+
}),
|
|
93
|
+
distinctUntilChanged(undefined, (frame: IFrame): string => {
|
|
94
|
+
return frame.state.lastNode.key;
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
let _routeTrack$: Observable<RouteTrack>;
|
|
99
|
+
|
|
100
|
+
_routeTrack$ = this.configuration$.pipe(
|
|
101
|
+
mergeMap((conf: IRouteConfiguration): Observable<IRoutePath> => {
|
|
102
|
+
return from(conf.paths);
|
|
103
|
+
}),
|
|
104
|
+
distinct((p: IRoutePath): string => {
|
|
105
|
+
return p.sequenceKey;
|
|
106
|
+
}),
|
|
107
|
+
mergeMap((path: IRoutePath): Observable<ISequence> => {
|
|
108
|
+
return this._navigator.api
|
|
109
|
+
.sequenceByKey$([path.sequenceKey])
|
|
110
|
+
.pipe(
|
|
111
|
+
map(
|
|
112
|
+
(sequenceByKey: {
|
|
113
|
+
[sequenceKey: string]: ISequence;
|
|
114
|
+
}): ISequence => {
|
|
115
|
+
return sequenceByKey[path.sequenceKey];
|
|
116
|
+
},
|
|
117
|
+
),
|
|
118
|
+
);
|
|
119
|
+
}),
|
|
120
|
+
combineLatest(
|
|
121
|
+
this.configuration$,
|
|
122
|
+
(
|
|
123
|
+
sequence: ISequence,
|
|
124
|
+
conf: IRouteConfiguration,
|
|
125
|
+
): IInstructionPlace[] => {
|
|
126
|
+
let i: number = 0;
|
|
127
|
+
let instructionPlaces: IInstructionPlace[] = [];
|
|
128
|
+
for (let path of conf.paths) {
|
|
129
|
+
if (path.sequenceKey === sequence.key) {
|
|
130
|
+
let nodeInstructions: INodeInstruction[] = [];
|
|
131
|
+
let saveKey: boolean = false;
|
|
132
|
+
for (let key of sequence.keys) {
|
|
133
|
+
if (path.startKey === key) {
|
|
134
|
+
saveKey = true;
|
|
135
|
+
}
|
|
136
|
+
if (saveKey) {
|
|
137
|
+
let description: string = null;
|
|
138
|
+
for (let infoKey of path.infoKeys) {
|
|
139
|
+
if (infoKey.key === key) {
|
|
140
|
+
description = infoKey.description;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
nodeInstructions.push({
|
|
144
|
+
description: description,
|
|
145
|
+
key: key,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (path.stopKey === key) {
|
|
149
|
+
saveKey = false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
instructionPlaces.push({
|
|
153
|
+
nodeInstructions: nodeInstructions,
|
|
154
|
+
place: i,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
i++;
|
|
158
|
+
}
|
|
159
|
+
return instructionPlaces;
|
|
160
|
+
},
|
|
161
|
+
),
|
|
162
|
+
scan(
|
|
163
|
+
(
|
|
164
|
+
routeTrack: RouteTrack,
|
|
165
|
+
instructionPlaces: IInstructionPlace[],
|
|
166
|
+
): RouteTrack => {
|
|
167
|
+
for (let instructionPlace of instructionPlaces) {
|
|
168
|
+
routeTrack.nodeInstructionsOrdered[
|
|
169
|
+
instructionPlace.place
|
|
170
|
+
] = instructionPlace.nodeInstructions;
|
|
171
|
+
}
|
|
172
|
+
routeTrack.nodeInstructions = _.flatten(
|
|
173
|
+
routeTrack.nodeInstructionsOrdered,
|
|
174
|
+
);
|
|
175
|
+
return routeTrack;
|
|
176
|
+
},
|
|
177
|
+
new RouteTrack(),
|
|
178
|
+
),
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
this._disposable = _slowedStream$
|
|
182
|
+
.pipe(
|
|
183
|
+
combineLatest(
|
|
184
|
+
_routeTrack$,
|
|
185
|
+
this.configuration$,
|
|
186
|
+
(
|
|
187
|
+
frame: IFrame,
|
|
188
|
+
routeTrack: RouteTrack,
|
|
189
|
+
conf: IRouteConfiguration,
|
|
190
|
+
): IRtAndFrame => {
|
|
191
|
+
return {
|
|
192
|
+
conf: conf,
|
|
193
|
+
frame: frame,
|
|
194
|
+
routeTrack: routeTrack,
|
|
195
|
+
};
|
|
196
|
+
},
|
|
197
|
+
),
|
|
198
|
+
scan(
|
|
199
|
+
(
|
|
200
|
+
routeState: RouteState,
|
|
201
|
+
rtAndFrame: IRtAndFrame,
|
|
202
|
+
): RouteState => {
|
|
203
|
+
if (
|
|
204
|
+
rtAndFrame.conf.playing === undefined ||
|
|
205
|
+
rtAndFrame.conf.playing
|
|
206
|
+
) {
|
|
207
|
+
routeState.routeTrack = rtAndFrame.routeTrack;
|
|
208
|
+
routeState.currentNode =
|
|
209
|
+
rtAndFrame.frame.state.currentNode;
|
|
210
|
+
routeState.lastNode =
|
|
211
|
+
rtAndFrame.frame.state.lastNode;
|
|
212
|
+
routeState.playing = true;
|
|
213
|
+
} else {
|
|
214
|
+
this._navigator.stateService.cutNodes();
|
|
215
|
+
routeState.playing = false;
|
|
216
|
+
}
|
|
217
|
+
return routeState;
|
|
218
|
+
},
|
|
219
|
+
new RouteState(),
|
|
220
|
+
),
|
|
221
|
+
filter((routeState: RouteState): boolean => {
|
|
222
|
+
return routeState.playing;
|
|
223
|
+
}),
|
|
224
|
+
filter((routeState: RouteState): boolean => {
|
|
225
|
+
for (let nodeInstruction of routeState.routeTrack
|
|
226
|
+
.nodeInstructions) {
|
|
227
|
+
if (!nodeInstruction) {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (nodeInstruction.key === routeState.lastNode.key) {
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return false;
|
|
235
|
+
}),
|
|
236
|
+
distinctUntilChanged(
|
|
237
|
+
undefined,
|
|
238
|
+
(routeState: RouteState): string => {
|
|
239
|
+
return routeState.lastNode.key;
|
|
240
|
+
},
|
|
241
|
+
),
|
|
242
|
+
mergeMap((routeState: RouteState): Observable<Node> => {
|
|
243
|
+
let i: number = 0;
|
|
244
|
+
for (let nodeInstruction of routeState.routeTrack
|
|
245
|
+
.nodeInstructions) {
|
|
246
|
+
if (nodeInstruction.key === routeState.lastNode.key) {
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
i++;
|
|
250
|
+
}
|
|
251
|
+
let nextInstruction: INodeInstruction =
|
|
252
|
+
routeState.routeTrack.nodeInstructions[i + 1];
|
|
253
|
+
if (!nextInstruction) {
|
|
254
|
+
return of<Node>(null);
|
|
255
|
+
}
|
|
256
|
+
return this._navigator.graphService.cacheNode$(
|
|
257
|
+
nextInstruction.key,
|
|
258
|
+
);
|
|
259
|
+
}),
|
|
260
|
+
combineLatest(
|
|
261
|
+
this.configuration$,
|
|
262
|
+
(node: Node, conf: IRouteConfiguration): IConfAndNode => {
|
|
263
|
+
return { conf: conf, node: node };
|
|
264
|
+
},
|
|
265
|
+
),
|
|
266
|
+
filter((cAN: IConfAndNode) => {
|
|
267
|
+
return cAN.node !== null && cAN.conf.playing;
|
|
268
|
+
}),
|
|
269
|
+
pluck<IConfAndNode, Node>("node"),
|
|
270
|
+
)
|
|
271
|
+
.subscribe(this._navigator.stateService.appendNode$);
|
|
272
|
+
|
|
273
|
+
this._disposableDescription = this._navigator.stateService.currentNode$
|
|
274
|
+
.pipe(
|
|
275
|
+
combineLatest(
|
|
276
|
+
_routeTrack$,
|
|
277
|
+
this.configuration$,
|
|
278
|
+
(
|
|
279
|
+
node: Node,
|
|
280
|
+
routeTrack: RouteTrack,
|
|
281
|
+
conf: IRouteConfiguration,
|
|
282
|
+
): string => {
|
|
283
|
+
if (conf.playing !== undefined && !conf.playing) {
|
|
284
|
+
return "quit";
|
|
285
|
+
}
|
|
286
|
+
let description: string = null;
|
|
287
|
+
for (let nodeInstruction of routeTrack.nodeInstructions) {
|
|
288
|
+
if (nodeInstruction.key === node.key) {
|
|
289
|
+
description = nodeInstruction.description;
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return description;
|
|
294
|
+
},
|
|
295
|
+
),
|
|
296
|
+
scan(
|
|
297
|
+
(
|
|
298
|
+
descriptionState: DescriptionState,
|
|
299
|
+
description: string,
|
|
300
|
+
): DescriptionState => {
|
|
301
|
+
if (
|
|
302
|
+
description !== descriptionState.description &&
|
|
303
|
+
description !== null
|
|
304
|
+
) {
|
|
305
|
+
descriptionState.description = description;
|
|
306
|
+
descriptionState.showsLeft = 6;
|
|
307
|
+
} else {
|
|
308
|
+
descriptionState.showsLeft--;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (description === "quit") {
|
|
312
|
+
descriptionState.description = null;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return descriptionState;
|
|
316
|
+
},
|
|
317
|
+
new DescriptionState(),
|
|
318
|
+
),
|
|
319
|
+
map((descriptionState: DescriptionState): IVNodeHash => {
|
|
320
|
+
if (
|
|
321
|
+
descriptionState.showsLeft > 0 &&
|
|
322
|
+
descriptionState.description
|
|
323
|
+
) {
|
|
324
|
+
return {
|
|
325
|
+
name: this._name,
|
|
326
|
+
vnode: this._getRouteAnnotationNode(
|
|
327
|
+
descriptionState.description,
|
|
328
|
+
),
|
|
329
|
+
};
|
|
330
|
+
} else {
|
|
331
|
+
return { name: this._name, vnode: vd.h("div", []) };
|
|
332
|
+
}
|
|
333
|
+
}),
|
|
334
|
+
)
|
|
335
|
+
.subscribe(this._container.domRenderer.render$);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
protected _deactivate(): void {
|
|
339
|
+
this._disposable.unsubscribe();
|
|
340
|
+
this._disposableDescription.unsubscribe();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
protected _getDefaultConfiguration(): IRouteConfiguration {
|
|
344
|
+
return {};
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
private _getRouteAnnotationNode(description: string): vd.VNode {
|
|
348
|
+
return vd.h("div.RouteFrame", {}, [
|
|
349
|
+
vd.h("p", { textContent: description }, []),
|
|
350
|
+
]);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export default RouteComponent;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Subscription } from "rxjs";
|
|
2
|
+
import { Component, IComponentConfiguration} from "../Component";
|
|
3
|
+
import {Container, Navigator} from "../Viewer";
|
|
4
|
+
|
|
5
|
+
type Keys = { [key: string]: boolean };
|
|
6
|
+
|
|
7
|
+
interface IKeys {
|
|
8
|
+
report: string[];
|
|
9
|
+
reported: Keys;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class StatsComponent extends Component<IComponentConfiguration> {
|
|
13
|
+
public static componentName: string = "stats";
|
|
14
|
+
|
|
15
|
+
private _sequenceSubscription: Subscription;
|
|
16
|
+
private _imageSubscription: Subscription;
|
|
17
|
+
|
|
18
|
+
constructor(name: string, container: Container, navigator: Navigator) {
|
|
19
|
+
super(name, container, navigator);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
protected _activate(): void {
|
|
23
|
+
// this._sequenceSubscription = this._navigator.stateService.currentNode$
|
|
24
|
+
// .scan(
|
|
25
|
+
// (keys: IKeys, node: Node): IKeys => {
|
|
26
|
+
// let sKey: string = node.sequenceKey;
|
|
27
|
+
// keys.report = [];
|
|
28
|
+
|
|
29
|
+
// if (!(sKey in keys.reported)) {
|
|
30
|
+
// keys.report = [sKey];
|
|
31
|
+
// keys.reported[sKey] = true;
|
|
32
|
+
// }
|
|
33
|
+
|
|
34
|
+
// return keys;
|
|
35
|
+
// },
|
|
36
|
+
// { report: [], reported: {} })
|
|
37
|
+
// .filter(
|
|
38
|
+
// (keys: IKeys): boolean => {
|
|
39
|
+
// return keys.report.length > 0;
|
|
40
|
+
// })
|
|
41
|
+
// .mergeMap(
|
|
42
|
+
// (keys: IKeys): Observable<void> => {
|
|
43
|
+
// return this._navigator.api.sequenceViewAdd$(keys.report)
|
|
44
|
+
// .catch(
|
|
45
|
+
// (error: Error, caught: Observable<void>): Observable<void> => {
|
|
46
|
+
// console.error(`Failed to report sequence stats (${keys.report})`, error);
|
|
47
|
+
|
|
48
|
+
// return Observable.empty<void>();
|
|
49
|
+
// });
|
|
50
|
+
// })
|
|
51
|
+
// .subscribe(() => { /*noop*/ });
|
|
52
|
+
|
|
53
|
+
// this._imageSubscription = this._navigator.stateService.currentNode$
|
|
54
|
+
// .map(
|
|
55
|
+
// (node: Node): string => {
|
|
56
|
+
// return node.key;
|
|
57
|
+
// })
|
|
58
|
+
// .buffer(this._navigator.stateService.currentNode$.debounceTime(5000))
|
|
59
|
+
// .scan(
|
|
60
|
+
// (keys: IKeys, newKeys: string[]): IKeys => {
|
|
61
|
+
// keys.report = [];
|
|
62
|
+
|
|
63
|
+
// for (let key of newKeys) {
|
|
64
|
+
// if (!(key in keys.reported)) {
|
|
65
|
+
// keys.report.push(key);
|
|
66
|
+
// keys.reported[key] = true;
|
|
67
|
+
// }
|
|
68
|
+
// }
|
|
69
|
+
|
|
70
|
+
// return keys;
|
|
71
|
+
// },
|
|
72
|
+
// { report: [], reported: {} })
|
|
73
|
+
// .filter(
|
|
74
|
+
// (keys: IKeys): boolean => {
|
|
75
|
+
// return keys.report.length > 0;
|
|
76
|
+
// })
|
|
77
|
+
// .mergeMap(
|
|
78
|
+
// (keys: IKeys): Observable<void> => {
|
|
79
|
+
// return this._navigator.api.imageViewAdd$(keys.report)
|
|
80
|
+
// .catch(
|
|
81
|
+
// (error: Error, caught: Observable<void>): Observable<void> => {
|
|
82
|
+
// console.error(`Failed to report image stats (${keys.report})`, error);
|
|
83
|
+
|
|
84
|
+
// return Observable.empty<void>();
|
|
85
|
+
// });
|
|
86
|
+
// })
|
|
87
|
+
// .subscribe(() => { /*noop*/ });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected _deactivate(): void {
|
|
91
|
+
// this._sequenceSubscription.unsubscribe();
|
|
92
|
+
// this._imageSubscription.unsubscribe();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
protected _getDefaultConfiguration(): IComponentConfiguration {
|
|
96
|
+
return {};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default StatsComponent;
|