You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ha...@apache.org on 2018/01/17 09:07:42 UTC

[incubator-skywalking-ui] branch feature/5.0.0 updated: Resize trace stack

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch feature/5.0.0
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git


The following commit(s) were added to refs/heads/feature/5.0.0 by this push:
     new da5a159  Resize trace stack
da5a159 is described below

commit da5a159ef20dcf2ad04333ee0fb262a24f4df7a4
Author: hanahmily <ha...@gmail.com>
AuthorDate: Wed Jan 17 17:04:24 2018 +0800

    Resize trace stack
---
 src/main/frontend/src/components/TraceStack/index.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/main/frontend/src/components/TraceStack/index.js b/src/main/frontend/src/components/TraceStack/index.js
index 5f09634..f9f183e 100644
--- a/src/main/frontend/src/components/TraceStack/index.js
+++ b/src/main/frontend/src/components/TraceStack/index.js
@@ -48,6 +48,7 @@ class TraceStack extends PureComponent {
     this.state.width = this.axis.parentNode.clientWidth - 50;
     this.drawAxis();
     this.displayData();
+    window.addEventListener('resize', this.resize);
   }
   buildNode = (span, index) => {
     const { nodes, colorMap, idMap } = this.state;
@@ -173,6 +174,16 @@ class TraceStack extends PureComponent {
     });
   }
   showSpanModal = () => {}
+  resize = () => {
+    this.state.width = this.axis.parentNode.clientWidth - 50;
+    if (!this.axis || this.state.width <= 0) {
+      return;
+    }
+    this.axis.innerHTML = '';
+    this.duration.innerHTML = '';
+    this.drawAxis();
+    this.displayData();
+  }
   render() {
     const { colorMap } = this.state;
     const legendButtons = Object.keys(colorMap).map(key =>

-- 
To stop receiving notification emails like this one, please contact
['"commits@skywalking.apache.org" <co...@skywalking.apache.org>'].