TINS.Graphics.Avalonia
2.0.0
dotnet add package TINS.Graphics.Avalonia --version 2.0.0
NuGet\Install-Package TINS.Graphics.Avalonia -Version 2.0.0
<PackageReference Include="TINS.Graphics.Avalonia" Version="2.0.0" />
<PackageVersion Include="TINS.Graphics.Avalonia" Version="2.0.0" />
<PackageReference Include="TINS.Graphics.Avalonia" />
paket add TINS.Graphics.Avalonia --version 2.0.0
#r "nuget: TINS.Graphics.Avalonia, 2.0.0"
#:package TINS.Graphics.Avalonia@2.0.0
#addin nuget:?package=TINS.Graphics.Avalonia&version=2.0.0
#tool nuget:?package=TINS.Graphics.Avalonia&version=2.0.0
TINS-Library
Neuroscience data analysis framework for EEG/electrophysiology research — matrix algebra, signal processing, frequency-domain analysis, and cross-platform visualization.
Packages
| Package | Contains |
|---|---|
TINS.Core |
Algebra, containers, signals, numerics, statistics, filtering, frequency-domain analysis, data I/O, ML. No dependencies. |
TINS.Graphics |
Plotter, axes, color gradients — the platform-independent charting core. |
TINS.Graphics.Avalonia |
Figure/Chart controls for hosting Plotter in an Avalonia app. |
dotnet add package TINS.Core
dotnet add package TINS.Graphics
dotnet add package TINS.Graphics.Avalonia
TINS.Graphics.WPF, TINS.Graphics.WinForms, and TINS.Visualization exist in this repo but aren't published yet (all three require a Windows host to build — see .github/workflows/ci.yml).
See API.md for the full API reference, split by package.
Quick plots: Figure.Show
With TINS.Graphics.Avalonia referenced, Figure.Show opens a plot window from an ordinary console
program, the way plt.show() does in Python: no app setup, it blocks until the window is closed, and
you can call it again afterwards.
using TINS;
using TINS.Graphics;
using TINS.Graphics.Avalonia;
using TINS.Graphics.Impl; // the Lines/Scatters/... convenience extensions
class Program
{
static void Main()
{
var plt = new Plotter();
plt.GetAxisRect().Lines(Signals.Sine(40, 1000, 1000));
Figure.Show(plt, "My signal"); // returns when the window is closed
}
}
Figure.Plot2D(...) does the same for a heatmap of a Matrix<float> or spectrum result.
Threading rules
| Windows / Linux | macOS | |
|---|---|---|
Figure.Show from Main / any non-UI thread |
works | works on the main thread only (it runs the UI loop on the calling thread) |
Figure.Show on the UI thread (e.g. in a window callback) |
throws, use ShowAsync |
works (nested loop) |
Figure.ShowAsync |
works | needs FigureApp.Run |
On macOS, Avalonia must own the main thread. If you need ShowAsync, or want to call Show from a
background thread, wrap your program once; this form works on every platform:
FigureApp.Run(() =>
{
// your code here, on a background thread
Figure.Show(plt);
});
Other things to know:
- Don't touch Avalonia UI objects before the first
Show, and don't expect to restart the figure context afterFigureApp.ShutdownContext(): Avalonia allows one application per process. - To update a plot that is on screen from another thread, use
Graph.SetData/AddData(thread-safe), and wrap any other change (axis ranges, other plottable types) inlock (plotter.SyncRoot) { ... }. On macOS, code that runs whileShowblocks must go through the dispatcher or a timer.
See the Platform Controls section of docs/API-Graphics.md for the full reference.
Platform support
TINS.Core no longer bundles any native binaries of its own. Some functionality depends on FFTW and
OpenBLAS, provided by a separate NuGet package per platform from
tins-lib-native — add whichever RID(s) your
project targets alongside TINS.Core:
| Package | Platform | Status |
|---|---|---|
TINS.Native.win-x64 |
Windows x64 | ready |
TINS.Native.linux-x64 |
Linux x64 | ready |
TINS.Native.osx-arm64 |
macOS (Apple Silicon) | ready |
TINS.Native.osx-x64 |
macOS (Intel) | excluded — the GitHub Actions runner it needs was deprecated with no free-tier replacement; see tins-lib-native's README for detail |
TINS.Native.Desktop |
all of the above at once | convenience meta-package (e.g. for a cross-platform test project); covers win-x64/linux-x64/osx-arm64 only, per the above |
| Native library | Required by |
|---|---|
FFTW (libfftw3-3, libfftw3f-3) |
Most of TINS.Analysis (Fourier/Hilbert transforms, spectral & coherence analysis) and TINS.Filtering (Convolver, MultikernelConvolver) |
OpenBLAS (libopenblas) |
Accelerated matrix operations in TINS.Algebra (large matrix multiplication), SingularValueDecomposition, and transitively PrincipalComponentAnalysis |
Everything else — containers, matrix/vector algebra, statistics, non-multitaper signal generation, data I/O — is pure managed code and portable. SingularValueDecomposition/PrincipalComponentAnalysis (via OpenBLAS.SGESVD) and multitaper spectral/coherence analysis (SpikeSpectrumAnalyzer, SpikeFieldCoherenceMT, via a managed DPSS implementation) no longer depend on a dedicated native library — only FFTW/OpenBLAS themselves do. Using an FFTW- or OpenBLAS-backed feature without the matching TINS.Native.<rid> package referenced will throw DllNotFoundException at first call.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Avalonia (>= 12.1.0)
- Avalonia.Desktop (>= 12.1.0)
- Avalonia.Fonts.Inter (>= 12.1.0)
- Avalonia.Themes.Fluent (>= 12.1.0)
- TINS.Graphics (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.