[Mesa-users] Enhancements to MESA Explorer

Wolf, William M WOLFWM at uwec.edu
Mon Jul 21 11:46:42 UTC 2025


Hello MESA users!

Today I'm announcing vast updates to MESA Explorer (billwolf.space/mesa-explorer). For the unfamiliar, MESA Explorer is a web-based tool that makes visualizing output from MESA (profiles, histories, and GYRE summaries) very fast, easy, and code-free. Below I'll give a few highlights of some of the many changes.

Support for more series and legends
You can now add an arbitrary number of series to a plot of data from a single file. You are still limited to one x-axis series, but along both the left and right y-axes, you may keep adding more and more series to plot against that single x series. (Previously you were limited to one series per axis.) A legend is now automatically created whenever there is more than one series.  You can move the legend freely around the plot area, though you cannot get rid of it unless you go down to just one series.

Support for simultaneously plotting multiple files
You may now choose between a single-file mode (the old default behavior) and a new multi-file mode, which allows plotting the same series for multiple files. This can quickly get out of hand (the number of lines on the plot will be product of the number of files and the number of series plotted), but you can plot several series for each file against both y-axes. For instance, you could be plotting data from three separate profiles at the same time. For each profile, you could plot the hydrogen abundance and helium abundance against the left y-axis and the temperature against the right y-axis. Different *files* will be represented with different colors (same color for all series associated with that file), while the different series will have different line styles. The legend will link files with their respective colors used in the plot, and it will also contain a line/label for each series plotted on a y-axis in a neutral color, but with the appropriate line style.

Within the file panel, once you have switched to multi-file mode, you may select multiple files of the same time (history, profile, or summary). Once you've selected at least one, a "select all" checkbox will select all files of the same type as the currently-selected file only. So if you’ve uploaded one history and three profiles, selecting one profile and then hitting “select all files” will select all profiles, but not the history.

When in single-file mode (and while no text fields are actively being edited), the up and down arrow keys on your keyboard will cycle through files in the order they appear in the file manager (profiles are automatically sorted by model number so they are in time order). This is great for watching the evolution of multiple profiles in time, though you may wish to fix the axis limits for a clearer picture.

More, richer, and automated labeling
You may now add labels to each file in the file manager. This helps distinguish between multiple history files when you switch between different files, but it will also update the legend labels in multi-file mode (so instead of "profile1" and "profile2", you could have "ZAMS" and "TAMS", for instance). Additionally, there are separate labels for series and axes. Series labels apply to legends, while axis labels go on the axes. Previously we only had axis labels.

MESA Explorer is built on SVG (scalable vector graphics), which does not include LaTeX-like syntax for text. However, I've been able to get simple subscripts and superscripts working with the syntax _{*subscript*} and ^{*superscript*}. You MUST use the curly braces, even if there is only one character. Accordingly, the logarithmic axis tick labels now use powers of 10 that mostly look better than the previous letter-based ones (ex. "p" now renders 10^{-12}). Everything must rely on unicode characters.

There are also now files for history and profile column names that give initial guesses for axis labels, series labels, units, and whether data should be exponentiated (to "unlog" it) and whether it should be displayed with logarithmic axes. Upon being selected in a dropdown, this should apply the proper data transformations, axis scaling, series label, and axis label (axis label defaults to the series label plus units if it's the only series, and defaults to a more generic axis label when there are more than one series assigned to an axis). You may, of course, customize all of these initial guesses. The goal is that you don't have to think about axis and legend labels most of the time; they just show up for stock columns.

These defaults files were generated by setting an LLM loose on the MESA output defaults files and asking it to make educated guesses for each one. It did a pretty good job, but I'm certain that there are some duds in there, as I have not gone over the file very carefully.

Streamlined Layout
Once you are done selecting files to visualize, the files panel is a bit of a nuisance. There is now a button at the top to minimize this panel to a region just below the plot that will tell you what file you are currently viewing, freeing up more horizontal real estate in the browser for the plot and controls.

Previously, the plot area was "sticky" and would always stay at the top of the viewport, regardless of your scrolling down. This was helpful for seeing changes as they were made in the controls below, but they made for a tiny working area for those said controls. Now, the plot stays put as you scroll, and once you scroll down enough, a less intrusive preview appears in the upper right corner of the viewport.

The series and axis controls below the plot have been restructured with the ability to add (and remove) additional series to y-axes, and some axis controls have been minimized at the top of the respective panels. Click the chevron below the main axis label to set the axis scale and limits. A convenient invert button to the right of the limits allows rapidly swapping the limits of an axis; handy for getting HR diagrams quickly.

Interactivity and Download Enhancements
Just below the plotting area are a series of tools you can select for interacting with the plot canvas. By default, the inspector is selected. It causes a box to follow the mouse around on the canvas so you can get more precise values read off the axes at different points. A new box zoom tool lets you zoom into regions you select on the plot by drawing a rectangle on the current view, but you can always fine-tune these limits by explicitly setting them in the "Axis Settings" section below. A pan tool lets you scoot around a zoomed plot, though it's not the smoothest experience as points out of view aren't rendered until you stop panning. A "reset" button sets the limits back to their defaults.

Below the interactivity controls is a green download button. Previously, you could download your plots as an SVG file, which you could then edit in a vector graphics editor. Now, you may also download a reasonably high-resolution PNG for more immediate use. I'd love to make it possible to download PDFs, but that's surprisingly hard to do in a browser and really easy to get from an SVG + vector graphics program like Inkscape, so generating a vector PDF file still falls to the user.

Styles Panel
To the left of the downloads button, there is now a button to reveal an off-canvas style panel. Here you can set a default color cycle, line width, marker size, font size, etc. You can also save these global styles to local memory in your browser, and they will be loaded automatically if found.

Below the global styles settings, you may make granular changes to how individual series look, including toggling between scatter and line plots, choosing colors, and line styles. Beware, though! Adding and removing series, switching between file modes, and other activities can reset these to defaults, so I only recommend messing around with individual series styles once you're pretty settled on the data you are visualizing.


Hosting and Development
As before, MESA Explorer is hosted for free via GitHub pages. All the file I/O, data processing, and visualization is done in your browser, so once the page is loaded, there is zero load on the network, and you could use MESA Explorer offline so long as you don't close the tab. Open as many instances as you want if you need to swap between projects.

Issues and suggestions for improvement are welcome on the GitHub page for this (github.com/wmwolf/mesa-explorer).

Anticipated Use and Acknowledging MESA Explorer
MESA Explorer is amazing for very quick analysis of data on the fly, so fire it up in your next meeting to discuss a project or in a classroom demonstration. Speaking of classrooms, MESA Explorer is much more user-friendly than more robust plotting tools, so it pairs great with MESA Web for getting students to use MESA.

While I still think you should use a more sophisticated tool to generate figures for publications and presentations on your MESA simulations, the plots generated by MESA Explorer now look pretty good and can be quite information-rich. I can certainly say that I've seen some plots in the literature that may have been improved by using MESA Explorer!

If you find MESA Explorer useful for your science (either to create publication graphs or just as a tool during the exploration phase), I have configured a Zenodo entry<https://doi.org/10.5281/zenodo.16261485> to pick up and provide DOIs for releases. There is a Zenodo badge in the footer of the web page that should be helpful in citing the tool.

A word on the development of this tool
I'm a reasonably capable web developer and wrote the original releases of MESA Explorer on my own. However, I wouldn't have been able to make these enhancements over such a short period of time (sporadically over the last month or two) without collaboration with an LLM. In this case, I was working with Claude Code. While I'm aware of the many understandable concerns people have with this technology, Claude Code's capability has really amazed me with this project. If you've been delaying enhancements to little projects of yours for lack of time, I'd recommend spending a few hours with an agentic coding tool like GitHub Copilot, Claude Code, or similar offerings from other companies to see what they could do for you.

Happy explorations!

Bill Wolf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20250721/71645509/attachment.htm>


More information about the Mesa-users mailing list