-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from SigNoz/refactor-gant-chart
refactor(FE: trace-gantt-chart): add ts support and change folder structure
- Loading branch information
Showing
9 changed files
with
114 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
frontend/src/modules/Traces/TraceGanttChart/TraceGanttChart.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.row-styles { | ||
cursor: pointer; | ||
} | ||
.hide { | ||
display: none; | ||
} | ||
.ant-tabs-nav-list { | ||
justify-content: space-between; | ||
width: 100%; | ||
} | ||
.ant-table-body table { | ||
margin-bottom: 64px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
frontend/src/modules/Traces/TraceGanttChart/TraceGanttChartHelpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { isEmpty } from "lodash-es"; | ||
import { pushDStree } from "Src/store/actions"; | ||
|
||
interface itemProps { | ||
treeData: pushDStree[]; | ||
marked: boolean; | ||
} | ||
|
||
// Doing DFS traversal on the tree. | ||
// Callback to be called for each element in the tree once. | ||
const traverseTreeData = ( | ||
tree: pushDStree[], | ||
callback: (item: pushDStree) => void, | ||
): void => { | ||
if (isEmpty(tree) || tree[0].id === "empty") return; | ||
let node = { treeData: tree, marked: false }; | ||
let stk: [itemProps] = [node]; | ||
|
||
while (!isEmpty(stk)) { | ||
let x = stk[stk.length - 1]; | ||
|
||
// marked means seeing the node for the second time. | ||
if (x.marked) { | ||
x.marked = false; | ||
stk.pop(); | ||
x.treeData.map((item: pushDStree) => { | ||
callback(item); | ||
}); | ||
} else { | ||
x.marked = true; | ||
x.treeData.map((item) => { | ||
if (item.children.length > 0) { | ||
stk.push({ treeData: item.children, marked: false }); | ||
} | ||
}); | ||
} | ||
} | ||
}; | ||
|
||
export default traverseTreeData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./TraceGanttChart"; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters