Skip to content

Data Source Window

The Data Source Window lists currently-open data sources: external data files and connections to databases. The visual layout mirrors the Environment Window — same cell blocks, same optional statistics, same drag-and-drop into spreadsheets — so the muscle memory transfers directly.

Detailed numerical values from open data sources are shown in a tabular arrangement using ordered cell blocks. Drag a variable cell block into a spreadsheet data widget, or create it directly inside a spreadsheet.

A cell block represents a rectangular area of related cells, managed and referenced independently from the rest of the data source. Cell blocks are views — not separate data entities — so changes to the underlying value are reflected immediately.

  • Scalars are shown adjacent to their name in the header row.
  • Arrays, lists, dataframes are summarized in the header, with full numerical values revealed via an expansion button. Layout is rows or columns, auto-determined or user-specified.
  • High-dimensional values can have child blocks inside the parent block’s body.

Sparklines and descriptive statistics as column headers

Section titled “Sparklines and descriptive statistics as column headers”

For values with more than one row, columns can display sparklines and descriptive statistics as their headers.

Apply table styles for the visual treatment you want. Beyond conventional banded styles, MathJet offers options that encode numerical values as cell background or foreground color for quick visualization.

Two filtering modes via the Filtering Operation Type sub-menu:

  • Filter List by Name — only items whose names match the keyword in the Filter text box are visible.
  • Highlight Values — items whose values match the criterion are highlighted yellow; the rest are greyed out.

In Highlight Values mode, the criterion is auto-determined (e.g., 0.5:1.5 becomes “between 0.5 and 1.5”) but can be overridden via Filtering Condition.

Pick from Hierarchical 2D Matrices, Continuous 2D Matrices, Continuous Rows, Continuous Columns, Single Row, or Single Column — same set of options as in the Environment Window.

Data outlining (expand / collapse on each item) is on by default and can be disabled.

Beyond open files, the Data Source Window manages live connections to SQL databases. A connection is opened from the pane’s Import Data drop-down (choose From Database) and appears as its own node, expandable into the database’s schema.

MathJet connects to SQLite, PostgreSQL, MySQL / MariaDB, SQL Server, and Oracle. SQLite connects to a single database file; the server engines take a host, port, database name, and credentials (username / password, with an optional save-password flag). Once connected, browsing, editing, querying, and importing behave the same across every engine.

A connection node expands into the database’s tables, and each table into its columns. The tree is populated lazily — a table’s rows are not fetched until it is opened — so large databases stay responsive.

Opening a table shows its rows in a specialized worksheet. Edits made there — changing a cell, inserting a row, deleting a row — are held in a local cache and propagate to any linked charts and variables, but are not written to the database until you Save. A Save flushes the pending change set in a single transaction (INSERT / UPDATE / DELETE).

To identify the database row behind a cached edit, MathJet uses the table’s primary key, or an implicit row identifier (SQLite rowid, PostgreSQL ctid) when there is no primary key. A table with neither can be read but not edited in place.

A table worksheet can switch to a column-list view showing one row per column — name, SQL type, nullability, primary-key membership, and default. Structural edits here (rename / add / drop a column) are likewise deferred and applied on Save as ALTER TABLE statements, in the same transaction as any row edits.

For arbitrary SQL, a connection opens a SQL script pane: a SQL editor above a results area. Executing runs the editor’s statements against the connection (or only the selected text) and shows each result set as a table, with a status line summarizing row counts or reporting errors. Queries run against the committed database — they do not see unsaved cache edits from open table worksheets.

Any table or query result can be turned into a workspace variable with the same Create Variable dialog used for worksheet cell ranges — the Data Source field is pre-filled from the table or result. A variable created from a table worksheet links to its cache; one created from a query result is a snapshot taken at execution time. The status-bar Save Changes button commits the active table’s pending edits; File → Save commits all open database tables; for a file-backed database (SQLite), Save As writes the whole database out to a new file.

  • Environment Window — the parallel window for in-memory variables and functions.
  • File Browser — for navigating to data files before opening them.