Overview
MathJet is a data analysis environment with a built-in full spreadsheet, a hybrid language engine, and a native interactive visualization engine — all running as a single C++ process with one shared memory space. This page explains what that means, why we built it that way, and what the design buys you.
The premise
Section titled “The premise”Most data analysis tools are chains of separate pieces glued together. A notebook talks to a kernel. The kernel talks to a plotting library. The plot comes back as an image. An Excel file sits on disk waiting to be written. Each handoff is serialization, duplicated state, and somewhere for things to break or drift out of sync.
MathJet is one program. The spreadsheet, the visualization engine, and the scripting runtime — Python, R, and MathJet’s own MATLAB-syntax-compatible interpreter — share one process, one memory space, and one execution context. There is no cross-process kernel dance because there is no other process.
This is the architectural premise the rest of the design follows from.
The four fusions
Section titled “The four fusions”MathJet’s design dissolves boundaries that fragment most data analysis tools, on four distinct layers.
1. Technologies are fused
Section titled “1. Technologies are fused”Spreadsheet, scripting runtime, and visualization engine are one C++ program with one memory space. Not separate processes communicating through files or kernels.
A NumPy array built in a Python cell and a column in the spreadsheet view are not two copies of the same data. They are one object, referenced from two places. Editing either side is editing the same memory. There is no synchronization step because there is nothing to synchronize.
2. Views are fused
Section titled “2. Views are fused”The same data is simultaneously a spreadsheet, a set of script variables, and the input to plots. Edit any of them and the others reflect it instantly.
Click a point on a chart; the corresponding cell in the graph companion table highlights. Drag a point to a new value; the underlying variable changes; downstream plots re-render. Resize a range in the spreadsheet; formulas that reference the range propagate.
3. Languages are fused
Section titled “3. Languages are fused”Python, R, .m files, Excel formulas, and MathJet’s own interpreter
share one runtime. A Python object is an R object is a spreadsheet
range is a plot input.
This is the layer where the polyglot formula bar lives — write
=numpy.mean(A1:A10) directly in a cell, alongside standard Excel
functions, alongside calls to a .m function defined earlier in the
session. The formula engine and the scripting engine are the same engine.
4. Workflows are fused
Section titled “4. Workflows are fused”GUI manipulations and script execution operate on the same shared state. Users can mix interactive exploration and scripted automation freely.
Full bidirectional equivalence — every GUI action capturable as script and every script action invokable through the GUI — is being expanded with each release. Today, action recording is shipped: click your way through an analysis and replay it as Python or R.
The workspace document
Section titled “The workspace document”Everything in a MathJet session — chart sheets, spreadsheets, data
sources, scripts, styles, bookmarks, even open-window layout — saves to
a single file: .mjw. The format is built on the Office Open XML
container (the same underlying spec as .xlsx and .docx), so the file
is ZIP-archive structured: parts inside, related to each other through
relationship XML.
Open an .mjw on another machine and you get the identical workspace —
open figures, open scripts, variable bindings, window layout. Send one
to a colleague and they see what you saw, not a screenshot of it.
What lives in a workspace
Section titled “What lives in a workspace”- Chart sheets (figures): one or more charts, each with axes, legends, markers, annotations.
- Spreadsheets (worksheets): cells, formulas, tables, and embedded charts.
- Data sources: top-level variables in the active interpreter, plus database connections.
- Scripts: full source text of any Python / R /
.mfiles created, imported, or recorded inside the session. - Styles: cell styles, table styles, chart styles.
- Bookmarks: external file references and links to data sources or other workspaces.
The visualization element hierarchy
Section titled “The visualization element hierarchy”Visualization in MathJet is structured at three levels. Understanding the hierarchy makes the GUI and the API both make sense.
| Level | What it is |
|---|---|
| Graph | The basic visualization element — a single rendered representation of a series of data elements. Scatter, line, bar, contour, surface, etc. |
| Chart | A flat, usually rectangular surface holding one or more graphs. Has its own coordinate system, axes, title, legend, gridlines. (Sometimes called an “axes” in other tools.) |
| Sheet | A page in a visualization. Holds one or more charts in a layout. Can be detached as a floating window, docked, undocked, printed. |
A workspace can have any number of sheets; a sheet any number of charts; a chart any number of compatible graphs.
The user interface, briefly
Section titled “The user interface, briefly”The MathJet GUI is organized around a central tab widget for the current document (a chart sheet, a spreadsheet, or a script editor) and a set of dockable tool / data windows around it.
The most important tool windows for understanding the design:
- Workspace Manager — tree view of every object in the session (sheets, charts, graphs, variables, styles). Click a node to inspect it; right-click for context actions.
- Properties Editor — shows the editable properties of whatever object has focus. Change a property here and the object updates immediately.
- Command Editor — interactive REPL. The default interpreter is MathJet’s own, but you can switch to Python, R, or another language per the active session.
- Command History — every command run in the current and previous sessions, timestamped. Re-run any line by selecting it.
- Graph Companion — the data backing the active chart, shown in a table that stays synchronized with the chart in both directions.
- Global Variables / Local Variables / Watch — three views of in-memory state at different scopes. Edit a value here to update the underlying object.
- Call Stack / Breakpoints — debugger UI for stepping through any supported language’s scripts.
What this design buys you
Section titled “What this design buys you”The four-fusion architecture and the unified workspace document are not ends in themselves; they enable concrete capabilities that would be hard or impossible to deliver in a chain-of-tools setup:
- Live linking between cell, code, and plot — because they share state, not because of a sync engine.
- The polyglot formula bar — because the formula engine is the scripting engine.
- Patented interactive visualization features like axis folding, graphical value editing, and interactive data grouping — because the visualization engine has direct access to the spreadsheet and the scripting runtime in real time.
- Cross-platform
.mjwportability — because there’s no per-environment kernel state to recreate.
The reverse is also true: a tool whose architecture isn’t fused on these layers can’t easily ship the features that depend on fusion. The design is the differentiator.