File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed
components/ProfilerPageCallGraph Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ import { defineComponent, PropType } from "vue";
7373import { Profiler , ProfilerEdge } from " ~/config/types" ;
7474import { addSlashes , DigraphBuilder } from " ~/utils/digraph-builder" ;
7575import debounce from " lodash.debounce" ;
76+ import destroy from " d3-graphviz/src/destroy" ;
7677
7778export default defineComponent ({
7879 components: { IconSvg },
@@ -92,7 +93,14 @@ export default defineComponent({
9293 };
9394 },
9495 created(): void {
95- this .renderGraph ();
96+ Graphviz .load ().then (() => {
97+ this .graph = graphviz (this .$refs .graphviz , {})
98+ .width (" 100%" )
99+ .height (" 100%" )
100+ .fit (true );
101+
102+ this .renderGraph ();
103+ });
96104 },
97105 beforeUnmount() {
98106 this .graph .destroy ();
@@ -159,19 +167,15 @@ export default defineComponent({
159167 });
160168 },
161169 renderGraph(): void {
162- Graphviz .load ().then (() => {
163- this .graph = graphviz (this .$refs .graphviz , {})
164- .width (" 100%" )
165- .height (" 100%" )
166- .fit (true )
167- .renderDot (
168- new DigraphBuilder (this .event .edges ).build (
169- this .metric ,
170- this .threshold
171- ),
172- this .nodeHandler
173- );
174- });
170+ this .graph
171+ .renderDot (
172+ new DigraphBuilder (this .event .edges ).build (
173+ this .metric ,
174+ this .threshold
175+ ),
176+ this .nodeHandler
177+ )
178+ .resetZoom ();
175179 },
176180 },
177181});
You can’t perform that action at this time.
0 commit comments