Visualize - Macaulay2/Workshop-2015-Boise GitHub Wiki

The actual package is located in the following repo

https://github.com/b-stone/Visualize-M2

Synopsis

We would like to use various JavaScript libraries to visualize algebraic objects. For example, monomial ideals in two or three variables can be visualized on an integer lattice. With the Visualize.m2 package, a user can give M2 a monomial ideal and an interactive image of the lower boundary of the exponent set will be displayed in the default browser. We have also implemented this for graphs.

Examples

Goals

  1. Modify visIdeal for 3D
  2. get 2D ideal working (done)
  3. have detect 2D vs 3D pass error if not (done)
  4. edit scaling of output (done)
  5. pass variable labels in both 2D and 3D
  6. Change prospective for seeing dual
  7. Export Tikz code
  8. create moveLibrary method (done)
  9. create 'edit 2 var ideal' method
  10. modify visGraph
  11. Convert graphs from 2D to 3D (Elliot)
  12. create build graph method (Brett and Julio)
  13. add feature for loops and double edges
  14. create digraph method
  15. write documentation (Brett)
  16. Export from browser to M2
  17. maybe just have a text to copy and paste
  18. Make the following into a list.
  19. We would like to continue developing this package with visualizations of other objects such as (but not limited to): simplicial complexes, integral closure, posets, convex polyhedra, cones, and fans.
  20. Currently the communication of this package is one way. That is, M2 exports computations to an html file and then opens the file in a browser. We would like to be able to have the browser send information back to M2 as well. The ability to send information from the browser to M2 is demonstrated in the tutorial section of http://web.macaulay2.com/. On a mouse click, text is sent from a html file to a M2 session for computation. As a particular example, we would like the following actions: User inputs a graph G into M2; an interactive image is produced in the browser; the user adds vertices to edges to create a subdivision H of the graph G; this new graph H is then sent to M2 where the user can run further computations.
  21. With all visualized objects, we would like to create as many useful interactions as possible. For instance with the interactive graph we would like the following abilities: deleting edges and vertices; contracting edges; adding edges and vertices; ability to zoom into a section of a graph;

Accomplishments

Wed, 27 May
  • Wrote visPoset template.
Thur, 28 May
  • Wrote the Macaulay2 method to visualize a poset using the visPoset template.
  • Added FixExtremeElements option for visPoset method to arrange elements in the poset such that the minimal and maximal elements are in the same level.
  • Wrote visSimplicialComplex2D template.
  • Wrote the Macaulay2 method to visualize a 2D-simplicial complex using the visSimplicialComplex2D template.
  • Revised the layout of the visGraph template menu.
  • Worked on using ports to allow Macaulay 2 to communicate with a browser window.
  • Worked on commenting visGraph2d.js.
Fri, 29 May
  • Wrote Macaulay2 method to export a 3 dimensional simplicial complex. (still need to write a template)
  • Wrote Export to TikZ function for visGraph.
Sat, 30 May
  • Succeeded in a two-way communication between browser and M2;
  • Worked on implementation of Splines;
  • Started work on visualization of parametric surfaces;
  • Started adding more functionality to visualize Graph;

D3 Tutorials

Ideas

Splines

Some data for partitions in the plane.


Star of Vertex 2D
V = {{0,0},{1,0},{1,1},{-1,1},{-2,-1},{0,-1}};
F = {{0,2,1},{0,2,3},{0,3,4},{0,4,5},{0,1,5}};
E = {{0,1},{0,2},{0,3},{0,4},{0,5},{1,2},{2,3},{3,4},{4,5},{1,5}};


Schlegel Diagram Triangular Prism (nonsimplicial)
V={{-1,-1},{0,1},{1,-1},{-2,-2},{0,2},{2,-2}};
F={{0,1,2},{0,1,3,4},{1,2,4,5},{0,2,3,5}};
E={{0,1},{0,2},{1,2},{0,3},{1,4},{2,5},{3,4},{4,5},{3,5}};


Triangulation of Schlegel Diagram Triangular Prism
V={{-1,-1},{0,1},{1,-1},{-2,-2},{0,2},{2,-2}};
F={{0,1,2},{1,2,4},{2,4,5},{0,2,5},{0,3,5},{0,1,3},{1,3,4}};
E=unique flatten apply(F,f->subsets(s,2));

Schlegel Diagram of Cube
V={{-1,-1},{-1,1},{1,1},{1,-1},{-2,-2},{-2,2},{2,2},{2,-2}};
F={{0,1,2,3},{0,1,4,5},{1,2,5,6},{2,3,6,7},{0,3,4,7}};
E={{0,1},{1,2},{2,3},{0,3},{0,4},{1,5},{2,6},{3,7}};


Funky Pentagons
V={{-5,0},{-3,0},{-1,-4},{-1,4},{-1,-2},{-1,2},{0,-1},{0,1},{1,-2},{1,2},{1,-4},{1,4},{3,0},{5,0}};
F={{0, 1, 4, 2}, {0, 1, 5, 3}, {8, 10, 13, 12}, {9, 11, 13, 12}, {1, 4, 6, 7, 5}, {2, 4, 6, 8, 10}, {3, 5, 7, 9, 11}, {6, 7, 9, 12, 8}};
E={{0, 1}, {0, 2}, {0, 3}, {1, 4}, {1, 5}, {2, 4}, {2, 10}, {3, 5}, {3, 11}, {4, 6}, {5, 7}, {6, 7}, {6, 8}, {7, 9}, {8, 10}, {8, 12}, {9, 11}, {9, 12}, {10, 13}, {11, 13}, {12, 13}};