Skip to content

Commit

Permalink
Allow adding operations that are not part of any linearization
Browse files Browse the repository at this point in the history
  • Loading branch information
serathius committed Apr 12, 2024
1 parent 629b8ef commit c39cbb3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ type linearizationInfo struct {
partialLinearizations [][][]int // for each partition, a set of histories (list of ids)
}

func (info *linearizationInfo) AddOperations(operations []Operation) {
info.partialLinearizations = append(info.partialLinearizations, [][]int{})
info.history = append(info.history, makeEntries(operations))
}

type byTime []entry

func (a byTime) Len() int {
Expand Down
9 changes: 8 additions & 1 deletion visualization/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ text {
stroke-width: 1;
}

.history-rect {
.non-linearization-rect {
stroke: #888;
stroke-width: 1;
fill: #a4a4a4;
}


.linearization-rect {
stroke: #888;
stroke-width: 1;
fill: #42d1f5;
Expand Down
6 changes: 5 additions & 1 deletion visualization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ function render(data) {
const width = xPos[el['End']] - rx
const x = rx + XOFF + PADDING
const y = PADDING + el['ClientId'] * (BOX_HEIGHT + BOX_SPACE)
let rectClass = 'linearization-rect';
if (partition['PartialLinearizations'].length === 0) {
rectClass = 'non-linearization-rect'
}
rects.push(
svgadd(g, 'rect', {
height: BOX_HEIGHT,
Expand All @@ -337,7 +341,7 @@ function render(data) {
y: y,
rx: HISTORY_RECT_RADIUS,
ry: HISTORY_RECT_RADIUS,
class: 'history-rect',
class: rectClass,
})
)
const text = svgadd(g, 'text', {
Expand Down

0 comments on commit c39cbb3

Please sign in to comment.