Spaces:
Sleeping
Sleeping
alexanderHSG commited on
Commit ·
5c915b0
1
Parent(s): ec474dd
Update app.py
Browse files
app.py
CHANGED
|
@@ -207,13 +207,12 @@ RETURN sd, r1, s, r2, sp, sp_start, rel, sp_end
|
|
| 207 |
#viz {{
|
| 208 |
width: 1200px;
|
| 209 |
height: 700px;
|
| 210 |
-
border:
|
| 211 |
background-color: #f0f0f0; /* Lighter grey background for the viz div */
|
| 212 |
-
padding:
|
| 213 |
}}
|
| 214 |
.heading {{
|
| 215 |
font-size: 24px;
|
| 216 |
-
font-weight: bold;
|
| 217 |
text-align: center;
|
| 218 |
margin-bottom: 20px;
|
| 219 |
}}
|
|
@@ -223,7 +222,7 @@ RETURN sd, r1, s, r2, sp, sp_start, rel, sp_end
|
|
| 223 |
</style>
|
| 224 |
</head>
|
| 225 |
<body>
|
| 226 |
-
<h1 class="heading">Visualization of
|
| 227 |
<div id="viz">
|
| 228 |
<p id="queryCypher">{query}</p>
|
| 229 |
</div>
|
|
@@ -390,12 +389,7 @@ async () => {
|
|
| 390 |
console.error('Error rendering NeoVis:', error);
|
| 391 |
}
|
| 392 |
|
| 393 |
-
|
| 394 |
-
if (button) {
|
| 395 |
-
button.addEventListener('click', draw);
|
| 396 |
-
} else {
|
| 397 |
-
console.error('Button not found.');
|
| 398 |
-
}
|
| 399 |
|
| 400 |
}
|
| 401 |
|
|
@@ -419,12 +413,12 @@ function handleMutations(mutations) {
|
|
| 419 |
if (mutation.type === 'childList') {
|
| 420 |
const drawElement = document.getElementById('viz');
|
| 421 |
if (drawElement) {
|
|
|
|
| 422 |
var element = document.getElementById('queryCypher'); // Access the element by its ID
|
| 423 |
var text = element.innerText;
|
| 424 |
draw(text);
|
| 425 |
-
console.log('Call draw function.');
|
| 426 |
// Disconnect the observer after clicking the drawElement is found
|
| 427 |
-
observer.disconnect();
|
| 428 |
return;
|
| 429 |
}
|
| 430 |
}
|
|
@@ -451,8 +445,6 @@ console.log("Observer is set to monitor changes in the document body.");
|
|
| 451 |
"""
|
| 452 |
|
| 453 |
|
| 454 |
-
|
| 455 |
-
|
| 456 |
## GRADIO UI LAYOUT & FUNCTIONALITY
|
| 457 |
## ---------------------------------------------------------------------------------------------------------------------
|
| 458 |
|
|
|
|
| 207 |
#viz {{
|
| 208 |
width: 1200px;
|
| 209 |
height: 700px;
|
| 210 |
+
border: 2px solid black; /* Adds a border around the viz div */
|
| 211 |
background-color: #f0f0f0; /* Lighter grey background for the viz div */
|
| 212 |
+
padding: 10px; /* Adds padding inside the div */
|
| 213 |
}}
|
| 214 |
.heading {{
|
| 215 |
font-size: 24px;
|
|
|
|
| 216 |
text-align: center;
|
| 217 |
margin-bottom: 20px;
|
| 218 |
}}
|
|
|
|
| 222 |
</style>
|
| 223 |
</head>
|
| 224 |
<body>
|
| 225 |
+
<h1 class="heading">Visualization of Your Retrieved Slide Graph</h1>
|
| 226 |
<div id="viz">
|
| 227 |
<p id="queryCypher">{query}</p>
|
| 228 |
</div>
|
|
|
|
| 389 |
console.error('Error rendering NeoVis:', error);
|
| 390 |
}
|
| 391 |
|
| 392 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
|
| 394 |
}
|
| 395 |
|
|
|
|
| 413 |
if (mutation.type === 'childList') {
|
| 414 |
const drawElement = document.getElementById('viz');
|
| 415 |
if (drawElement) {
|
| 416 |
+
console.log('Call draw function.');
|
| 417 |
var element = document.getElementById('queryCypher'); // Access the element by its ID
|
| 418 |
var text = element.innerText;
|
| 419 |
draw(text);
|
|
|
|
| 420 |
// Disconnect the observer after clicking the drawElement is found
|
| 421 |
+
//observer.disconnect();
|
| 422 |
return;
|
| 423 |
}
|
| 424 |
}
|
|
|
|
| 445 |
"""
|
| 446 |
|
| 447 |
|
|
|
|
|
|
|
| 448 |
## GRADIO UI LAYOUT & FUNCTIONALITY
|
| 449 |
## ---------------------------------------------------------------------------------------------------------------------
|
| 450 |
|