File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ export default class GraphViewport extends Component<
144144 rawError instanceof Error
145145 ? rawError
146146 : new Error ( 'Unknown error: ' + String ( rawError ) ) ;
147+ console . error ( error ) ;
147148 this . setState ( ( ) => {
148149 throw error ;
149150 } ) ;
Original file line number Diff line number Diff line change @@ -128,11 +128,14 @@ export function getDot(typeGraph: TypeGraph): Graph {
128128 } ) ;
129129 }
130130
131+ const graphDensity = edges . length / ( nodes . length * ( nodes . length - 1 ) ) ;
131132 return {
132133 directed : true ,
133134 graphAttributes : {
134135 rankdir : 'LR' ,
135136 ranksep : 2.0 ,
137+ layout :
138+ typeGraph . rootType == null && graphDensity > 0.4 ? 'circo' : 'dot' ,
136139 } ,
137140 nodeAttributes : {
138141 fontsize : '16' ,
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ export async function renderSvg(typeGraph: TypeGraph) {
1414 const rawSVG = await vizWorker . render ( {
1515 input : dot ,
1616 options : {
17- engine : typeGraph . rootType == null ? 'circo' : 'dot' ,
17+ // @ts -expect-error FIXME should be fixed in dotviz
18+ engine : dot . graphAttributes . layout ,
1819 format : 'svg' ,
1920 } ,
2021 } ) ;
You can’t perform that action at this time.
0 commit comments