Ver Fonte

add comparison graph

Saul Shanabrook há 4 anos atrás
pai
commit
91d8dae9a8
2 ficheiros alterados com 65 adições e 1 exclusões
  1. 61 0
      benchmarks/comparison.vl.json
  2. 4 1
      benchmarks/package.json

+ 61 - 0
benchmarks/comparison.vl.json

@@ -0,0 +1,61 @@
+{
+  "data": {
+    "url": "./diff.csv",
+    "format": {
+      "type": "csv",
+      "parse": {
+        "confidenceInterval": "number",
+        "mean": "number",
+        "n": "number"
+      }
+    }
+  },
+  "facet": {
+    "row": { "field": "mode", "type": "nominal" },
+    "column": { "field": "type" }
+  },
+  "spec": {
+    "encoding": {
+      "color": {
+        "field": "browser",
+        "type": "nominal"
+      },
+      "x": {
+        "field": "n",
+        "type": "quantitative",
+        "scale": {}
+      }
+    },
+    "layer": [
+      {
+        "mark": {
+          "type": "errorband",
+          "clip": true
+        },
+        "encoding": {
+          "y": {
+            "field": "mean",
+            "type": "quantitative",
+            "scale": { "domain": [0, 2] },
+            "title": "Ratio of Time (95% CI)"
+          },
+          "yError": { "field": "confidenceInterval" }
+        }
+      },
+      {
+        "mark": {
+          "type": "line",
+          "clip": true,
+          "tooltip": true,
+          "size": 1
+        },
+        "encoding": {
+          "y": {
+            "field": "mean",
+            "type": "quantitative"
+          }
+        }
+      }
+    ]
+  }
+}

+ 4 - 1
benchmarks/package.json

@@ -8,8 +8,9 @@
     "start:jlab": "fkill -s :9999 && cd .. && jupyter lab --dev --no-browser --port 9999 --LabApp.password= --LabApp.token=",
     "start:benchmark": "wait-on http-get://localhost:9999/lab && node --experimental-modules --es-module-specifier-resolution=node lib/index.js",
     "start:all": "npm-run-all --parallel start:jlab start:benchmark --race",
-    "start:analysis": "cd .. && jupyter lab --dev benchmarks/analysis.vl.json",
+    "start:analysis": "vl2png analysis.vl.json > analysis.png && open analysis.png",
     "start:compare": "node lib/compare.js",
+    "start:compare-graph": "vl2png comparison.vl.json > comparison.png && open comparison.png",
     "all": "npm-run-all build:* start:all start:analysis"
   },
   "dependencies": {
@@ -22,6 +23,8 @@
     "fkill-cli": "6.0.1",
     "npm-run-all": "4.1.5",
     "typescript": "~3.7.3",
+    "vega-cli": "5.13.0",
+    "vega-lite": "4.14.0",
     "wait-on": "4.0.1"
   },
   "bin": {