File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
DotNetSyntaxTreeVisualizer Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change 11import React , { Component } from 'react' ;
22import Tree from 'react-d3-tree' ;
33
4- const svgSquare = {
5- shape : 'rect' ,
6- shapeProps : {
7- width : 20 ,
8- height : 20 ,
9- x : - 10 ,
10- y : - 10 ,
11- }
12- }
13-
144const containerStyles = {
155 width : '100%' ,
166 height : '100vh' ,
@@ -57,7 +47,7 @@ export class Home extends Component {
5747 < React . Fragment >
5848 < textarea defaultValue = { helloWorldCode } onChange = { this . handleChanged } style = { { height : '230px' , width : '100%' } } />
5949 < div id = "treeWrapper" style = { containerStyles } ref = { tc => ( this . treeContainer = tc ) } >
60- < Tree data = { this . state . treeJson } nodeSvgShape = { svgSquare } orientation = "vertical" translate = { this . state . translate } />
50+ < Tree data = { this . state . treeJson } orientation = "vertical" translate = { this . state . translate } pathFunc = "straight" />
6151 </ div >
6252 </ React . Fragment >
6353 ) ;
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ public class SyntaxTreeNode
99 {
1010 public string Name { get ; }
1111
12- public IDictionary < string , string > Attributes { get ; }
12+ public IDictionary < string , string > Properties { get ; }
1313 public IList < SyntaxTreeNode > Children { get ; } = new List < SyntaxTreeNode > ( ) ;
1414
15- public SyntaxTreeNode ( IDictionary < string , string > attributes ) =>
16- ( Attributes , Name ) = ( attributes , attributes . Values . First ( ) ) ;
15+ public SyntaxTreeNode ( IDictionary < string , string > properties ) =>
16+ ( Properties , Name ) = ( properties , properties . Values . First ( ) ) ;
1717
1818 public void AddChild ( SyntaxTreeNode child )
1919 {
@@ -22,7 +22,7 @@ public void AddChild(SyntaxTreeNode child)
2222
2323 public override string ToString ( )
2424 {
25- return Attributes . Values . First ( ) ;
25+ return Properties . Values . First ( ) ;
2626 }
2727 }
2828}
You can’t perform that action at this time.
0 commit comments