Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions M2/Macaulay2/packages/Visualize.m2
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

newPackage(
"Visualize",
Version => "1.7",
Date => "May 3, 2025",
Version => "1.8",
Date => "October 27, 2025",
Authors => {
{Name => "Brett Barwick", Email => "[email protected]", HomePage => "http://faculty.uscupstate.edu/bbarwick/"},
{Name => "Thomas Enkosky", Email => "[email protected]", HomePage => "http://math.bu.edu/people/tomenk/"},
Expand Down Expand Up @@ -68,6 +68,10 @@ export {

-*

1.8 (2025-10-27, M2 1.25.11)
* use webpack to bundle most of the javascript libraries
* bootstrap 3 -> bootstrap 5

1.7 (2025-05-03, M2 1.25.05)
* update for leadTerm changes

Expand Down Expand Up @@ -539,7 +543,7 @@ copyJS(String) := opts -> dst -> (
if not match("/$", dst) then dst = dst | "/";
if not fileExists dst then makeDirectory dst;

dirs := {"js", "css", "fonts", "images"};
dirs := {"js", "css", "fonts"};
existingDirs := select(dirs, dir -> fileExists concatenate(dst, dir));

if #existingDirs > 0 and opts.Warning == true then (
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/packages/Visualize/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 0 additions & 5 deletions M2/Macaulay2/packages/Visualize/css/bootstrap-theme.min.css

This file was deleted.

5 changes: 0 additions & 5 deletions M2/Macaulay2/packages/Visualize/css/bootstrap.min.css

This file was deleted.

37 changes: 0 additions & 37 deletions M2/Macaulay2/packages/Visualize/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,43 +94,6 @@ text.id {
width: 120px;
}

.noUi-horizontal .noUi-handle {
width: 24px;
height: 18px;
left: -17px;
top: -6px;
}

.noUi-horizontal {
height: 14px;
}

/* Vertical lines on the handles */
.noUi-handle:before,
.noUi-handle:after {
content: "";
display: block;
position: absolute;
height: 10px;
width: 1px;
background: #E8E7E6;
left: 10px;
top: 3px;
}
.noUi-handle:after {
left: 12px;
}

.noUi-horizontal.noUi-extended {
padding-right: 20px;
}
.noUi-horizontal.noUi-extended .noUi-handle {
left: -2px;
}
.noUi-horizontal.noUi-extended .noUi-origin {
right: -32px;
}

.list-group-item.active > textarea {
color: #333;
}
4 changes: 0 additions & 4 deletions M2/Macaulay2/packages/Visualize/css/nouislider.min.css

This file was deleted.

22 changes: 0 additions & 22 deletions M2/Macaulay2/packages/Visualize/css/nouislider.tooltips.css

This file was deleted.

173 changes: 4 additions & 169 deletions M2/Macaulay2/packages/Visualize/digraph-example.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta charset="utf-8">
<title>Macaulay2: Digraph Visualization</title>
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<link href="css/BootSideMenu.css" rel="stylesheet"/>
<link href="css/nouislider.min.css" rel="stylesheet"/>
<link href="css/common.css" rel="stylesheet"/>
<link href="css/BootSideMenu.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">

<script>
//global variables
Expand Down Expand Up @@ -59,172 +57,9 @@ <h3>&#8202;&#8202;Menu</h3>
<div id="canvasElement2d"></div>
</div>

<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/visCommon.js"></script>
<script src="js/BootSideMenu.js"></script>
<script src="js/d3.v3.min.js"></script>
<script src="js/visDigraph2d.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/clipboard.min.js"></script>
<script src="js/nouislider.min.js"></script>

<script>

console.log(dataData);
console.log(labelData);
console.log(8080);

// Initialize clipboard.js.
var clipboard = null;

// $('#side').BootSideMenu({side:"right"});
$('#side').BootSideMenu({side:"right", closeOnClick: false, width: "230px"});

// When the side menu bar is opened or closed (i.e, when the "toggler" div is clicked), resize the svg appropriately so that nodes do not go behind the side menu.
document.getElementsByClassName("toggler")[0].addEventListener("mousedown", function() {
menuOpen = !menuOpen;
updateWindowSize2d();
}, false);

//document.getElementById("canvasElement2d").style.width = window.innerWidth;
//document.getElementById("canvasElement2d").style.height = window.innerHeight;

window.addEventListener("resize", updateWindowSize2d, false);

// Initialize sliders
var chargeSlider = document.getElementById('charge-slider');
noUiSlider.create(chargeSlider, {
start: [1500],
//tooltips: true,
range: {
'min': [0],
'max': [6000]
}
});
//chargeSlider.noUiSlider.on('update', updateForceCharge);

var linkDistSlider = document.getElementById('linkdist-slider');
noUiSlider.create(linkDistSlider, {
start: [100],
//tooltips: true,
range: {
'min': [0],
'max': [400]
}
});
//chargeSlider.noUiSlider.on('update', updateForceLinkDist);


$(document).ready(function(){

$("#editToggle").on("click", function(){
if(curEdit) {
$(this).html("Enable editing");
curEdit = !curEdit;
disableEditing();
} else {
$(this).html("Disable editing");
curEdit = !curEdit;
enableEditing();
}
});

$("#labelToggle").on("click", function(){
if(!labelsOn) {
$(this).html("Hide labels");
labelsOn = !labelsOn;
showLabels();
} else {
$(this).html("Show labels");
labelsOn = !labelsOn;
hideLabels();
}
});

$("#highlightToggle").on("click", function(){
if(curHighlight) {
$(this).html("Highlight neighbors");
unHighlightAll();
curHighlight = !curHighlight;
} else {
$(this).html("Disable highlighting");
enableHighlight();
curHighlight = !curHighlight;
}
});

$("#reset").on("click", resetGraph);

$("#forceToggle").on("click", toggleForce);

$("#exportTikz").on("click", function() {
exportTikz();
});

// Begin browser-M2 communication.
// For each item, a line in the function `onclickResults()`
// located in `visGraph2d.js` must be added.
//
// If you wish to delete the text to make it vanish when the graph is edited
// search for 'menuDefaults()'.

// Checks to see if user's graph has an Eulerian trail
$("#hasEulerianTrail").on("click", function() {
clickTest = "hasEulerianTrail";
makeCorsRequest('POST','http://localhost:'+portData+'/hasEulerianTrail/', digraph2M2Constructor(nodes,links));
});

// Checks to see if users graph is Eulerian
$("#isEulerian").on("click", function() {
clickTest = "isEulerian";
makeCorsRequest('POST','http://localhost:'+portData+'/isEulerian/', digraph2M2Constructor(nodes,links));
});

// Checks to see if users graph is strongly connected
$("#isStronglyConnected").on("click", function() {
clickTest = "isStronglyConnected";
makeCorsRequest('POST','http://localhost:'+portData+'/isStronglyConnected/', digraph2M2Constructor(nodes,links));
});

// Checks to see if users graph is weakly connected
$("#isWeaklyConnected").on("click", function() {
clickTest = "isWeaklyConnected";
makeCorsRequest('POST','http://localhost:'+portData+'/isWeaklyConnected/', digraph2M2Constructor(nodes,links));
});

// Ends the browser session and outputs the information to M2
$("#endSession").on("click", function() {
if(activeSession) {
//$(this).html("Session Terminated");
//$(this).html(<p style="color: #ffffff; background-color: #ff0000">Session terminated</p>);
document.getElementById("endSession").style.color = 'white';
document.getElementById("endSession").style.backgroundColor = 'red';
document.getElementById("endSession").innerHTML = "Session terminated";
makeCorsRequest('POST','http://localhost:'+portData+'/end/',digraph2M2Constructor(nodes,links));
activeSession = !activeSession;
} else {
return;
}
});

initializeBuilder();
disableEditing();
});


function toggleForce() {
if (forceOn) {
setAllNodesFixed();
document.getElementById("forceToggle").innerHTML = "Turn on force";
}
else {
setAllNodesUnfixed();
document.getElementById("forceToggle").innerHTML = "Turn off force";
}
forceOn = !forceOn;
}

</script>

</body>


Expand Down
13 changes: 0 additions & 13 deletions M2/Macaulay2/packages/Visualize/fonts/LICENSE

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading
Loading