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 ---------->
(activate-line element reachable)
On hover, highlights all related IDs for this element.
On hover, highlights all related IDs for this element.
(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.
(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.
(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.
(hscale x)
Convert our units to horizontal CSS pixels
Convert our units to horizontal CSS pixels
(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.
(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.
(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].
How small should we quantize the graph?
How small should we quantize the graph?
(model-numbers models)
A map which takes models and returns an integer.
A map which takes models and returns an integer.
(models analysis)
Computes distinct models in an analysis.
Computes distinct models in an analysis.
(op-color pair-index op)
What color should an op be?
What color should an op be?
(ops analysis)
Computes distinct ops in an analysis.
Computes distinct ops in an analysis.
(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.
(path-bounds {:keys [time-coords process-coords]} eindex->kindex 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.
(paths analysis time-coords process-coords eindex->kindex)
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.
(paths->initial-lines paths)
Takes a collection of paths and returns:
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.
(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:
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.
(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, ...
How tall should an op be in process space?
How tall should an op be in process space?
(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.
(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.
(render-analysis! history analysis file)
Render an entire analysis.
Render an entire analysis.
(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.
(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.
(render-ops {:keys [hscale time-coords process-coords pair-index ops
kindex->eindex]})
Given learnings, renders all operations as a group of SVG tags.
Given learnings, renders all operations as a group of SVG tags.
(render-process-legend {:keys [process-coords]})
Process numbers and time arrow
Process numbers and time arrow
(set-attr elem attr value)
Set a single xml attribute
Set a single xml attribute
(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.
(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.
(transition-color transition)
What color should a transition be?
What color should a transition be?
(vscale x)
Convert our units to vertical CSS pixels
Convert our units to vertical CSS pixels
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close