Data analysis
The Data analysis section of func3d turns the chart from an illustration into a reading instrument: real values under the cursor, a marker with snapping, highlighting of geometric elements and isocurves, a 2D profile along a cut. All readings are in data coordinates (raw z): the visual z scale and the colour scales never alter the numbers shown.
Analysis mode and marker
- Analysis mode: when active, clicking the chart does not rotate the scene but queries the surface (raycast picking); rotation stays available outside the mode.
- Show marker: a sphere marks the last read point; its coordinates (x, y, z) appear next to it in data values, together with the gradient ∇f and its components, the slope and the azimuth of steepest ascent.
- Active series: with several series in the scene you choose which one to query (it also filters statistics and local extrema).
- Picking queries surfaces: point clouds and vector fields are not selectable (clouds have hover tooltips instead).
Snapping
The read point can snap to useful references:
| Mode | Behaviour |
|---|---|
| No snap | the exact ray intersection point is read |
| Nearest vertex | snaps to the closest mesh node (the truly sampled values) |
| Triangle centre | snaps to the barycentre of the intersected triangle |
| Defined grid | snaps to a grid with a chosen step (e.g. read every 0.5) |
| Locked direction | movement stays on a fixed direction (a manual profile along x or y) |
Highlights
- Intersected triangle: colours the hit mesh triangle (custom colour) — useful to appreciate the local grid resolution.
- Local isocurve: highlights the level curve through the read point, limited to the connected region.
- Global isocurve: the level curve at a chosen height over the whole surface; the height is set manually or with the Use clicked z button.
For permanent isocurves (multiple levels, filled bands, projection onto the base plane) use the Isolines block in the series card instead.
Note on parametric surfaces (spherical harmonics, Möbius, knotted tori...): picking and tooltip work and show the real 3D coordinates of the point; isolines and the 2D section do not exist for them, because there is no z(x,y) to cut.
Tooltip on hover
With the analysis active, pausing the cursor over the chart shows a tooltip with the data values of the point: x, y, z for surfaces; for clouds also the c value associated with the point (and c₂ if the cloud uses the colour/size double encoding).
2D section / profile
The 2D section panel puts a profile along a cut of the domain next to the 3D view:
- y = const cut (z(x) profile) or x = const (z(y) profile), moved with a slider; or an arbitrary segment P0→P1 (profile along the distance s);
- in the 3D scene an indicator plane shows where the cut passes, in real time;
- the 2D panel shows all visible surfaces (distinct colours, legend); closed surfaces show both branches, the lower one dashed; outside the domain of a series its curve is interrupted;
- a crosshair with the numerical values of every curve at the cursor position.
- the profile can be exported as CSV (the s, z pairs of every curve) and as vector SVG: axes, labels, grid and curves are real objects, so the drawing opens in Inkscape or Illustrator and prints at any size without blurring.
3D curves: tooltip and ruler
Parametric curves are thin lines: the raycast that serves surfaces misses them. The picking works the other way round — it projects the curve samples to the screen and takes the one closest to the mouse within a few pixels. So the hover tooltip says name, t, x, y, z of the point, and the ruler accepts curve points: if a sample lies within 6 px of the click, the click was meant for the curve even when a surface sits underneath. The curve point is not snapped: it already is an exact point of the line.
Measurement log
Every measurement taken on the chart — 3D and planimetric distance between two points, height difference, mean slope, steepest slope, volume above or below a level, area above a level, difference between two series — goes into a log at the bottom of the analysis panel, together with its context: which series, which points, which reference level, the unit. The log can be cleared with a button and exported as CSV.
The reason is practical: a measurement read and not written down is a measurement lost, and copying it from the screen by hand is exactly where mistakes happen. With the log you take a series of measurements in a row — the crater-to-base height differences in several directions, say — and carry the CSV away.
Classes and thematic mapping
To read a surface as a thematic map continuous colour is not enough: you need classes. The classes colour mode offers the usual methods — natural breaks (Jenks), equal intervals, quantiles, standard deviation, pretty numbers, logarithmic, fixed step — and shows a table with the bounds and the count of every class.
A few caveats that the table shows and the picture does not:
- Jenks is solved exactly (Fisher's dynamic programming), not by approximation: the classes are the optimum, not “a good result”. On many cells it is the most expensive method, and it shows.
- quantiles on data with many repeated values can produce zero-width classes: in that case the number of classes returned is smaller than the number requested, and rightly so — an empty class is not a class.
- the bounds of adjacent classes are coupled: changing the “to” of one class moves the “from” of the next, and a bound cannot leap over the neighbouring class. This makes overlapping or gappy classes impossible to write — a value falling in a gap used to take the colour of the nearest class without saying so. Classes can also be added (the widest one is split in two) or removed (the neighbour absorbs the interval: the overall coverage never changes);
- intervals are left-closed and right-open [min, max), except the last one which is closed: this way every value belongs to exactly one class and the maximum is not left out.
- you can choose which coordinate drives the colour: height z, but also x or y — useful when the interesting variable is a direction in the plane rather than the height.
The classification lives in js/local/func3d/classi.js, a library of its own
with a headless test suite (Jenks is checked against exhaustive search on small cases).
Changing classes or the flat colour does not rebuild the surface: vertices are
recoloured in place.
Comparing two surfaces
Comparing two surfaces by eye only works if the two colour scales coincide. With different bounds — the normal case, since every series takes its own — the same yellow means 0.9 on one surface and 2500 on the other: the eye compares the colours and concludes something false. The Shared scale switch (General settings → Legend) forces the same bounds on every surface: the union of their ranges, or two values typed by hand when a fixed reference across sessions is wanted.
The two readings are complementary: with their own scales you see the shape of each surface (every colormap uses its full range), with the shared scale you see comparable levels. Switching between them rebuilds nothing: vertices are recoloured in place, and turning the switch off returns exactly the previous colours.
Which subject for which tool
Each tool shines on surfaces with the right "morphology". A quick guide over the subjects of the registry:
| Tool | Ideal subjects | What to look at |
|---|---|---|
| Local extrema | Rastrigin, Himmelblau, Müller–Brown, volcano | the regular lattice of Rastrigin peaks; the 4 identical Himmelblau minima; the DEM crater. Prominence filters out the noise. |
| Steepest slope | Müller–Brown, volcano, Franke | on the PES the blue descent ends in the minimum of the starting basin (move the click past the saddle to change basin); on the DEM it is the runoff line. |
| Isocurves and z₀ level | volcano, membrane, gaussian | DEM contour lines; nodal lines of the membrane (z₀ = 0). |
| Volume w.r.t. z₀ | volcano, 2D heat kernel | impounded volume above a level; for diffusion, the volume under the bell stays constant over time (a physics check, frame by frame). |
| Statistics and histogram | volcano, Rastrigin, 2D heat kernel | the histogram of DEM elevations is the hypsometric curve; on Rastrigin the distribution is multimodal. |
| Difference (A − B) | volcano — sparse sample vs the full DEM; Franke | the flagship use case: interpolate the sample (natural, krige, rst…) and measure the true error against the DEM; |Δ|max falls where the points are sparse. |
| 3D ruler | volcano, parametric surfaces | crater-to-base height difference and mean slope; with vertex snap the measurements land on the DEM nodes. |
| 2D section / profile | volcano (polyline), Müller–Brown, membrane | topographic profile along a multi-vertex path; on the PES, the profile along the reaction path between the minima. |
A typical workflow
- load the data (administered dataset or CSV import) and choose the interpolation method;
- adjust the colormap and the colour scale (log or diverging if the field calls for it, clamping to focus on an interval);
- activate the analysis: tooltip for quick exploration, marker + vertex snap to read the truly sampled values;
- trace the global isocurve at a height of interest (Use clicked z);
- open the 2D section on the meaningful cut and compare the series;
- export: PNG for the figure, CSV for the numbers, a shareable link for colleagues.
Keywords: data analysis, picking, snapping, isocurves, 2D section, tooltip, 3D charts