# Using the Wolfram language to interpret the Wolfram language?

I want to plot the relationship of all fucntions in Mathematica, maybe using Graph or force-directed-graph in D3.js

k =
DeleteCases[
WolframLanguageData[All, {"CanonicalName", "RelatedSymbols"}], {_, _Missing}];
k = MapAt[CanonicalName, k, {All, 2}];
data =
DeleteDuplicates[
Sort /@ Flatten[Thread[#[[1]] \[UndirectedEdge] #[[2]]] & /@ k]];
GraphPlot[data, VertexSize -> Tiny, ImageSize -> Full]


However, the figure is too big. Is there some method to zoom in on it and tooltip the vertices?

I tried Tooltip, However, it did not give a plot.

Graph[Tooltip[#, #] & /@ VertexList[data], data]


And how can I to use colors to distinguish these functions by catogeries such as Audio, Image and Core language?

Maybe I could use machine learning to distinguish these functions I tried but it didn't work out so good.

space =
VertexList[data] ->
DimensionReduce[
FeatureExtract[VertexList[data], {"SegmentedWords", "TFIDF"}],
1]];
space[[All, 2]] = Normalize[Flatten@space[[All, 2]]];
NumberLinePlot[space[[All, 2]]]


UPDATE:

Version: 12.1.1

These was already a demo in the NestGraph's document.

• This is already possible with WolframLanguageData without needing to dig up the help notebooks. There's an example of exactly what you want to do with the community graph right here: wolfram.com/xid/0bni7ixnhg3y6-8x6iz1 . Try this: WolframLanguageData["Sin", "RelationshipCommunityGraph"] Commented Aug 20, 2020 at 14:00
• @flinty Wow amazing.. :) Commented Aug 20, 2020 at 14:10
• Similar question from long ago: mathematica.stackexchange.com/questions/4343/… Commented Sep 26, 2020 at 13:54

Technical support CASE:4620942 (This has been resolved in v13.3)

\$Version

(* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *)

Clear["Global*"]


As suggested by flinty, running code from the documentation

graph = WolframLanguageData["Cos", "RelationshipCommunityGraph"]


The labels for the vertices do not render properly

Show[graph, ImageSize -> Large]


As a workaround, manually fix the labels

graph /. Style[lbl_, _List] :> lbl


Define a function that can extract neighbors with radius r around vertex n:

subgraph[g_, n_, r_] := Subgraph[g, AdjacencyList[g, n, r]~Join~{n}]


Let's take a look at the neighbors whose distance to the Sin function is 2

subg = subgraph[Graph[data], "Sin", 2];
GraphPlot[HighlightGraph[subg, {"Sin"}], VertexLabels -> "Name", ImageSize -> Large]


Export the graph data that will use in the following HTML:

json = {"nodes" ->
Table[{"id" -> i, "group" -> 1}, {i, VertexList@subg}],

Download the D3.js script index.html from D3.js v4 Force Directed Graph with Labels
Then in the terminal type the following (python3): python -m http.server
Then open http://localhost:8000/` in Chrome, the figure can drag the vertex interactively