Liking cljdoc? Tell your friends :D

knossos.linear.report

Constructs reports from a linear analysis.

When a linear analyzer terminates it gives us a set of configs, each of which consists of a model, a final operation, and a set of pending operations. Our job is to render those operations like so:

        +---------+ +--------+
proc 0  | write 1 | | read 0 |
        +---------+ +--------+
              +---------+
proc 1        | write 0 |
              +---------+

------------ time ---------->
Constructs reports from a linear analysis.

When a linear analyzer terminates it gives us a set of configs, each of which
consists of a model, a final operation, and a set of pending operations. Our
job is to render those operations like so:

            +---------+ +--------+
    proc 0  | write 1 | | read 0 |
            +---------+ +--------+
                  +---------+
    proc 1        | write 0 |
                  +---------+

    ------------ time ---------->
raw docstring

activate-lineclj

(activate-line element reachable)

On hover, highlights all related IDs for this element.

On hover, highlights all related IDs for this element.
sourceraw docstring

activate-scriptclj

source

collapse-mappingclj

(collapse-mapping m)

Takes a map of x->x, where x may be a key in the map, and flattens it such that every key points directly to its final target.

Takes a map of x->x, where x may be a key in the map, and flattens it such
that every key points directly to its final target.
sourceraw docstring

condense-time-coordsclj

(condense-time-coords coords)

Takes time coordinates (a map of op indices to [start-time end-time]), and condenses times to remove sparse regions.

Takes time coordinates (a map of op indices to [start-time end-time]), and
condenses times to remove sparse regions.
sourceraw docstring

coordinate-densityclj

(coordinate-density bars)

Construct a sorted map of coordinate regions to the maximum number of bars in a process in that region.

Construct a sorted map of coordinate regions to the maximum number of bars
in a process in that region.
sourceraw docstring

fadedclj

opacity

opacity
sourceraw docstring

fontclj

source

glow-filterclj

(glow-filter)
source

hscaleclj

(hscale x)

Convert our units to horizontal CSS pixels

Convert our units to horizontal CSS pixels
sourceraw docstring

hscale-clj

source

learningsclj

(learnings history analysis)

What a terrible function name. We should task someone with an action item to double-click down on this refactor.

Basically we're taking an analysis and figuring out all the stuff we're gonna need to render it.

What a terrible function name. We should task someone with an action item to
double-click down on this refactor.

Basically we're taking an analysis and figuring out all the stuff we're gonna
need to render it.
sourceraw docstring

legend-heightclj

source

legend-textclj

(legend-text s x y & style)
source

merge-linesclj

(merge-lines lines)

Takes an associative collection of line-ids to lines and produces a new collection of lines, and a map which takes the prior line IDs to new line IDs.

Takes an associative collection of line-ids to lines and produces a new
collection of lines, and a map which takes the prior line IDs to new line
IDs.
sourceraw docstring

merge-lines-rclj

(merge-lines-r [lines mapping] candidates)

Given [a set of lines, a mapping], and a group of overlapping lines, merges those lines, returning [lines mapping].

Given [a set of lines, a mapping], and a group of overlapping lines, merges
those lines, returning [lines mapping].
sourceraw docstring

min-stepclj

How small should we quantize the graph?

How small should we quantize the graph?
sourceraw docstring

model-numbersclj

(model-numbers models)

A map which takes models and returns an integer.

A map which takes models and returns an integer.
sourceraw docstring

modelsclj

(models analysis)

Computes distinct models in an analysis.

Computes distinct models in an analysis.
sourceraw docstring

op-colorclj

(op-color pair-index op)

What color should an op be?

What color should an op be?
sourceraw docstring

opsclj

(ops analysis)

Computes distinct ops in an analysis.

Computes distinct ops in an analysis.
sourceraw docstring

outline-textclj

(outline-text element)
source

path->lineclj

(path->line path lines models)

Takes a map of coordinates to models, path, a collection of lines, and emits a collection of lines with :min-x0, :max-x0, :y0, :min-x1, :max-x1, :y1 coordinate ranges, and an attached model for the termination point. Assigns a :line-id to each transition for the line which terminates there. Returns a tuple [path' lines' bars'] where path' has line ids referring to indices in lines.

Takes a map of coordinates to models, path, a collection of lines, and emits
a collection of lines with :min-x0, :max-x0, :y0, :min-x1, :max-x1, :y1
coordinate ranges, and an attached model for the termination point. Assigns a
:line-id to each transition for the line which terminates there. Returns a
tuple [path' lines' bars'] where path' has line ids referring to indices in
lines.
sourceraw docstring

path-boundsclj

(path-bounds {:keys [time-coords process-coords]} path)

Assign an initial :y, :min-x and :max-x to every transition in a path.

Assign an initial :y, :min-x and :max-x to every transition in a path.
sourceraw docstring

pathsclj

(paths analysis time-coords process-coords)

Given time coords, process coords, and an analysis, emits paths with coordinate bounds.

Given time coords, process coords, and an analysis, emits paths with
coordinate bounds.
sourceraw docstring

paths->initial-linesclj

(paths->initial-lines paths)

Takes a collection of paths and returns:

  1. That collection of paths with each transition augmented with a :line-id
  2. A collection of lines indexed by line-id.
  3. A set of models, each with :x and :y coordinates.
Takes a collection of paths and returns:

0. That collection of paths with each transition augmented with a :line-id
1. A collection of lines indexed by line-id.
2. A set of models, each with :x and :y coordinates.
sourceraw docstring

paths->linesclj

(paths->lines paths)

Many path components are degenerate--they refer to equivalent state transitions. We want to map a set of paths into a smaller set of lines from operation to operation. We have coordinate bounds on every transition. Our job is to find non-empty intersections of those bounds for equivalent transitions and collapse them.

We compute three data structures:

  • A collection of paths, each transition augmented with a numeric :line-id which identifies the line leading to that transition.
  • An indexed collection of line IDs to {:x0, y0, :x1, :y1} line segments connecting transitions.
  • A set of models, each with {:x :y :model} keys.
Many path components are degenerate--they refer to equivalent state
transitions. We want to map a set of paths into a smaller set of lines from
operation to operation. We have coordinate bounds on every transition. Our
job is to find non-empty intersections of those bounds for equivalent
transitions and collapse them.

We compute three data structures:

- A collection of paths, each transition augmented with a numeric :line-id
which identifies the line leading to that transition.
- An indexed collection of line IDs to {:x0, y0, :x1, :y1} line segments
connecting transitions.
- A set of models, each with {:x :y :model} keys.
sourceraw docstring

process-coordsclj

(process-coords ops)

Given a set of operations, computes a map of process identifiers to their track coordinates 0, 2, 4, ...

Given a set of operations, computes a map of process identifiers to their
track coordinates 0, 2, 4, ...
sourceraw docstring

process-heightclj

How tall should an op be in process space?

How tall should an op be in process space?
sourceraw docstring

reachableclj

(reachable paths)

A map of an id (bar- or line-) to all ids for all paths that touch that id.

A map of an id (bar- or line-) to all ids for all paths that touch that id.
sourceraw docstring

recursive-getclj

(recursive-get m k)

Looks up a key in a map recursively, by taking (get m k) and using it as a new key.

Looks up a key in a map recursively, by taking (get m k) and using it as a
new key.
sourceraw docstring

render-analysis!clj

(render-analysis! history analysis file)

Render an entire analysis.

Render an entire analysis.
sourceraw docstring

render-barsclj

(render-bars {:keys [hscale bars reachable]})

Given learnings, renders all bars as a group of SVG tags.

Given learnings, renders all bars as a group of SVG tags.
sourceraw docstring

render-legendclj

(render-legend learnings)
source

render-linesclj

(render-lines {:keys [hscale lines reachable]})

Given learnings, renders all lines as a group of SVG tags.

Given learnings, renders all lines as a group of SVG tags.
sourceraw docstring

render-opsclj

(render-ops {:keys [hscale time-coords process-coords pair-index ops]})

Given learnings, renders all operations as a group of SVG tags.

Given learnings, renders all operations as a group of SVG tags.
sourceraw docstring

render-process-legendclj

(render-process-legend {:keys [process-coords]})

Process numbers and time arrow

Process numbers and time arrow
sourceraw docstring

set-attrclj

(set-attr elem attr value)

Set a single xml attribute

Set a single xml attribute
sourceraw docstring

stroke-widthclj

source

svg-2clj

(svg-2 & args)

Emits an SVG 2 document.

Emits an SVG 2 document.
sourceraw docstring

time-boundsclj

(time-bounds pair-index analysis)

Given a pair index and an analysis, computes the [lower, upper] bounds on times for rendering a plot.

Given a pair index and an analysis, computes the [lower, upper] bounds on
times for rendering a plot.
sourceraw docstring

time-coordsclj

(time-coords pair-index [tmin tmax] ops)

Takes a pair index, time bounds, and a set of ops. Returns a map of op indices to logical [start-time end-time] coordinates.

Takes a pair index, time bounds, and a set of ops. Returns a map of op
indices to logical [start-time end-time] coordinates.
sourceraw docstring

transition-colorclj

(transition-color transition)

What color should a transition be?

What color should a transition be?
sourceraw docstring

type->colorclj

source

vscaleclj

(vscale x)

Convert our units to vertical CSS pixels

Convert our units to vertical CSS pixels
sourceraw docstring

warp-time-coordinatesclj

(warp-time-coordinates time-coords bars)

Often times there are dead spots or very dense spots in the time axis. We want to make the plot easier to read by compacting unused regions. Returns a function of times to warped times.

Often times there are dead spots or very dense spots in the time axis. We
want to make the plot easier to read by compacting unused regions. Returns a
function of times to warped times.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close