Sasidhar commited on
Commit
6bc8d33
·
verified ·
1 Parent(s): 1edbc6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -40
app.py CHANGED
@@ -16,10 +16,10 @@ step_details = {
16
  }
17
  node_data = json.dumps(step_details)
18
 
 
19
  html_content = f"""
20
  <div id="cy" style="width: 100%; height: 500px; border:1px solid #ccc;"></div>
21
 
22
- <!-- Tooltip -->
23
  <div id="tooltip" style="
24
  display:none;
25
  position:absolute;
@@ -34,10 +34,9 @@ html_content = f"""
34
  z-index: 10;
35
  "></div>
36
 
37
- <!-- Load Cytoscape and dagre extension -->
38
  <script src="https://unpkg.com/[email protected]/dist/cytoscape.min.js"></script>
39
  <script src="https://unpkg.com/[email protected]/dist/dagre.min.js"></script>
40
- <script src="https://unpkg.com/[email protected]/cytoscape-dagre.js"></script>
41
 
42
  <script>
43
  const stepDetails = {node_data};
@@ -46,40 +45,4 @@ cytoscape.use(window.cytoscapeDagre);
46
 
47
  const cy = cytoscape({{
48
  container: document.getElementById('cy'),
49
- layout: {{
50
- name: 'dagre',
51
- rankDir: 'LR', // Left to Right
52
- nodeSep: 50,
53
- edgeSep: 30,
54
- rankSep: 100
55
- }},
56
- style: [
57
- {{
58
- selector: 'node',
59
- style: {{
60
- 'label': 'data(label)',
61
- 'text-valign': 'center',
62
- 'text-halign': 'center',
63
- 'background-color': '#0077B6',
64
- 'color': 'white',
65
- 'font-size': '14px',
66
- 'text-wrap': 'wrap',
67
- 'text-max-width': 100,
68
- 'shape': 'roundrectangle',
69
- 'padding': '10px'
70
- }}
71
- }},
72
- {{
73
- selector: 'edge',
74
- style: {{
75
- 'width': 3,
76
- 'line-color': '#aaa',
77
- 'target-arrow-color': '#aaa',
78
- 'target-arrow-shape': 'triangle'
79
- }}
80
- }}
81
- ],
82
- elements: [
83
- {{ data: {{ id: 'lodged', label: '1. Claim Lodged' }} }},
84
- {{ data: {{ id: 'fraud', label: '2. Fraud Check' }} }},
85
- {{ data:
 
16
  }
17
  node_data = json.dumps(step_details)
18
 
19
+ # 👇 Use triple quotes carefully — this version closes correctly
20
  html_content = f"""
21
  <div id="cy" style="width: 100%; height: 500px; border:1px solid #ccc;"></div>
22
 
 
23
  <div id="tooltip" style="
24
  display:none;
25
  position:absolute;
 
34
  z-index: 10;
35
  "></div>
36
 
 
37
  <script src="https://unpkg.com/[email protected]/dist/cytoscape.min.js"></script>
38
  <script src="https://unpkg.com/[email protected]/dist/dagre.min.js"></script>
39
+ <script src="https://unpkg.com/[email protected]/cytoscape-dagre.min.js"></script>
40
 
41
  <script>
42
  const stepDetails = {node_data};
 
45
 
46
  const cy = cytoscape({{
47
  container: document.getElementById('cy'),
48
+ layout: