MaibornWolff / codecharta

CodeCharta visualizes multiple code metrics using 3D tree maps.
https://maibornwolff.github.io/codecharta/
BSD 3-Clause "New" or "Revised" License
190 stars 30 forks source link

Changing to top down view rotates map incorrectly #3467

Open Nereboss opened 9 months ago

Nereboss commented 9 months ago

Bug

Expected Behavior

WHEN Clicking on the field in the 'cube' in the top right corner to view the map from top down THEN The map shows from top down so that all text is readable ## Actual Behavior The map is rotated counter-clockwise by 90° ## Screenshots ![image](https://github.com/MaibornWolff/codecharta/assets/105795397/250241fa-86e8-40e0-b682-542a203c261e) ## Steps to Reproduce the Problem 1. Click on the cube in the top right to select the top down view ## Specifications - is released in [online-demo](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json.gz&file=codecharta_analysis.cc.json.gz): yes - CodeCharta Version: 1.121.1 - OS: MacOS - Browser: Chrome
ce-bo commented 9 months ago

This is due to the way how the map is draw into the 3d-coordinate system.

Nereboss commented 1 week ago

Developer notes: when the map is loaded the "front" is with the text to the right like shown above and the ThreeJS function we call to achieve this seem to automatically rotate the camera to the front when setting its position. Simply rotating the camera 90 degrees when the viewCube is clicked to view the map from above did not fix this as the camera was correctly rotated but reset itself once the user tried to move the map. To fix this we likely need to change what the "front" of the map is right when it is loaded