@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
package/rollup.config.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import dts from "rollup-plugin-dts";
|
|
2
|
+
import { terser } from "rollup-plugin-terser";
|
|
3
|
+
import { esm, srcInput as input, plugins, umdOutput } from "./config/rollup.js";
|
|
4
|
+
|
|
5
|
+
const unminifiedOutput = Object.assign(
|
|
6
|
+
{ file: "dist/mapxus-visual.unminified.js" },
|
|
7
|
+
umdOutput,
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const minifiedOutput = Object.assign(
|
|
11
|
+
{ file: "dist/mapxus-visual.js" },
|
|
12
|
+
umdOutput,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const bundles = [
|
|
16
|
+
esm,
|
|
17
|
+
{
|
|
18
|
+
input,
|
|
19
|
+
output: [unminifiedOutput],
|
|
20
|
+
plugins,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
input,
|
|
24
|
+
output: [minifiedOutput],
|
|
25
|
+
plugins: [...plugins, terser()],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
input: "build/esm/MapxusVisual.d.ts",
|
|
29
|
+
output: [
|
|
30
|
+
{
|
|
31
|
+
file: "dist/mapxus-visual.d.ts",
|
|
32
|
+
format: "es",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
plugins: [dts()],
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export default bundles;
|
package/server.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import express from "express";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
|
|
6
|
+
const PORT = 8000;
|
|
7
|
+
|
|
8
|
+
const pathname = (dirname) => {
|
|
9
|
+
const url = join(import.meta.url, `../${dirname}`);
|
|
10
|
+
return new URL(url).pathname;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const logger = (req, res, next) => {
|
|
14
|
+
const clearColor = "\x1b[0m";
|
|
15
|
+
res.on("finish", () => {
|
|
16
|
+
const color = res.statusCode < 400 ? clearColor : "\x1b[31m";
|
|
17
|
+
const format = `${color}%s${clearColor}`;
|
|
18
|
+
const message =
|
|
19
|
+
`[${new Date().toISOString()}] ${req.method} ` +
|
|
20
|
+
`${req.originalUrl} ${res.statusCode}`;
|
|
21
|
+
console.log(format, message);
|
|
22
|
+
});
|
|
23
|
+
next();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const app = express();
|
|
27
|
+
app.use(logger);
|
|
28
|
+
app.use("/dist", express.static(pathname("dist")));
|
|
29
|
+
app.use("/", express.static(pathname("debug")));
|
|
30
|
+
|
|
31
|
+
app.listen(PORT, () => {
|
|
32
|
+
const message =
|
|
33
|
+
`mapxus-visual debug server running at ` + `http://localhost:${PORT}`;
|
|
34
|
+
console.log(message);
|
|
35
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/// <reference path="../../typings/index.d.ts" />
|
|
2
|
+
|
|
3
|
+
import * as falcor from "falcor";
|
|
4
|
+
|
|
5
|
+
import {Observable} from "rxjs/Observable";
|
|
6
|
+
|
|
7
|
+
import "rxjs/add/operator/retry";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ICoreNode,
|
|
11
|
+
IFillNode,
|
|
12
|
+
IFullNode,
|
|
13
|
+
ISequence,
|
|
14
|
+
} from "../../src/API";
|
|
15
|
+
|
|
16
|
+
describe("APIv3.ctor", () => {
|
|
17
|
+
it("should create an API v3");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe("APIv3.imageByKeyFill$", () => {
|
|
21
|
+
it("should call model correctly");
|
|
22
|
+
|
|
23
|
+
it("should throw when result is undefined");
|
|
24
|
+
|
|
25
|
+
it("should invalidate model correctly when error is thrown");
|
|
26
|
+
|
|
27
|
+
it("should invalidate model for every error on retry");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe("APIv3.imageByKeyFull$", () => {
|
|
31
|
+
it("should call model correctly");
|
|
32
|
+
|
|
33
|
+
it("should throw when result is undefined");
|
|
34
|
+
|
|
35
|
+
it("should invalidate model correctly when error is thrown");
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("APIv3.imageCloseTo$", () => {
|
|
39
|
+
it("should call model correctly");
|
|
40
|
+
|
|
41
|
+
it("should invalidate model correctly when error is thrown");
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe("APIv3.imagesByH$", () => {
|
|
45
|
+
it("should call model correctly");
|
|
46
|
+
|
|
47
|
+
it("should invalidate model correctly when error is thrown");
|
|
48
|
+
|
|
49
|
+
it("should handle undefined response");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe("APIv3.sequenceByKey$", () => {
|
|
53
|
+
it("should call model correctly");
|
|
54
|
+
|
|
55
|
+
it("should invalidate model correctly when error is thrown");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe("APIv3.imageViewAdd$", () => {
|
|
59
|
+
it("should call model correctly");
|
|
60
|
+
|
|
61
|
+
it("should invalidate model correctly when error is thrown");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe("APIv3.sequenceViewAdd$", () => {
|
|
65
|
+
it("should call model correctly");
|
|
66
|
+
|
|
67
|
+
it("should invalidate model correctly when error is thrown");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
describe("APIv3.invalidateImageByKey", () => {
|
|
72
|
+
it("should call model correctly");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe("APIv3.invalidateImagesByH", () => {
|
|
76
|
+
it("should call model correctly");
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("APIv3.invalidateSequenceByKey", () => {
|
|
80
|
+
it("should call model correctly");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe("APIv3.setToken", () => {
|
|
84
|
+
it("should invalidate old model and create a new with token");
|
|
85
|
+
});
|
|
86
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
IComponentConfiguration,
|
|
4
|
+
} from "../../src/Component";
|
|
5
|
+
|
|
6
|
+
interface ITestConfiguration extends IComponentConfiguration {
|
|
7
|
+
test?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class TestComponent extends Component<ITestConfiguration> {
|
|
11
|
+
protected _activate(): void { /*noop*/ }
|
|
12
|
+
protected _deactivate(): void { /*noop*/ }
|
|
13
|
+
|
|
14
|
+
protected _getDefaultConfiguration(): ITestConfiguration {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe("Component.ctor", () => {
|
|
20
|
+
it("should be defined", () => {
|
|
21
|
+
let component: TestComponent = new TestComponent("test", undefined, undefined);
|
|
22
|
+
|
|
23
|
+
expect(component).toBeDefined();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe("Component.configuration$", () => {
|
|
28
|
+
it("should be emtpy default configuration", () => {
|
|
29
|
+
let component: TestComponent = new TestComponent("test", undefined, undefined);
|
|
30
|
+
|
|
31
|
+
component.configuration$
|
|
32
|
+
.subscribe(
|
|
33
|
+
(configuration: IComponentConfiguration): void => {
|
|
34
|
+
expect(Object.keys(configuration).length).toBe(0);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("should emit when configured", (done: Function) => {
|
|
39
|
+
let component: TestComponent = new TestComponent("test", undefined, undefined);
|
|
40
|
+
|
|
41
|
+
component.configuration$
|
|
42
|
+
.skip(1)
|
|
43
|
+
.subscribe(
|
|
44
|
+
(configuration: ITestConfiguration): void => {
|
|
45
|
+
expect(Object.keys(configuration).length).toBe(1);
|
|
46
|
+
expect(configuration.test).toBe("test");
|
|
47
|
+
done();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
component.configure({ test: "test" });
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("should emit when configured value is changed", (done: Function) => {
|
|
54
|
+
let component: TestComponent = new TestComponent("test", undefined, undefined);
|
|
55
|
+
|
|
56
|
+
component.configuration$
|
|
57
|
+
.skip(2)
|
|
58
|
+
.subscribe(
|
|
59
|
+
(configuration: ITestConfiguration): void => {
|
|
60
|
+
expect(Object.keys(configuration).length).toBe(1);
|
|
61
|
+
expect(configuration.test).toBe("testchanged");
|
|
62
|
+
done();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
component.configure({ test: "test" });
|
|
66
|
+
component.configure({ test: "testchanged" });
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference path="../../typings/index.d.ts" />
|
|
2
|
+
|
|
3
|
+
import {Subject} from "rxjs/Subject";
|
|
4
|
+
|
|
5
|
+
import {ContainerMockCreator} from "../helper/ContainerMockCreator.spec";
|
|
6
|
+
import {MockCreator} from "../helper/MockCreator.spec";
|
|
7
|
+
import {NavigatorMockCreator} from "../helper/NavigatorMockCreator.spec";
|
|
8
|
+
import {NodeHelper} from "../helper/NodeHelper.spec";
|
|
9
|
+
|
|
10
|
+
// import {StatsComponent} from "../../src/Component";
|
|
11
|
+
import {Node} from "../../src/Graph";
|
|
12
|
+
import {
|
|
13
|
+
Container,
|
|
14
|
+
Navigator,
|
|
15
|
+
} from "../../src/Viewer";
|
|
16
|
+
|
|
17
|
+
describe("StatsComponent", () => {
|
|
18
|
+
it("should be defined");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe("StatsComponent.activate", () => {
|
|
22
|
+
it("should activate properly");
|
|
23
|
+
|
|
24
|
+
it("should send sequence stats for current node");
|
|
25
|
+
|
|
26
|
+
it("should only send the same sequence key once");
|
|
27
|
+
|
|
28
|
+
it("should send node stats for current node");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("StatsComponent.deactivate", () => {
|
|
32
|
+
it("should deactivate properly");
|
|
33
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/// <reference path="../../../typings/index.d.ts" />
|
|
2
|
+
|
|
3
|
+
import {Observable} from "rxjs/Observable";
|
|
4
|
+
import {Subject} from "rxjs/Subject";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
DirectionComponent,
|
|
8
|
+
DirectionDOMRenderer,
|
|
9
|
+
} from "../../../src/Component";
|
|
10
|
+
import {
|
|
11
|
+
Node,
|
|
12
|
+
NodeCache,
|
|
13
|
+
Sequence,
|
|
14
|
+
} from "../../../src/Graph";
|
|
15
|
+
import {
|
|
16
|
+
Container,
|
|
17
|
+
Navigator,
|
|
18
|
+
} from "../../../src/Viewer";
|
|
19
|
+
|
|
20
|
+
import {ContainerMockCreator} from "../../helper/ContainerMockCreator.spec";
|
|
21
|
+
import {NavigatorMockCreator} from "../../helper/NavigatorMockCreator.spec";
|
|
22
|
+
import {NodeHelper} from "../../helper/NodeHelper.spec";
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
describe("DirectionComponent.ctor", () => {
|
|
26
|
+
it("should be defined", () => {
|
|
27
|
+
const directionComponent: DirectionComponent =
|
|
28
|
+
new DirectionComponent(
|
|
29
|
+
DirectionComponent.componentName,
|
|
30
|
+
new ContainerMockCreator().create(),
|
|
31
|
+
new NavigatorMockCreator().create());
|
|
32
|
+
|
|
33
|
+
expect(directionComponent).toBeDefined();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe("DirectionComponent.deactivate", () => {
|
|
38
|
+
it("should deactivate properly", () => {
|
|
39
|
+
const directionComponent: DirectionComponent =
|
|
40
|
+
new DirectionComponent(
|
|
41
|
+
DirectionComponent.componentName,
|
|
42
|
+
new ContainerMockCreator().create(),
|
|
43
|
+
new NavigatorMockCreator().create());
|
|
44
|
+
|
|
45
|
+
directionComponent.activate();
|
|
46
|
+
directionComponent.deactivate();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe("DirectionComponent.activate", () => {
|
|
51
|
+
it("should set edges when node spatial edges emits", () => {
|
|
52
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
53
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
54
|
+
const renderer: DirectionDOMRenderer = new DirectionDOMRenderer({}, document.createElement("div"));
|
|
55
|
+
const setEdgesSpy: jasmine.Spy = spyOn(renderer, "setEdges").and.stub();
|
|
56
|
+
|
|
57
|
+
const directionComponent: DirectionComponent =
|
|
58
|
+
new DirectionComponent(
|
|
59
|
+
DirectionComponent.componentName,
|
|
60
|
+
containerMock,
|
|
61
|
+
navigatorMock,
|
|
62
|
+
renderer);
|
|
63
|
+
|
|
64
|
+
directionComponent.activate();
|
|
65
|
+
|
|
66
|
+
const node: Node = new NodeHelper().createNode();
|
|
67
|
+
node.initializeCache(new NodeCache());
|
|
68
|
+
node.cacheSpatialEdges([]);
|
|
69
|
+
(<Subject<Node>>navigatorMock.stateService.currentNode$).next(node);
|
|
70
|
+
|
|
71
|
+
expect(setEdgesSpy.calls.count()).toBe(1);
|
|
72
|
+
expect(setEdgesSpy.calls.argsFor(0)[1]).toBe(null);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("should set edges when distinguishing sequence with cached sequence", () => {
|
|
76
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
77
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
78
|
+
const renderer: DirectionDOMRenderer = new DirectionDOMRenderer({ distinguishSequence: true }, document.createElement("div"));
|
|
79
|
+
const setEdgesSpy: jasmine.Spy = spyOn(renderer, "setEdges").and.stub();
|
|
80
|
+
|
|
81
|
+
const directionComponent: DirectionComponent =
|
|
82
|
+
new DirectionComponent(
|
|
83
|
+
DirectionComponent.componentName,
|
|
84
|
+
containerMock,
|
|
85
|
+
navigatorMock,
|
|
86
|
+
renderer);
|
|
87
|
+
|
|
88
|
+
directionComponent.configure({ distinguishSequence: true });
|
|
89
|
+
directionComponent.activate();
|
|
90
|
+
|
|
91
|
+
const sequence: Sequence = new Sequence({ key: "skey", keys: [] });
|
|
92
|
+
(<jasmine.Spy>navigatorMock.graphService.cacheSequence$).and.returnValue(Observable.of<Sequence>(sequence));
|
|
93
|
+
|
|
94
|
+
const node: Node = new NodeHelper().createNode();
|
|
95
|
+
node.initializeCache(new NodeCache());
|
|
96
|
+
node.cacheSpatialEdges([]);
|
|
97
|
+
(<Subject<Node>>navigatorMock.stateService.currentNode$).next(node);
|
|
98
|
+
|
|
99
|
+
expect(setEdgesSpy.calls.count()).toBe(1);
|
|
100
|
+
expect(setEdgesSpy.calls.argsFor(0)[1]).toBe(sequence);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("should set edges when distinguishing sequence with uncached sequence", () => {
|
|
104
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
105
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
106
|
+
const renderer: DirectionDOMRenderer = new DirectionDOMRenderer({ distinguishSequence: true }, document.createElement("div"));
|
|
107
|
+
const setEdgesSpy: jasmine.Spy = spyOn(renderer, "setEdges").and.stub();
|
|
108
|
+
|
|
109
|
+
const directionComponent: DirectionComponent =
|
|
110
|
+
new DirectionComponent(
|
|
111
|
+
DirectionComponent.componentName,
|
|
112
|
+
containerMock,
|
|
113
|
+
navigatorMock,
|
|
114
|
+
renderer);
|
|
115
|
+
|
|
116
|
+
directionComponent.configure({ distinguishSequence: true });
|
|
117
|
+
directionComponent.activate();
|
|
118
|
+
|
|
119
|
+
const sequence: Sequence = new Sequence({ key: "skey", keys: [] });
|
|
120
|
+
const cacheSequence$: Subject<Sequence> = new Subject<Sequence>();
|
|
121
|
+
(<jasmine.Spy>navigatorMock.graphService.cacheSequence$).and.returnValue(cacheSequence$);
|
|
122
|
+
|
|
123
|
+
const node: Node = new NodeHelper().createNode();
|
|
124
|
+
node.initializeCache(new NodeCache());
|
|
125
|
+
node.cacheSpatialEdges([]);
|
|
126
|
+
(<Subject<Node>>navigatorMock.stateService.currentNode$).next(node);
|
|
127
|
+
|
|
128
|
+
cacheSequence$.next(sequence);
|
|
129
|
+
cacheSequence$.complete();
|
|
130
|
+
|
|
131
|
+
expect(setEdgesSpy.calls.count()).toBe(1);
|
|
132
|
+
expect(setEdgesSpy.calls.argsFor(0)[1]).toBe(sequence);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("should set edges when distinguishing sequence and cache sequence throws", () => {
|
|
136
|
+
spyOn(console, "error").and.stub();
|
|
137
|
+
|
|
138
|
+
const containerMock: Container = new ContainerMockCreator().create();
|
|
139
|
+
const navigatorMock: Navigator = new NavigatorMockCreator().create();
|
|
140
|
+
const renderer: DirectionDOMRenderer = new DirectionDOMRenderer({ distinguishSequence: true }, document.createElement("div"));
|
|
141
|
+
const setEdgesSpy: jasmine.Spy = spyOn(renderer, "setEdges").and.stub();
|
|
142
|
+
|
|
143
|
+
const directionComponent: DirectionComponent =
|
|
144
|
+
new DirectionComponent(
|
|
145
|
+
DirectionComponent.componentName,
|
|
146
|
+
containerMock,
|
|
147
|
+
navigatorMock,
|
|
148
|
+
renderer);
|
|
149
|
+
|
|
150
|
+
directionComponent.configure({ distinguishSequence: true });
|
|
151
|
+
directionComponent.activate();
|
|
152
|
+
|
|
153
|
+
(<jasmine.Spy>navigatorMock.graphService.cacheSequence$).and.returnValue(Observable.throw(new Error("Failed to cache seq.")));
|
|
154
|
+
|
|
155
|
+
const node: Node = new NodeHelper().createNode();
|
|
156
|
+
node.initializeCache(new NodeCache());
|
|
157
|
+
node.cacheSpatialEdges([]);
|
|
158
|
+
(<Subject<Node>>navigatorMock.stateService.currentNode$).next(node);
|
|
159
|
+
|
|
160
|
+
expect(setEdgesSpy.calls.count()).toBe(1);
|
|
161
|
+
expect(setEdgesSpy.calls.argsFor(0)[1]).toBe(null);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/// <reference path="../../../typings/index.d.ts" />
|
|
2
|
+
|
|
3
|
+
import {NodeHelper} from "../../helper/NodeHelper.spec";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
DirectionDOMRenderer,
|
|
7
|
+
IDirectionConfiguration,
|
|
8
|
+
} from "../../../src/Component";
|
|
9
|
+
import {Node} from "../../../src/Graph";
|
|
10
|
+
import {
|
|
11
|
+
RenderCamera,
|
|
12
|
+
RenderMode,
|
|
13
|
+
} from "../../../src/Render";
|
|
14
|
+
import {Navigator} from "../../../src/Viewer";
|
|
15
|
+
|
|
16
|
+
describe("DirectionDOMRenderer.ctor", () => {
|
|
17
|
+
it("should be defined", () => {
|
|
18
|
+
let configuration: IDirectionConfiguration = {
|
|
19
|
+
distinguishSequence: false,
|
|
20
|
+
maxWidth: 200,
|
|
21
|
+
minWidth: 100,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
let element: HTMLElement = document.createElement("div");
|
|
25
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
26
|
+
|
|
27
|
+
expect(renderer).toBeDefined();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("DirectionDOMRenderer.needsRender", () => {
|
|
32
|
+
let helper: NodeHelper;
|
|
33
|
+
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
helper = new NodeHelper();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("should not need render when constructed", () => {
|
|
39
|
+
let configuration: IDirectionConfiguration = {
|
|
40
|
+
distinguishSequence: false,
|
|
41
|
+
maxWidth: 200,
|
|
42
|
+
minWidth: 100,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
let element: HTMLElement = document.createElement("div");
|
|
46
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
47
|
+
|
|
48
|
+
expect(renderer.needsRender).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("should need render when node is set", () => {
|
|
52
|
+
let configuration: IDirectionConfiguration = {
|
|
53
|
+
distinguishSequence: false,
|
|
54
|
+
maxWidth: 200,
|
|
55
|
+
minWidth: 100,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
let element: HTMLElement = document.createElement("div");
|
|
59
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
60
|
+
|
|
61
|
+
let node: Node = new Node(helper.createCoreNode());
|
|
62
|
+
node.makeFull(helper.createFillNode());
|
|
63
|
+
|
|
64
|
+
renderer.setNode(node);
|
|
65
|
+
|
|
66
|
+
expect(renderer.needsRender).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("should not need render after rendering", () => {
|
|
70
|
+
let configuration: IDirectionConfiguration = {
|
|
71
|
+
distinguishSequence: false,
|
|
72
|
+
maxWidth: 200,
|
|
73
|
+
minWidth: 100,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
let element: HTMLElement = document.createElement("div");
|
|
77
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
78
|
+
|
|
79
|
+
let node: Node = new Node(helper.createCoreNode());
|
|
80
|
+
node.makeFull(helper.createFillNode());
|
|
81
|
+
|
|
82
|
+
renderer.setNode(node);
|
|
83
|
+
|
|
84
|
+
expect(renderer.needsRender).toBe(true);
|
|
85
|
+
|
|
86
|
+
let navigator: Navigator = new Navigator();
|
|
87
|
+
|
|
88
|
+
renderer.render(navigator);
|
|
89
|
+
|
|
90
|
+
expect(renderer.needsRender).toBe(false);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("should not need render when setting render camera without node set", () => {
|
|
94
|
+
let configuration: IDirectionConfiguration = {
|
|
95
|
+
distinguishSequence: false,
|
|
96
|
+
maxWidth: 200,
|
|
97
|
+
minWidth: 100,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
let element: HTMLElement = document.createElement("div");
|
|
101
|
+
|
|
102
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
103
|
+
|
|
104
|
+
let renderCamera: RenderCamera = new RenderCamera(1, 1, RenderMode.Fill);
|
|
105
|
+
renderCamera.camera.up.fromArray([0, 0, 1]);
|
|
106
|
+
renderCamera.camera.lookat.fromArray([1, 1, 0]);
|
|
107
|
+
renderer.setRenderCamera(renderCamera);
|
|
108
|
+
|
|
109
|
+
expect(renderer.needsRender).toBe(false);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("should not need render when setting configuration without node set", () => {
|
|
113
|
+
let configuration: IDirectionConfiguration = {
|
|
114
|
+
distinguishSequence: false,
|
|
115
|
+
maxWidth: 200,
|
|
116
|
+
minWidth: 100,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
let element: HTMLElement = document.createElement("div");
|
|
120
|
+
|
|
121
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
122
|
+
|
|
123
|
+
configuration.maxWidth = 300;
|
|
124
|
+
renderer.setConfiguration(configuration);
|
|
125
|
+
|
|
126
|
+
expect(renderer.needsRender).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("should not need render when resizing without node set", () => {
|
|
130
|
+
let configuration: IDirectionConfiguration = {
|
|
131
|
+
distinguishSequence: false,
|
|
132
|
+
maxWidth: 200,
|
|
133
|
+
minWidth: 100,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
let element: HTMLElement = document.createElement("div");
|
|
137
|
+
|
|
138
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
139
|
+
|
|
140
|
+
renderer.resize(element);
|
|
141
|
+
|
|
142
|
+
expect(renderer.needsRender).toBe(false);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("should need render when setting changed render camera if node is set", () => {
|
|
146
|
+
let configuration: IDirectionConfiguration = {
|
|
147
|
+
distinguishSequence: false,
|
|
148
|
+
maxWidth: 200,
|
|
149
|
+
minWidth: 100,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
let element: HTMLElement = document.createElement("div");
|
|
153
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
154
|
+
|
|
155
|
+
let node: Node = new Node(helper.createCoreNode());
|
|
156
|
+
node.makeFull(helper.createFillNode());
|
|
157
|
+
|
|
158
|
+
renderer.setNode(node);
|
|
159
|
+
|
|
160
|
+
expect(renderer.needsRender).toBe(true);
|
|
161
|
+
|
|
162
|
+
let navigator: Navigator = new Navigator();
|
|
163
|
+
|
|
164
|
+
renderer.render(navigator);
|
|
165
|
+
|
|
166
|
+
expect(renderer.needsRender).toBe(false);
|
|
167
|
+
|
|
168
|
+
let renderCamera: RenderCamera = new RenderCamera(1, 1, RenderMode.Fill);
|
|
169
|
+
renderCamera.camera.up.fromArray([0, 0, 1]);
|
|
170
|
+
renderCamera.camera.lookat.fromArray([1, 1, 0]);
|
|
171
|
+
renderCamera.updateRotation(renderCamera.camera);
|
|
172
|
+
renderer.setRenderCamera(renderCamera);
|
|
173
|
+
|
|
174
|
+
expect(renderer.needsRender).toBe(true);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("should need render when setting changed configuration if node is set", () => {
|
|
178
|
+
let configuration: IDirectionConfiguration = {
|
|
179
|
+
distinguishSequence: false,
|
|
180
|
+
maxWidth: 200,
|
|
181
|
+
minWidth: 100,
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
let element: HTMLElement = document.createElement("div");
|
|
185
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
186
|
+
|
|
187
|
+
let node: Node = new Node(helper.createCoreNode());
|
|
188
|
+
node.makeFull(helper.createFillNode());
|
|
189
|
+
|
|
190
|
+
renderer.setNode(node);
|
|
191
|
+
|
|
192
|
+
expect(renderer.needsRender).toBe(true);
|
|
193
|
+
|
|
194
|
+
let navigator: Navigator = new Navigator();
|
|
195
|
+
|
|
196
|
+
renderer.render(navigator);
|
|
197
|
+
|
|
198
|
+
expect(renderer.needsRender).toBe(false);
|
|
199
|
+
|
|
200
|
+
configuration.maxWidth = 300;
|
|
201
|
+
renderer.setConfiguration(configuration);
|
|
202
|
+
|
|
203
|
+
expect(renderer.needsRender).toBe(true);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it("should need render when resizing if node is set", () => {
|
|
207
|
+
let configuration: IDirectionConfiguration = {
|
|
208
|
+
distinguishSequence: false,
|
|
209
|
+
maxWidth: 200,
|
|
210
|
+
minWidth: 100,
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
let element: HTMLElement = document.createElement("div");
|
|
214
|
+
let renderer: DirectionDOMRenderer = new DirectionDOMRenderer(configuration, element);
|
|
215
|
+
|
|
216
|
+
let node: Node = new Node(helper.createCoreNode());
|
|
217
|
+
node.makeFull(helper.createFillNode());
|
|
218
|
+
|
|
219
|
+
renderer.setNode(node);
|
|
220
|
+
|
|
221
|
+
expect(renderer.needsRender).toBe(true);
|
|
222
|
+
|
|
223
|
+
let navigator: Navigator = new Navigator();
|
|
224
|
+
|
|
225
|
+
renderer.render(navigator);
|
|
226
|
+
|
|
227
|
+
expect(renderer.needsRender).toBe(false);
|
|
228
|
+
|
|
229
|
+
renderer.resize(element);
|
|
230
|
+
|
|
231
|
+
expect(renderer.needsRender).toBe(true);
|
|
232
|
+
});
|
|
233
|
+
});
|