Function Repository Resource:

ShortInputForm

Source Notebook

Explore the low-level structure of Wolfram Language expressions with an easy-to-read concise representation

Contributed by: Alexey Popkov

ResourceFunction["ShortInputForm"][expr]

produces terse version of expr intended for inspecting its low-level structure.

Details

ResourceFunction["ShortInputForm"] is intended for use within the Notebook interface.
ResourceFunction["ShortInputForm"][expr] produces a two-dimensional representation of expr, which may be immediately used as input.
Compound-type atomic objects like Image, Graph or NumericArray are kept untouched when they are present as a part of the supplied expression. Such objects can be converted into the corresponding input expressions by applying ResourceFunction["ShortInputForm"] to them directly.
ResourceFunction["ShortInputForm"][expr, Unevaluated] converts most compound-type atomic objects in expr into shortened input expressions. Compact low-level data representations like NumericArray and ByteArray are still kept untouched. They can also be converted by applying ResourceFunction["ShortInputForm"] to them directly.
For Graphics and Graphics3D objects, ResourceFunction["ShortInputForm"] removes duplicate options and sorts the options list.

Examples

Basic Examples (2) 

Display the structure of a Graph expression's input form:

In[1]:=
ResourceFunction["ShortInputForm"][RandomGraph[{100, 100}]]
Out[1]=

Explore the low-level structure of a graphics object produced by Plot. Try selecting subexpressions with the mouse, navigating with keyboard shortcuts, copying and editing code:

In[2]:=
Plot[{Sin[x], Sin[2 x], Sin[3 x]}, {x, 0, 2 Pi}, PlotLegends -> "Expressions"] // ResourceFunction["ShortInputForm"]
Out[2]=

Copy a subexpression from above and use it in Graphics:

In[3]:=
Line[{{1.2822827157509358`*^-7, 2.5645654315018436`*^-7}, Apply[
   Sequence, CompressedData["
1:eJwVmHk4VO8bxhkq2QaZsSZakEqryjd6n4QKlWRpIVJaRVRKthahTQhFipSS
fYmKeIWiRdmSfTdmjJnXrqy/8/tnzvW5zjnXPM993897znvUHF0tnGgCAgIf
qZ//H5dxCreoPLRHv0wWKys8dEUTGauPN4S5IhYYs0rD/FCP7Km/udRx+Y4Z
QaewB6jR2L84gTquUBvm2YXGot/2YRpPw2IRvfDwfN/76cjCWaHxcVg6Mk3e
eHKRL0ahQ7bZkWEYxV21/dQOv9CWzyaiBhcq0ca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DtUY8u5OHC
ifuOr2bk4bG12PrOV5n4c9qizCYBBUgSOxvVfC8D/3DMnJUSUgC/iNsJt3rS
cNO32hiveQqwpmmVXoZ3Ev4brfTHXEoBUstOXHj05jme3ZO6LEBGAS5dTjix
nPMMzxVCF/NlFcDY7uemGd9oLHvWUVpdQQEakb6VWVIoVlo0Yn9YSQGuHGR/
i/O7gxfX3EoLWagAZenPnwYlXcdagXLTnxcpgKGh5s+cJDe8dssb00k1BZha
c/9nl05o4f8A5CtAfg==
"]]}] // Graphics
Out[3]=

Applications (2) 

Compare the internal structure of similar objects generated in different ways:

In[4]:=
{ListPlot3D[Table[Sin[x + y^2], {y, -2, 2, 1}, {x, -3, 3, 1}], Mesh -> None, Axes -> False, Boxed -> False], Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, Mesh -> None, Axes -> False, Boxed -> False, PlotPoints -> {7, 5}, MaxRecursion -> 0]}
Out[4]=
In[5]:=
ResourceFunction["ShortInputForm"] /@ %
Out[5]=

Check the result of applying Normal to a graphics object:

In[6]:=
pl = PointValuePlot[Table[RandomReal[10, 2] -> RandomReal[], 5], ColorFunction -> "Rainbow"];
plNormalized = Normal@pl;
ResourceFunction["ShortInputForm"]@pl
Out[8]=
In[9]:=
ResourceFunction["ShortInputForm"]@plNormalized
Out[9]=

Properties and Relations (4) 

InputForm always produces a one-dimensional representation of the expression in the form of pure text, suitable to be typed as Wolfram Language input via text-based interface. Within the notebook interface, semantic selection and code highlighting aren't available with InputForm expressions:

In[10]:=
im = Image[RandomInteger[1, {10, 10}]]
Out[10]=
In[11]:=
im // InputForm
Out[11]=

ShortInputForm produces shortened two-dimensional output, suitable to be used as input within the notebook interface. Semantic selection and code highlighting are turned on by default:

In[12]:=
im // ResourceFunction["ShortInputForm"]
Out[12]=

Special forms like NumericArray by default are kept untouched for readability, but can also be converted by applying ShortInputForm to them separately:

In[13]:=
ResourceFunction["ShortInputForm"][im] /. na_NumericArray :> ResourceFunction["ShortInputForm"][na]
Out[13]=
In[14]:=
NumericArray[CompressedData["
1:eJxTTMoPSmNiYGAo5gASQYnljkVFiZXBbCBOamKOsVEOSJILiiGgwZ4BA8DE
QDQMI8uhi2ETx6UHmzyx5hAD0PWim4PLb7j8hW42PjPIkUOoAQDnySvl
"],"Real32"] // ResourceFunction["ShortInputForm"]
Out[14]=

Such forms usually can be converted to normal expressions by applying Normal:

In[15]:=
NumericArray[CompressedData["
1:eJxTTMoPSmNiYGAo5gASQYnljkVFiZXBbCBOamKOsVEOSJILiiGgwR6VRhbH
JoYNIKuFsbFhfObiUkOsOehsfOYRcjs+tyGbQchtxOhD8AHOCjNb
"],"Real32"] // Normal
Out[15]=

Possible Issues (3) 

By default ShortInputForm[expr] keeps untouched compound-type atomic objects when they are part of the supplied expression:

In[16]:=
expr = {RandomImage[1, {50, 40, 20}], DelaunayMesh[RandomReal[1, {7, 3}]], Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1}], SparseArray[{{5}} -> 1, {6}], NumericArray[RandomReal[1, {5, 5}], "Real64"]};
AtomQ /@ expr
Out[17]=
In[18]:=
ResourceFunction["ShortInputForm"][expr]
Out[18]=

Use ShortInputForm[expr, Unevaluated] to convert most of them into actual input expressions revealing their low-level structure:

In[19]:=
ResourceFunction["ShortInputForm"][expr, Unevaluated]
Out[19]=

Alternatively, apply ShortInputForm to the atomic objects directly:

In[20]:=
ResourceFunction["ShortInputForm"] /@ expr
Out[20]=

Neat Examples (3) 

Box structure inspection (1) 

Explore box structures generated by ToBoxes taking advantage of the easy-to-read representation generated by ShortInputForm:

In[21]:=
Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1}] // ToBoxes // ResourceFunction[
 "ShortInputForm"]
Out[21]=

PDF formatting (2) 

Create an auxiliary function that exports a supplied expression to "PDF" and then immediately imports the results as vector graphics:

In[22]:=
vectorExportImportPDF[expr_] := First@ImportString[
   ExportString[expr, "PDF", "AllowRasterization" -> False], If[$VersionNumber >= 12.2, {"PDF", "PageGraphics"}, {"PDF", "Pages"}], "TextOutlines" -> False]; graphics2D = Plot[Sin[x], {x, 0, 10}, Axes -> False]
Out[22]=

Inspect the internal contents of returned graphics with ShortInputForm:

In[23]:=
graphics3D = ListPlot3D[{{0, 0, 1}, {1, 0, 0}, {0, 1, 0}}];
ResourceFunction["ShortInputForm"][vectorExportImportPDF[graphics2D]]
Out[24]=
In[25]:=
ResourceFunction["ShortInputForm"][vectorExportImportPDF[graphics3D]]
Out[25]=

Publisher

AlexeyPopkov

Version History

  • 1.1.1 – 20 September 2022
  • 1.1.0 – 15 February 2022
  • 1.0.0 – 11 January 2022

Source Metadata

Related Resources

License Information