Ready-made kinds
The common kinds
The package carries the kinds nearly every sheet wants, in UINodeKinds.Common: a value filled in on the node for each standard
type — NumberNode, TextNode, DateNode, YesNoNode, ColorNode (UINodeKinds.UtilityColor, a #rrggbb colour picked on the node) and ImageNode (a picture the canvas uploads through OnImageUpload) —
ToTextNode, which writes any value out as text in a format (N2, yyyy-MM-dd), DisplayNode, which shows whatever a run fed it,
NoteNode, text for whoever reads the sheet, which a run passes over, DelayNode, which holds the run for the seconds asked,
reporting its progress, and passes its value on, CounterNode, which counts one step further a run, keeping the value its next
run hands out in the sheet (Next, with its reset beside it), and at its end starts over or ends a run of all — one counter's
Wrapped into another's Advance is a loop inside a loop — and RangeXYNode and RangeXYZNode, that loop set up in one node:
every point of a grid or a box, one a run, X fastest, how many taken kept as Taken — and RandomNode, a number drawn between two
ends from a seed the sheet keeps, the seed after a run the same, drawn anew, one more or one less. They wear the framework's own ne- glyphs, so they need no icon pack, and join a
catalogue as any kinds do:
public static UINodeCatalog Catalog { get; } = UINodeCatalog.FromTypes([.. UINodeKinds.Common, typeof(MyNode)]);
The text kinds stand in a category of their own, Text: JoinNode gathers every value wired into its one Values pin, written
out as text, and joins them by a separator — or, given a template, puts them into its places ({0} - {1}, the first connection
being {0}); SplitNode cuts a text into its parts at a separator, trimmed unless told otherwise, and says how many there are;
ReplaceNode puts one text in the place of another everywhere it stands; TextLengthNode counts a text's characters;
ContainsNode answers whether a text holds a part, anywhere, at its start or at its end; ChangeCaseNode writes a text in
capitals, in small letters or as a title; TrimNode takes the spaces off both ends or one; SliceNode cuts a part out from a
place, a start below zero counting from the end and no length running to it, a start or a length past the text held to it
rather than failing; ToNumberNode reads a number out of a text and says whether it was one (Valid); and MatchNode tries a
regular expression, answering whether it matched, the match and what its groups caught — a pattern that cannot be read fails
the node saying why, and one that runs past a second on its text fails it rather than holding the run. Case is ignored where
asked, and every one of them reads and writes as the invariant culture does — a number with a point, 12.5, never the server's
comma — so a sheet reads the same on any server.
The logic kinds stand under Logic: ChooseNode hands on Yes or No by a yes or no, its result wired as the type that
reaches Yes; AndNode and OrNode weigh every yes or no wired into their one Values pin, and with none wired in answer yes
and no, as nothing stands against the one and nothing is on for the other; NotNode turns a yes or no the other way; and
EqualsNode answers whether two values of any type are the same — numbers as numbers, so a whole 2 is 2.0, texts character by
character, dates by the clock they read, a day at its midnight, lists item by item, and a number and a text that reads as it
not the same.
The list kinds stand under Lists and take the universal array, so a text's parts from Split wire straight in, as any typed
array does: ItemAtNode takes an item by its place, 0 the first and -1 the last, and says with Found whether there was one
rather than failing; ListCountNode counts the items; ForEachNode hands them out one a run, as a counter hands out its
steps — how many it has taken is kept as Taken, with its reset beside it, and at the end it starts over or ends a run of all,
its Wrapped into another's Advance making a loop inside a loop; SortNode puts them in order, numbers by value and texts
character by character as the text kinds compare them, the kinds of value apart (yes or no, number, date, text), items that come
out the same keeping their order; ReverseNode turns the list round; and DistinctNode leaves out every item that repeats one
before it, by the rule Equals holds. Sort, Reverse and Distinct hand back the type that came in.
The date kinds stand under Dates and take a day or a date and time alike, handing back the type that came in: AddToDateNode
moves a date by minutes, hours, days, weeks, months or years, a month by the calendar — the 31st of January and a month is the
last day of February — and months and years whole; DateDifferenceNode says how far one date stands from another, months and
years as the whole calendar months and years between them, the smaller units with their fraction; and DatePartsNode takes a
date apart into its year, month, day, day of the week (1 for Monday to 7 for Sunday), hour and minute.
Every catalogue carries a RerouteNode whether it names one or not, kept out of the picker: a small box a wire is led through, which hands on whatever
reaches it to as many inputs as are wired to it and wears the name and the colour of the output that feeds it (looking through
other reroutes). The sheet's right button offers Add reroute beside Add node, putting one down unwired where the menu was
opened; a wire's offers it too, cutting the wire there and leading it through the new one, and Delete; a node kind of the application's own is drawn the same way with [GraphNode(Compact = true)].
Files
The file kinds reach the server's disk, so they are not among the common ones: an application takes them on purpose.
public static UINodeCatalog Catalog { get; } = UINodeCatalog.FromTypes([.. UINodeKinds.Common, .. UINodeKinds.Files]);
A node names a file by its path on the server — D:\Photos\2026\a.png, or relative to a base folder. What they may touch is the
application's to decide, not the kinds': a canvas is a page anyone viewing it drives, so with nothing registered the file kinds
reach nothing — every path fails the node, saying the disk is not open to it. AddGraphFiles opens it, and the base folder
is optional, the check is not: new UINodeFiles() with no Allow refuses every path, and Allow = (_, _) => true says
"everything the process may touch" on purpose, a relative path taken from the current directory. The check is given each full path and whether it is to be read or written, and a path it refuses fails
the node with why. The path is the one the kind will open: .. resolved and every link along it followed — a symbolic link or
a junction — so a link inside an allowed folder leads nowhere the check has not seen. UINodeFiles.IsInside(path, folder) is
the comparison such a check wants: it names the folder the same way (UINodeFiles.RealPath), where it may stand under a link
itself, compares names as the system does — ignoring case on Windows and macOS, but not on Linux, where /srv/WORK is another
folder than /srv/work — and takes D:\Work2 for no part of D:\Work:
services.AddGraphFiles(new UINodeFiles
{
BasePath = @"D:\Work",
// Read anywhere under D:\Work, write only under D:\Work\Out.
Allow = (path, access) => UINodeFiles.IsInside(path, access == UINodeFileAccess.Write ? @"D:\Work\Out" : @"D:\Work")
});
A check that lets every read through opens the whole disk to whoever views the page, whatever the base folder says. A
file kind reads at most 64 MB of one file (MaxReadBytes, UINodeFiles.DefaultMaxReadBytes), whatever the file says of its
length — a device reads without end — and writes at most 64 MB (MaxWriteBytes, DefaultMaxWriteBytes); past either the node fails.
FilesInFolderNode hands out a folder's files matching a filter
(*.png;*.jpg), one a run, in name order, keeping the one it took last in the sheet — the next run takes the one after it, so a
file added or removed meanwhile moves no other — and a run of all goes through the folder; ReadTextNode and
WriteTextNode read and write text, the writer replacing a file already there only when asked.
A calculator's kinds, ready made
NE.Standard.UI.Graph.Calculator is a package of node kinds, the first of this slice: an operation, rounding, a sum, a clamp, the
least or most of several, a comparison, and a result to read after a run — each under Calculator/ in the picker, the numbers
they work on coming from the common NumberNode. They join an application's own kinds in one catalogue, which is also how any kinds from another assembly join it, and they
wear the core's own glyphs, so the host registers nothing for them:
dotnet add package NE.Standard.UI.Graph.Calculator
public static UINodeCatalog Catalog { get; } = UINodeCatalog.FromTypes([.. UINodeKinds.Common, .. CalculatorNodes.Kinds, typeof(MyNode)]);
A kind's key in a saved sheet is its NodeKey (calculator.result), so a sheet written by one application runs in another; the
line a run wrote is ResultNode.Text.
Picture kinds, ready made
NE.Standard.UI.Graph.Image works pictures on the server with SkiaSharp: ImageSizeNode reads the size off the file's header,
ResizeImageNode resamples to a size (Stretch, Contain or Cover), and CropImageNode, RotateImageNode (by quarters),
FlipImageNode, GrayscaleImageNode, BlurImageNode and ConvertImageNode (PNG, JPEG or WebP, at a quality) each write a new
picture, under Image in the picker. A picture on the wire is its address; the chain starts at the common ImageNode or at
LoadImageNode, which reads a file from the disk, as the file kinds do, and refuses one whose first bytes are not a picture, and ends at a
DisplayNode, which draws the address as the picture, since a picture's output feeds it, or at SaveImageNode, which writes it into a folder under the name given
with its format's extension. Files in folder into Load image, a resize, and Save image is a folder of thumbnails in one run
of all. A picture going out as JPEG, which has no transparency, is laid on white.
Load image and Save image reach the disk, so they stand apart from the rest: ImageNodes.Kinds is the kinds that work a
picture in the store, ImageNodes.FileKinds the two that load and save a file, which reach nothing until the application
registers AddGraphFiles, as the file kinds do.
dotnet add package NE.Standard.UI.Graph.Image
The kinds read and keep pictures through the application's IUINodeImageStore, which the runner reaches through the services it
was given (new UINodeRunner(catalog, services)). AddGraphImages() registers the one that comes with the package,
UINodeImageMemoryStore: pictures in memory, served back as the application's content provider. An application that has a
content provider of its own, or keeps its pictures in a blob store or on disk, implements IUINodeImageStore on its own store
instead — the same store the canvas's uploads (OnImageUpload) are written to. The memory store keeps a picture under the hash
of what it is, so the same file loaded again, or a node run again on it, is one picture at one address, and the nodes below it
are handed on rather than run. It keeps 256 MB of pictures (UINodeImageMemoryStore.DefaultMaxBytes) — every upload and every
picture a run makes lands in it, from whoever views a page — letting go of the pictures used longest ago past that;
AddGraphImages(maxBytes) sets another cap. A run's cache may still hand on the address of a picture let go that way: the kind
below it fails once, and the failure makes the next run make everything above it afresh.
public static UINodeCatalog Catalog { get; } = UINodeCatalog.FromTypes([.. UINodeKinds.Common, .. ImageNodes.Kinds]);
// The application.
services.AddGraphImages();
With Load image and Save image too, the catalogue names ImageNodes.FileKinds and the application opens the disk:
public static UINodeCatalog Catalog { get; } = UINodeCatalog.FromTypes([.. UINodeKinds.Common, .. UINodeKinds.Files, .. ImageNodes.Kinds, .. ImageNodes.FileKinds]);
services.AddGraphFiles(new UINodeFiles
{
BasePath = @"D:\Work",
Allow = (path, access) => UINodeFiles.IsInside(path, access == UINodeFileAccess.Write ? @"D:\Work\Out" : @"D:\Work")
});
How much the kinds may take of the server is UINodeImageLimits: a picture is decoded to at most 50 million pixels
(MaxPixels), and the process decodes two pictures at once (MaxConcurrentDecodes), a run past it waiting its turn. A decoded
picture takes four bytes a pixel and a kind holds two or three at once, so the two together bound what the kinds hold in memory.
A resize decodes a large photograph at a smaller scale where its format allows, so the cap bounds what is decoded rather than
what the file claims. An application sets its own by registering them as a service, which the runner reaches through its
services:
services.AddSingleton(new UINodeImageLimits { MaxPixels = 100_000_000, MaxConcurrentDecodes = 4 });
SkiaSharp brings its Windows and macOS natives; the package adds the dependency-free Linux build, the host most servers run on.