diff --git a/dashboard/canvas.py b/dashboard/canvas.py index eca3d55..3eb2a14 100644 --- a/dashboard/canvas.py +++ b/dashboard/canvas.py @@ -312,14 +312,7 @@ def circle(self, x:float, y:float, radius:float, fill="white", lineWidth=0, colo x = math.ceil(x * self.scaleX + self.offsetX) y = math.ceil(y * self.scaleY + self.offsetY) radius = math.ceil(radius * self.scaleX) - self.setFillStyle(fill) - self.context.beginPath() - self.context.arc(x, y, radius, 0, 2 * math.pi) - self.context.fill() - if lineWidth: - self.setStrokeStyle(color) - self.setLineWidth(lineWidth) - self.context.stroke() + js.circle(self.context, x, y, radius, fill, lineWidth, color) def absolute(self, x:float=0.0, y:float=0.0, w:float=0.0, h:float=0.0): return ( diff --git a/dashboard/views/marker.py b/dashboard/views/marker.py index b016888..b99444d 100644 --- a/dashboard/views/marker.py +++ b/dashboard/views/marker.py @@ -22,12 +22,13 @@ class MarkerView(View): + radius = 14 model = Marker - images = { - api.config.EVENT_KIND_INFO: js.jQuery("#marker-info"), - api.config.EVENT_KIND_WARN: js.jQuery("#marker-warn"), - api.config.EVENT_KIND_DEBUG: js.jQuery("#marker-debug"), - api.config.EVENT_KIND_ERROR: js.jQuery("#marker-error"), + colors = { + api.config.EVENT_KIND_INFO: "#FFFF00", + api.config.EVENT_KIND_WARN: "#F97B41", + api.config.EVENT_KIND_DEBUG: "#FF00FF", + api.config.EVENT_KIND_ERROR: "#FF0000", } offset = { api.config.EVENT_KIND_INFO: 4, @@ -40,10 +41,10 @@ class MarkerView(View): @profiler.profile("StatusView.__init__") def __init__(self, canvas, model): View.__init__(self, canvas, model) - self.image = self.images[self.kind] - self.x = self.when * config.PIXELS_PER_SECOND - self.canvas.fromScreenDimension(18) - self.w = self.canvas.fromScreenDimension(36) - self.h = self.canvas.fromScreenDimension(36) + self.color = self.colors[self.kind] + self.x = self.when * config.PIXELS_PER_SECOND - self.canvas.fromScreenDimension(self.radius / 2) + self.w = self.canvas.fromScreenDimension(self.radius) + self.h = self.canvas.fromScreenDimension(self.radius) self.index = len(MarkerView.instances) MarkerView.instances.append(self) @@ -69,17 +70,17 @@ def getShortName(self): @profiler.profile("Marker.offscreen") def offscreen(self, scaleX, offsetX, width): - self.x = self.when * config.PIXELS_PER_SECOND - self.canvas.fromScreenDimension(18) + self.x = self.when * config.PIXELS_PER_SECOND - self.canvas.fromScreenDimension(self.radius / 2) self.y = 105 - self.offset[self.kind] - self.w = self.canvas.fromScreenDimension(36) + self.w = self.canvas.fromScreenDimension(self.radius) return View.offscreen(self, scaleX, offsetX, width) @profiler.profile("Marker.draw") def draw(self): - self.x = self.when * config.PIXELS_PER_SECOND - self.canvas.fromScreenDimension(18) + self.x = self.when * config.PIXELS_PER_SECOND - self.canvas.fromScreenDimension(self.radius / 2) self.y = 105 - self.offset[self.kind] - self.w = self.canvas.fromScreenDimension(36) - self.canvas.image(self.x, self.y, self.w, self.h, self.image, "#666", 3) + self.w = self.canvas.fromScreenDimension(self.radius) + self.canvas.circle(self.x + self.w / 2, self.y + self.radius / 2, self.w / 2, self.color, 1, "black") def mouseenter(self, x, y): View.mouseenter(self, x, y) diff --git a/index.html b/index.html index 933a193..4424e85 100644 --- a/index.html +++ b/index.html @@ -146,11 +146,11 @@ #marker-highlight { left: -100px; - width: 36px; - height: 36px; + width: 16px; + height: 16px; + border-radius: 8px; position: absolute; - background-color: transparent; - border: 1px solid white; + background-color: blue; } #call-highlight-top, #call-highlight-bottom, #call-highlight-left, #call-highlight-right { @@ -529,14 +529,6 @@