瀏覽代碼

forcegraph: color theme 4

Nils Schneider 9 年之前
父節點
當前提交
d1beb51868
共有 2 個文件被更改,包括 10 次插入15 次删除
  1. 9 14
      lib/forcegraph.js
  2. 1 1
      scss/_forcegraph.scss

+ 9 - 14
lib/forcegraph.js

@@ -309,13 +309,13 @@ define(["d3"], function (d3) {
         }
       })
 
-      ctx.fillStyle = "rgba(220, 0, 103, 0.7)"
+      ctx.fillStyle = "#99173C"
       ctx.fill()
 
       if (highlightedLinks.length) {
         ctx.save()
         ctx.lineWidth = 10
-        ctx.strokeStyle = "#FFD486"
+        ctx.strokeStyle = "#F2AB38"
 
         highlightedLinks.forEach(function (d) {
           ctx.beginPath()
@@ -351,12 +351,9 @@ define(["d3"], function (d3) {
         ctx.arc(d.x, d.y, 8, 0, 2 * Math.PI)
       })
 
-      ctx.strokeStyle = "#d00000"
-      ctx.fillStyle = "#ffffff"
-      ctx.lineWidth = 2.5
+      ctx.fillStyle = "#555152"
 
       ctx.fill()
-      ctx.stroke()
 
       ctx.beginPath()
       nodes.filter(visibleNodes).forEach(function (d) {
@@ -364,16 +361,14 @@ define(["d3"], function (d3) {
         ctx.arc(d.x, d.y, 8, 0, 2 * Math.PI)
       })
 
-      ctx.strokeStyle = "#AEC7E8"
-      ctx.fillStyle = "#ffffff"
+      ctx.fillStyle = "#EFFFCD"
 
       ctx.fill()
-      ctx.stroke()
 
       if (highlightedNodes.length) {
         ctx.save()
-        ctx.strokeStyle = "#FFD486"
-        ctx.fillStyle = "orange"
+        ctx.strokeStyle = "#F2AB38"
+        ctx.fillStyle = "#EFFFCD"
         ctx.lineWidth = 6
 
         highlightedNodes.forEach(function (d) {
@@ -569,7 +564,7 @@ define(["d3"], function (d3) {
         e.target = newNodesDict[d.target.id]
 
         if (d.vpn)
-          e.color = "rgba(0, 0, 0, " + (0.5 / d.tq) + ")"
+          e.color = "rgba(170, 162, 164, " + (0.6 / d.tq) + ")"
         else
           e.color = linkScale(d.tq).hex()
 
@@ -602,8 +597,8 @@ define(["d3"], function (d3) {
         bctx.textAlign = "center"
         bctx.lineWidth = lineWidth
         bctx.lineCap = "round"
-        bctx.strokeStyle = "rgba(255, 255, 255, 0.8)"
-        bctx.fillStyle = "rgba(0, 0, 0, 0.6)"
+        bctx.strokeStyle = "rgba(85, 81, 82, 0.03)"
+        bctx.fillStyle = "rgba(220, 233, 190, 0.8)"
         bctx.miterLimit = 2
         bctx.strokeText(name, buffer.width / (2 * scale), buffer.height / (2 * scale))
         bctx.fillText(name, buffer.width / (2 * scale), buffer.height / (2 * scale))

+ 1 - 1
scss/_forcegraph.scss

@@ -1,7 +1,7 @@
 .graph {
   height: 100%;
   width: 100%;
-  background: url(img/gplaypattern.png);
+  background: #2E2633;
 
   canvas {
     display: block;