File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,14 @@ class Graph extends React.Component {
111
111
this . prevFit = this . props . fit ;
112
112
}
113
113
this . prevDotSrc = this . props . dotSrc ;
114
+ try {
115
+ this . prelDotGraph = new DotGraph ( this . props . dotSrc ) ;
116
+ }
117
+ catch ( error ) {
118
+ let { location : { start : { line} } , message} = error ;
119
+ this . props . onError ( { message : message , line : line } ) ;
120
+ return ;
121
+ }
114
122
this . rendering = true ;
115
123
this . graphviz
116
124
. width ( width )
@@ -129,13 +137,7 @@ class Graph extends React.Component {
129
137
handleRenderGraphReady ( ) {
130
138
this . svg = this . div . selectWithoutDataPropagation ( "svg" ) ;
131
139
this . graph0 = this . svg . selectWithoutDataPropagation ( "g" ) ;
132
- try {
133
- this . dotGraph = new DotGraph ( this . props . dotSrc ) ;
134
- }
135
- catch ( error ) {
136
- let { location : { start : { line} } , message} = error ;
137
- this . props . onError ( { message : message , line : line } ) ;
138
- }
140
+ this . dotGraph = this . prelDotGraph ;
139
141
this . addEventHandlers ( ) ;
140
142
this . rendering = false ;
141
143
if ( ! this . renderGraphReady ) {
You can’t perform that action at this time.
0 commit comments