Skip to content

Commit

Permalink
Make the markers a bit more subtle
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Aug 5, 2023
1 parent bd789f7 commit 7e6d833
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
9 changes: 1 addition & 8 deletions dashboard/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
29 changes: 15 additions & 14 deletions dashboard/views/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)

Expand All @@ -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)
Expand Down
30 changes: 18 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -529,14 +529,6 @@
</div>

<div class="hidden">
<img id="marker-info" width=32 height=32
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAhFBMVEVHcExQUz05PkVDSEE9Q0NBRkI8QUQ5P0U9QkQ8QUQ9QkQ+Q0M/REI+Q0M5P0U4PkX/YUT/9QD/8wBfYTg9QkTx5gT06ATu4wZnaDXn3Aj87wH26gKBgCx6eS7a0A1ubzKHhSq6sxg7QETe1AuRjiappB6uqBxKTj9QUz20rhoATypHcEweUJTOAAAALHRSTlMA8I3iEds8fiozvBbPxWJb////////////////////////////////////AJ/4vTYAAAFgSURBVDjLlVPZtoMgDKwratUeQSki4laX/v8PXhEs2NpzbvOEZEwmYeZy+SFcPwW2DVLfPU0HILZIzVhNrBgEH+krcMjICwohxXxsHHA95sMEPQu4R4Y7FIVm3vdYKXP3u4SUzPON/70Wb/d0RGii2xE/vFeNa8JkHg5L3y+DPFcs2nkApOpDPuf5zNVHiYCaz3nu7KrHPD+qnWrnyGkB0fwp5/T1gZuthBuPUN+toaedErFT3+I6XyNU63qDJQZJjQ4F6nt013hyExRqagDy3ADQWpCwGfwGgK39H4BoIR7xa4uU4G8VJElzzDeAHHNdVAZVkyNALeoCGnxeoZKrXh+ry84AWecF5nPTd0BJwC6YaBeMueqqjVwtOSWColmWplDSiIOjaAUPWq5BN9G2sX+QfUQ6nL3mqzoSBR/GaaYBb8YZpsYD7on1ktV6bbtaLzmx3ia+8CbMewvdXyz/B10jNebUUEUhAAAAAElFTkSuQmCC">
<img id="marker-warn" width=32 height=32
src="data:image/webp;base64,UklGRiIOAABXRUJQVlA4WAoAAAAwAAAAHwAAHwAASUNDUNALAAAAAAvQAAAAAAIAAABtbnRyUkdCIFhZWiAH3wACAA8AAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAA9tYAAQAAAADTLQAAAAA9DrLerpOXvptnJs6MCkPOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBkZXNjAAABRAAAAGNiWFlaAAABqAAAABRiVFJDAAABvAAACAxnVFJDAAABvAAACAxyVFJDAAABvAAACAxkbWRkAAAJyAAAAIhnWFlaAAAKUAAAABRsdW1pAAAKZAAAABRtZWFz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F9Q3JBZ/BLAMoYEbOdNPb71EXJKgPEnR3eqwefkgOwTxQngAr+GpY2X/QWqlRli1ZheXdB4Y3sI0xAhUsy3jwDcyujmhOczQlOaaWB+x/AjLCGtDECI7ww5J2nn9UyhsWNzfsPP5IFvgJLvEWBmU/suBRdhgFongPv+A//At+Cb+hOEagBXPwAs/gtQLoYv4=">
<img id="marker-debug" width=32 height=32
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAABR1BMVEVHcEw1XhZaeB5aeB5LbRpaeB5Ydx1MbBpIahmCoDJWdh02XxZGahk1XhaevCymwzJZdx1aeh671kvQ6VqcuTFwkiI/ZRg1XhZZdx01XhZaeB40XRU1XhY1XhY1XhZaeB40XRaevCzQ6VpZdx41XhZaeB51kyM1XhZaeB5aeB6fvSxaeB5beR41XhaTsSlaeB5aeB5aeB02XxafvSyPriievCxxkSaduyw1XhY1XhY1XhY1XhZaeB5hfyCduECCoiaevCy10EmevCzO51nQ6VqevCxXdh2AniaMqihKbRqFoTQ1XhZaeB6fvSyevCyauStLcRt0kSvS61vQ6VqevCxaeB6evCzR6lqfvSxZdx00XhaWtCpigCClwjLL5VQ7YxeHpCm/2UvF31FWdR2PrihohiKbuS1cfR5+nimuyjuhvUGct0BPcBzzZoeBAAAAVXRSTlMA2vNDCtf5BAwBUPoU9DsLxzkbO9f5JOcwQqQvOY22jpn1sJiBKSN2zqupgd+k9+d2ucXIGCzRz0hO0VLc9/PIucixd/ij2epT6jigoN9Rds5NxLx3WA6UAwAAAehJREFUOMt10mlX2kAUBuCbhDBZCELCKooguLBUCy513+1etUtWRZDi1vb/f+7MZJDAMfdLcu77nJnJ3AAEypg3AOIncQgp/ad9CvDLOloPAcbZD12S1tfKIUvIxtlxJdEuHYYBMA5uzN9dr5sOA9/3XQI8VQkBFdOkwCu9nkcSrutS0I4E2pIgDd8S972/f57Sj932S2tLggY/x7yeurPt245jDTbZRURmtSoIoukLfd62CbAsxznR/dzj8g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Z6iOxKCYkAygI5h1nDG+z5oWxSNKhLKKASI2hJi7muCpZPhefR/O7k+ZKG900G+6u/CXT7bjSBfzFxn2uj55YuxGhq3GqHOLYbBR8aI98YB1cklNVqM/z13ub2/Zns+n2E8avGcibib3Wbj/JPd28fr+2DmB1EMSVxgvTPGAAAAAElFTkSuQmCC">
</div>
<div id="marker-highlight" class="highlight marker-highlight"></div>
<div id="call-highlight-left" class="highlight call-highlight"></div>
Expand Down Expand Up @@ -636,6 +628,20 @@
context.stroke()
}
}

function circle(context, x, y, radius, fill, lineWidth, color) {
context.beginPath()
context.arc(x, y, radius, 0, 2 * Math.PI)
context.fillStyle = fill
console.log("circle", fill)
context.fill()
if (lineWidth) {
context.strokeStyle = color
context.lineWidth = lineWidth
context.stroke()
}

}

// Hide the pyscript splash screen
setTimeout(() => $("py-splashscreen").text(""), 10);
Expand Down

0 comments on commit 7e6d833

Please sign in to comment.