Message Boards Message Boards

Create interactive graph to visualize math theorems?

Posted 8 years ago

Hello!

I'm a Math student and I'm looking for a way to create a network of the theorems I'm studying by using GraphPlot. I want my theorems to be the edges of my graph.

So far so good. This isn't of course a big issue. But I have no idea about how to make my theorems appear (one or more theorems displayed at the same time in one or more windows after CTRL-clicking on them) by clicking on the edges of my graph.

I was thinking to save each and every theorem in .pdf and .txt format, but I think I'll use the .pdf format, which allows drawing diagrams and so on.

And then, is it possible to link different graphs?

One more question: Is there any way to have the edges of my graph linked to specific locations in an external file, e.g. a pdf?

Any idea?

I'm sure this is a very good way to study interconnected theorems, especially when studying for example Archimedes' or Euclid's works and the like.

Thank in advance for your suggestions!

POSTED BY: Franco Lorenzo
4 Replies
Posted 8 years ago

Hello Patrick!

Thanks for your detailed answer. Eller borde jag kanske säga "Tack så mycket" (jag bor i Sverige...).

I think I'd be better off using using a specialized network visualization application such as Gephi and/or Cytoscape. They're open source applications, as you probably know, and among the best ones.

But I must say that Mathematica is AWESOME (I started learning it a couple of months ago), but of course there's no application capable of doing everything and anything ;-).

Thanks again!

Franco

POSTED BY: Franco Lorenzo
Posted 8 years ago

Hello!

Thanks for your prompt answer and sorry for the capital letters. This was my first time post...

I need to know whether you can link the edges to specific points in an external file, not just open it.

Regards, Franco

POSTED BY: Franco Lorenzo

Hello Franco,

Mathematica provides you with the ability to open external files on your system and opening webpages using the SystemOpen function. However, once the request is sent for a file to be opened in an external program it is the external program that chooses how to open the file. For you to request that a program open a file at a specific location the external program must provide you with a way to send parameters to the program.

For web urls, you have a couple of options, https://www.wolfram.com/learningcenter/tutorialcollection/MathematicsAndAlgorithms/MathematicsAndAlgorithms.pdf#page=43 for example opens the pdf at page 43. Named destinations in pdf:s can also be used. # can also be used to reference specific parts of HTML documents when opened in a web browser.

When making calls to local resources, it is the operating system that handles these calls. On Windows at least, I don't think the system allows parameters to be passed when opening a local resource. Maybe this could work on some other platform.

For opening local resource I think you would need to open them from a command-line using the Run function from Mathematica and then passing parameters through switches if the program allows that. Using Adobe Reader the /A switch allows you to pass parameters. Using the following command works and opens the pdf on page 4:

Run["\"" <> pathToAdobe <> "Acrobat.exe\" /A page=4 " <> pathToDocument <> "Test.pdf"]

but then of course you need to know the path to the pdf program to be used and what kind of switches it supports, so that is not something that would be viable if you are intending on distributing the notebook.

If you are able to make the files accessible online I would recommend doing that and referencing them using SystemOpen. With Vitaliy:s example:

Graph[{Button[1 -> 2, SystemOpen["url.pdf#page=1"]], 2 -> 3, 3 -> 1}, 
 GraphStyle -> "SmallNetwork", DirectedEdges -> True]

Hope that helps.

Patrik

POSTED BY: Patrik Ekenberg

Please do NOT use all capital letters in post title, - other posts are not less important than yours. Make it a habit to read docs and show some of your own effort and code to solve the problem, even if it does not work. Also please try to limit one post to one question.

Simplest way is to define theorems in the notebook:

th1 = "Theorem 1
  ---------------
  Some text
  Some text";

th2 = "Theorem 2
  ---------------
  Some text
  Some text";

Then if you click on the edge:

Graph[{
  PopupWindow[1 -> 2, th1],
  PopupWindow[2 -> 3, th2],
  3 -> 1},
 GraphStyle -> "SmallNetwork",
 DirectedEdges -> True]

a popup window will appear:

enter image description here

To open an external file use Button instead of PopupWindow and put SystemOpen inside it.

POSTED BY: Vitaliy Kaurov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract