From 1d8370e8b8ee457a515117ac25b88656ae5533ec Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Thu, 11 Apr 2024 21:45:53 +0200 Subject: [PATCH] Allow adding operations that are not part of any linearization --- checker.go | 5 +++++ visualization/index.js | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/checker.go b/checker.go index 01c9566..5668760 100644 --- a/checker.go +++ b/checker.go @@ -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 { diff --git a/visualization/index.js b/visualization/index.js index 6988c4d..33aa938 100644 --- a/visualization/index.js +++ b/visualization/index.js @@ -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, @@ -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', {