Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.view.materializer

What a live view IS after patch N — and what the MODEL reads when it ends.

A form is answered once, so nobody has to own its state; a live view is a stream of operations against nodes addressed by id, so somebody does. apply-patch is that owner: pure, total, and the ONE place the surfaces read from. The terminal pane, the companion screen and the model all paint the same materialized map, so none of them can disagree about a row.

picture is the MODEL's surface: the finished view as DATA. Ids and tones come with it, so a node the model read is a node it can patch, and a state is never recovered from a sentence — the model acts on the same materialized map the surfaces paint, budgeted, never on a description of it.

->markdown is the DOCUMENT that state renders into: what a human reopens, what an artifact stores, what a transcript embeds. Markdown is a RENDERING, never a fourth vocabulary: every node type has exactly one markdown form here, so a view that reads well in the terminal already reads well on a page. Colour is the only thing that cannot cross — where a surface paints red, the page reads a [tone] token.

parse-markdown is that document read BACK. One markdown form per node type in one direction is one form per node type in the other, so a whole view can be AUTHORED as markdown and a rendered one re-read. What a budget left behind is named, never guessed.

Nothing here evicts the RECORD. Bounds on keyed collections are REFUSALS (spec/item-bounds) naming the bound and the node, a log's :window-lines is only how much a surface holds hot, and the model's own budget always says how many lines it left behind.

What a live view IS after patch N — and what the MODEL reads when it ends.

A form is answered once, so nobody has to own its state; a live view is a
stream of operations against nodes addressed by id, so somebody does.
[[apply-patch]] is that owner: pure, total, and the ONE place the surfaces
read from. The terminal pane, the companion screen and the model all paint
the same materialized map, so none of them can disagree about a row.

[[picture]] is the MODEL's surface: the finished view as DATA. Ids and tones
come with it, so a node the model read is a node it can patch, and a state is
never recovered from a sentence — the model acts on the same materialized map
the surfaces paint, budgeted, never on a description of it.

[[->markdown]] is the DOCUMENT that state renders into: what a human reopens,
what an artifact stores, what a transcript embeds. Markdown is a RENDERING,
never a fourth vocabulary: every node type has exactly one markdown form here,
so a view that reads well in the terminal already reads well on a page. Colour
is the only thing that cannot cross — where a surface paints red, the page
reads a `[tone]` token.

[[parse-markdown]] is that document read BACK. One markdown form per node type
in one direction is one form per node type in the other, so a whole view can be
AUTHORED as markdown and a rendered one re-read. What a budget left behind is
named, never guessed.

Nothing here evicts the RECORD. Bounds on keyed collections are REFUSALS
(`spec/item-bounds`) naming the bound and the node, a log's `:window-lines`
is only how much a surface holds hot, and the model's own budget always says
how many lines it left behind.
raw docstring

->markdownclj

(->markdown view)
(->markdown view {:keys [result] :as opts})

The whole view as markdown — the DOCUMENT the same state renders into, for a human to reopen, an artifact to store and a transcript to embed. The model is handed picture instead: data, not prose.

Rendered from the materialized state the human's surfaces painted, so the page and the pane cannot tell different stories. opts may carry the :result (rendered first, because the verdict is what a reader needs before the detail) and may widen the same budget with :log-tail-lines and :table-rows. Both budgets truncate the RENDER and say so with the count they left behind; neither touches the record. Layout is left behind for the same reason picture leaves it: the page is the CONTENT of a view, so a group's nodes are rendered in declaration order and a document read back is a flat view.

The whole view as markdown — the DOCUMENT the same state renders into, for a
human to reopen, an artifact to store and a transcript to embed. The model is
handed [[picture]] instead: data, not prose.

Rendered from the materialized state the human's surfaces painted, so the page
and the pane cannot tell different stories. `opts` may carry the `:result`
(rendered first, because the verdict is what a reader needs before the detail)
and may widen the same budget with `:log-tail-lines` and `:table-rows`. Both
budgets truncate the RENDER and say so with the count they left behind; neither
touches the record. Layout is left behind for the same reason [[picture]]
leaves it: the page is the CONTENT of a view, so a group's nodes are rendered
in declaration order and a document read back is a flat view.
sourceraw docstring

apply-patchclj

(apply-patch view patch)

view after every operation in patch, or a refusal naming the first one that could not land.

ALL OR NOTHING: a patch that refuses half way returns nothing and leaves the view it was handed, so no surface ever paints half a patch. :seq must ADVANCE — a replayed or duplicated patch is refused rather than applied twice, which is what lets a surface treat a gap as re-read the snapshot.

`view` after every operation in `patch`, or a refusal naming the first one
that could not land.

ALL OR NOTHING: a patch that refuses half way returns nothing and leaves the
view it was handed, so no surface ever paints half a patch. `:seq` must
ADVANCE — a replayed or duplicated patch is refused rather than applied
twice, which is what lets a surface treat a gap as `re-read the snapshot`.
sourceraw docstring

fractionclj

(fraction {:keys [value done total]})

How far a progress has come, as a fraction of one — its declared :value, or what :done of :total works out to. nil is INDETERMINATE: started, size unknown, which is the honest picture while a job queues.

ONE definition, because the document, the model's picture and every surface that paints a bar have to stand for the same number.

How far a progress has come, as a fraction of one — its declared `:value`, or
what `:done` of `:total` works out to. `nil` is INDETERMINATE: started, size
unknown, which is the honest picture while a job queues.

ONE definition, because the document, the model's picture and every surface
that paints a bar have to stand for the same number.
sourceraw docstring

log-textclj

(log-text text)

Make C0/C1 terminal controls visible in retained output; tab and newline stay literal. No escape is interpreted or removed. Run before redaction and publication.

Make C0/C1 terminal controls visible in retained output; tab and newline stay literal.
No escape is interpreted or removed. Run before redaction and publication.
sourceraw docstring

materializeclj

(materialize view)

The declared view as the materializer holds it. Only stamps: every log node learns the size of its own record, so the first patch already knows what the window is a window ONTO.

The declared view as the materializer holds it. Only stamps: every log node
learns the size of its own record, so the first patch already knows what the
window is a window ONTO.
sourceraw docstring

ordered-rowsclj

(ordered-rows {:keys [rows columns order]})

A table's rows in the order it DECLARED — applied at paint time, never by re-sorting the record, so a re-sort never loses the identity a scroll anchor is pinned to.

A table's rows in the order it DECLARED — applied at paint time, never by
re-sorting the record, so a re-sort never loses the identity a scroll anchor
is pinned to.
sourceraw docstring

parse-markdownclj

(parse-markdown markdown)

A picture read back: the markdown ->markdown wrote, as the view and the verdict that painted it — {:view … :result … :elided …}.

THE LAW: a picture that elided nothing renders back exactly, so (->markdown view {:result result}) is the markdown it was parsed from. That is what makes markdown two-way — a view can be AUTHORED as markdown, a rendered view can be re-read, and neither direction invents anything.

Markdown paints the PICTURE, not the record, so what cannot cross is named here rather than discovered later. Ids are never painted: each is derived from the label the eye reads ([[addressed]]), deterministically, so a patch written against a parsed view still lands. The declaration-only keys (:window-lines, :max-rows, :order) are refilled with their defaults — the render reads none of them. A percent is painted whole, so the fraction that comes back is the one the eye saw. And :elided names every node whose picture COUNTED items it did not carry: a log still round-trips (the count is stamped, so the note is repainted), a table holds the rows it was shown.

Every node is checked against spec/live-node before it is answered, so what this returns is a view the engine will run, or a refusal naming the line.

A picture read back: the markdown [[->markdown]] wrote, as the view and the
verdict that painted it — `{:view … :result … :elided …}`.

THE LAW: a picture that elided nothing renders back exactly, so
`(->markdown view {:result result})` is the markdown it was parsed from. That
is what makes markdown two-way — a view can be AUTHORED as markdown, a
rendered view can be re-read, and neither direction invents anything.

Markdown paints the PICTURE, not the record, so what cannot cross is named
here rather than discovered later. Ids are never painted: each is derived
from the label the eye reads ([[addressed]]), deterministically, so a patch
written against a parsed view still lands. The declaration-only keys
(`:window-lines`, `:max-rows`, `:order`) are refilled with their defaults —
the render reads none of them. A percent is painted whole, so the fraction
that comes back is the one the eye saw. And `:elided` names every node whose
picture COUNTED items it did not carry: a log still round-trips (the count is
stamped, so the note is repainted), a table holds the rows it was shown.

Every node is checked against `spec/live-node` before it is answered, so what
this returns is a view the engine will run, or a refusal naming the line.
sourceraw docstring

percentclj

(percent value)

A fraction as whole percent — the ONE rounding every surface shows, so the document and a pane never disagree by a point.

A fraction as whole percent — the ONE rounding every surface shows, so the
document and a pane never disagree by a point.
sourceraw docstring

pictureclj

(picture view)
(picture view opts)

The finished view as DATA — what the MODEL reads when it ends, and the only shape it acts on. Ids come with it, so a node the model read is a node it can patch by name; tones stay keywords, so nothing has to be recovered from a sentence. The mount bookkeeping does not come: a picture is {:view {:title :description :nodes} :elided […]}, the same pair parse-markdown answers, so data out and document in describe ONE shape.

LAYOUT is left behind with the bookkeeping: a group says where the nodes inside it STAND, and where a node stands is the surface's business, so the picture carries the nodes themselves, flattened in declaration order.

Budgeted from the same model-budget ->markdown renders with, so the two surfaces leave the same thing behind: a log answers its TAIL, a table the head of the order it declared, and :elided COUNTS what neither carried. The record keeps all of it. A table's rows come in PAINT order and the picture says :insertion, because the order is already applied — mounting a picture again must not sort it twice.

opts may widen the budget with :log-tail-lines and :table-rows.

The finished view as DATA — what the MODEL reads when it ends, and the only
shape it acts on. Ids come with it, so a node the model read is a node it can
patch by name; tones stay keywords, so nothing has to be recovered from a
sentence. The mount bookkeeping does not come: a picture is
`{:view {:title :description :nodes} :elided […]}`, the same pair
[[parse-markdown]] answers, so data out and document in describe ONE shape.

LAYOUT is left behind with the bookkeeping: a group says where the nodes
inside it STAND, and where a node stands is the surface's business, so the
picture carries the nodes themselves, flattened in declaration order.

Budgeted from the same `model-budget` [[->markdown]] renders with, so the two
surfaces leave the same thing behind: a log answers its TAIL, a table the head
of the order it declared, and `:elided` COUNTS what neither carried. The record
keeps all of it. A table's rows come in PAINT order and the picture says
`:insertion`, because the order is already applied — mounting a picture again
must not sort it twice.

`opts` may widen the budget with `:log-tail-lines` and `:table-rows`.
sourceraw docstring

redact-presentationclj

(redact-presentation value)

Redact human text in normalized View data, never structural IDs, selections, ordering or enums. Recurse through containers, propagating text context into lines/cells but choosing it afresh for every map key. Pure and idempotent.

Redact human text in normalized View data, never structural IDs, selections,
ordering or enums. Recurse through containers, propagating text context into
lines/cells but choosing it afresh for every map key. Pure and idempotent.
sourceraw docstring

slugclj

(slug text)

The address a label earns when nobody wrote one: lower case, one dash for every run of anything else, nil when nothing legible is left. What [[addressed]] gives a picture's items, and what a settled view is filed under.

The address a label earns when nobody wrote one: lower case, one dash for every
run of anything else, nil when nothing legible is left. What [[addressed]] gives
a picture's items, and what a settled view is filed under.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close