|
19 | 19 | const saveSelectionAsPngButton = document.getElementById('saveSelectionAsPngButton');
|
20 | 20 | const selectionLayer = document.getElementById('selectionLayer');
|
21 | 21 | const helpTextDiv = document.getElementById('helpText');
|
| 22 | + const refreshDiv = document.getElementById('refresh'); |
22 | 23 | const vscode = acquireVsCodeApi();
|
23 | 24 | let doShowPopup = false;
|
24 | 25 | let lastMouseX = lastMouseY = 0;
|
|
34 | 35 | saveSelectionAsPngButton.addEventListener('click', saveSelectionAsPng);
|
35 | 36 | showLayoutOptionsCheckbox.addEventListener('click', showHierarchicalOptions);
|
36 | 37 | layoutSelect.addEventListener('change', setNetworkLayout);
|
| 38 | + refreshDiv.addEventListener('click', setNetworkLayout); |
37 | 39 |
|
38 | 40 | function mouseUpEventListener(event) {
|
39 | 41 | // Convert the canvas to image data that can be saved
|
|
326 | 328 | componentSpacing: 5,
|
327 | 329 | numIter: 5000,
|
328 | 330 | };
|
| 331 | + refreshDiv.style.display = 'inline-block'; |
| 332 | + refreshDiv.style.cursor = 'pointer'; |
329 | 333 | } else if (layoutSelect.value === 'circle' || layoutSelect.value === 'grid') {
|
330 | 334 | options = {
|
331 | 335 | name: layoutSelect.value,
|
332 | 336 | spacingFactor: 0.5,
|
333 | 337 | padding: 1
|
334 | 338 | };
|
335 |
| - } |
| 339 | + } else if (layoutSelect.value === 'random') { |
| 340 | + refreshDiv.style.display = 'inline-block'; |
| 341 | + refreshDiv.style.cursor = 'pointer'; |
| 342 | + } |
| 343 | + if (layoutSelect.value !== 'cose' && layoutSelect.value !== 'random') { |
| 344 | + refreshDiv.style.display = 'none'; |
| 345 | + refreshDiv.style.cursor = 'default'; |
| 346 | + } |
336 | 347 | if (layoutSelect.value === 'preset') {
|
337 | 348 | restoreCoordinates(cy);
|
338 | 349 | }
|
|
0 commit comments