Open
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Member
Great, I shall mark it as draft first in the meantime. Feel free to re-mark as ready once done. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds 2 new box-and-pointer visualizers for when the draw_data function is ran, so that now there are:
Type of Change
Added Functionality
Files Edited
src/features/dataVisualizer/[Documentation.md](http://documentation.md/)src/features/dataVisualizer/images/BINARY_TREE_IMAGE.pngsrc/features/dataVisualizer/images/GENERAL_TREE_IMAGE.pngsrc/features/dataVisualizer/images/ORIGINAL_VIEW_IMAGE.pngsrc/commons/sideContent/content/SideContentDataVisualizer.tsxsrc/features/dataVisualizer/dataVisualizer.tsxsrc/features/dataVisualizer/dataVisualizerTypes.tssrc/features/dataVisualizer/drawable/ArrayDrawable.tsxsrc/features/dataVisualizer/drawable/ArrowDrawable.tsxsrc/features/dataVisualizer/tree/ArrayTreeNode.tsxsrc/features/dataVisualizer/tree/BaseTreeNode.tssrc/features/dataVisualizer/tree/DrawableTreeNode.tsxsrc/features/dataVisualizer/tree/FunctionTreeNode.tsxsrc/features/dataVisualizer/tree/Tree.tsxsrc/commons/sagas/WorkspaceSaga/index.tssrc/features/dataVisualizer/Config.tsHow to Test
Run the following code in the Source Academy playground and open the Data Visualizer:
draw_data(list(1,2,3)): should only give error for “Render Binary Tree” mode.draw_data([1,2,3]): should only give errors for “Render Binary Tree” mode and “Render General Tree” mode.draw_data(list(1,list(2,null,null),list(3,null, null))): should not have any error, generates tree structures correctly in any of the 3 modes.The appropriate box-and-pointer diagram should be generated. Boxes belonging to the same node should be the same colour, while those from the neighbouring nodes should be in different colours. Examples are shown in the documentation file.
Checklist