Last active
March 25, 2024 01:39
-
-
Save bluesmoon/78861b6983548337982d1c0125caa554 to your computer and use it in GitHub Desktop.
vega-lite spec for unit test gannt chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
| "layer": [ | |
| { | |
| "encoding": { | |
| "x2": { | |
| "field": "t_end" | |
| }, | |
| "color": { | |
| "field": "status", | |
| "title": "Status", | |
| "type": "nominal", | |
| "scale": { | |
| "domain": [ | |
| "Pass", | |
| "Fail", | |
| "Error" | |
| ], | |
| "scheme": "tableau10" | |
| }, | |
| "legend": { | |
| "symbolOpacity": 0.9, | |
| "rowPadding": 8, | |
| "padding": 0, | |
| "labelFontSize": 11, | |
| "labelColor": "#706D6C", | |
| "symbolType": "square" | |
| } | |
| }, | |
| "y": { | |
| "axis": { | |
| "labelFontSize": 11, | |
| "domain": true, | |
| "labels": true, | |
| "labelPadding": 6, | |
| "grid": false, | |
| "ticks": false, | |
| "orient": "right" | |
| }, | |
| "sort": { | |
| "field": "t_start", | |
| "op": "min" | |
| }, | |
| "field": "name", | |
| "title": null, | |
| "type": "nominal" | |
| } | |
| }, | |
| "mark": { | |
| "height": 16, | |
| "cornerRadius": 8, | |
| "tooltip": true, | |
| "type": "bar", | |
| "opacity": 0.8 | |
| } | |
| }, | |
| { | |
| "encoding": { | |
| "theta": { | |
| "field": "coverage", | |
| "type": "quantitative", | |
| "scale": { | |
| "domainMax": 1, | |
| "domainMin": 0, | |
| "range": [ | |
| 1.85619449, | |
| 8.139379797 | |
| ], | |
| "type": "linear" | |
| } | |
| }, | |
| "x": { | |
| "axis": { | |
| "format": "%-Hh%-Mm", | |
| "labelFontSize": 11, | |
| "domain": true, | |
| "labels": true, | |
| "labelPadding": 6, | |
| "grid": true, | |
| "ticks": true, | |
| "orient": "bottom" | |
| }, | |
| "field": "right_of_label", | |
| "title": null, | |
| "type": "temporal" | |
| }, | |
| "color": { | |
| "field": "coverage", | |
| "title": "Coverage", | |
| "type": "quantitative", | |
| "scale": { | |
| "domainMax": 1, | |
| "domainMin": 0, | |
| "type": "linear", | |
| "scheme": "redyellowgreen" | |
| }, | |
| "legend": { | |
| "symbolOpacity": 0.9, | |
| "format": ".0%", | |
| "rowPadding": 8, | |
| "padding": 0, | |
| "labelFontSize": 11, | |
| "labelColor": "#706D6C", | |
| "symbolType": "square" | |
| } | |
| }, | |
| "theta2": { | |
| "field": "pie-start" | |
| } | |
| }, | |
| "mark": { | |
| "radius": 8, | |
| "type": "arc", | |
| "opacity": 1 | |
| } | |
| }, | |
| { | |
| "encoding": { | |
| "text": { | |
| "field": "time_label", | |
| "type": "nominal" | |
| } | |
| }, | |
| "mark": { | |
| "dx": 5, | |
| "type": "text", | |
| "align": "left" | |
| } | |
| } | |
| ], | |
| "encoding": { | |
| "tooltip": [ | |
| { | |
| "field": "name", | |
| "title": " ", | |
| "type": "nominal" | |
| }, | |
| { | |
| "format": "%H:%M:%S.%L", | |
| "field": "t_start", | |
| "title": "Start", | |
| "type": "temporal" | |
| }, | |
| { | |
| "format": "%H:%M:%S.%L", | |
| "field": "t_end", | |
| "title": "End", | |
| "type": "temporal" | |
| }, | |
| { | |
| "field": "time_label", | |
| "title": "Time", | |
| "type": "nominal" | |
| }, | |
| { | |
| "field": "status", | |
| "title": "Status", | |
| "type": "nominal" | |
| }, | |
| { | |
| "format": ".2%", | |
| "field": "coverage", | |
| "title": "Coverage", | |
| "type": "nominal" | |
| } | |
| ], | |
| "x": { | |
| "axis": { | |
| "format": "%-Hh%-Mm", | |
| "labelFontSize": 11, | |
| "domain": true, | |
| "labels": true, | |
| "labelPadding": 6, | |
| "grid": true, | |
| "ticks": true, | |
| "orient": "bottom" | |
| }, | |
| "field": "t_start", | |
| "title": null, | |
| "type": "temporal" | |
| }, | |
| "y": { | |
| "axis": { | |
| "labelFontSize": 11, | |
| "domain": true, | |
| "labels": true, | |
| "labelPadding": 6, | |
| "grid": true, | |
| "ticks": false, | |
| "orient": "left" | |
| }, | |
| "sort": { | |
| "field": "t_start", | |
| "op": "min" | |
| }, | |
| "field": "name", | |
| "title": null, | |
| "type": "nominal" | |
| } | |
| }, | |
| "data": { | |
| "values": [ | |
| { | |
| "time": 5661, | |
| "name": "XXXXX", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:13.661", | |
| "t_start": "2024-03-23T00:00:08", | |
| "failures": 0, | |
| "coverage": 0.35714285714285715, | |
| "covered_lines": 5, | |
| "errors": 0, | |
| "total_lines": 14, | |
| "uncovered_lines": 9, | |
| "time_label": "5.7s", | |
| "tests": 6 | |
| }, | |
| { | |
| "time": 13875, | |
| "name": "YYYYY", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:17.875", | |
| "t_start": "2024-03-23T00:00:04", | |
| "failures": 0, | |
| "coverage": 0.4, | |
| "covered_lines": 4, | |
| "errors": 0, | |
| "total_lines": 10, | |
| "uncovered_lines": 6, | |
| "time_label": "14s", | |
| "tests": 19 | |
| }, | |
| { | |
| "time": 16284, | |
| "name": "ZZZZZ", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:20.284", | |
| "t_start": "2024-03-23T00:00:04", | |
| "failures": 0, | |
| "coverage": 0.7435897435897436, | |
| "covered_lines": 29, | |
| "errors": 0, | |
| "total_lines": 39, | |
| "uncovered_lines": 10, | |
| "time_label": "16s", | |
| "tests": 6 | |
| }, | |
| { | |
| "time": 32035, | |
| "name": "AAAAA", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:35.035", | |
| "t_start": "2024-03-23T00:00:03", | |
| "failures": 0, | |
| "coverage": 0.8571428571428571, | |
| "covered_lines": 24, | |
| "errors": 0, | |
| "total_lines": 28, | |
| "uncovered_lines": 4, | |
| "time_label": "32s", | |
| "tests": 15 | |
| }, | |
| { | |
| "time": 37735, | |
| "name": "BBBBB", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:37.735", | |
| "t_start": "2024-03-23T00:00:00", | |
| "failures": 0, | |
| "coverage": 0.25196850393700787, | |
| "covered_lines": 32, | |
| "errors": 0, | |
| "total_lines": 127, | |
| "uncovered_lines": 95, | |
| "time_label": "38s", | |
| "tests": 9 | |
| }, | |
| { | |
| "time": 34653, | |
| "name": "Curl", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:39.653", | |
| "t_start": "2024-03-23T00:00:05", | |
| "failures": 0, | |
| "coverage": 0.6666666666666666, | |
| "covered_lines": 8, | |
| "errors": 0, | |
| "total_lines": 12, | |
| "uncovered_lines": 4, | |
| "time_label": "35s", | |
| "tests": 29 | |
| }, | |
| { | |
| "time": 36498, | |
| "name": "LogConfig", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:40.498", | |
| "t_start": "2024-03-23T00:00:04", | |
| "failures": 0, | |
| "coverage": 0.5348837209302325, | |
| "covered_lines": 23, | |
| "errors": 0, | |
| "total_lines": 43, | |
| "uncovered_lines": 20, | |
| "time_label": "36s", | |
| "tests": 23 | |
| }, | |
| { | |
| "time": 47022, | |
| "name": "DDDDD", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:00:54.022", | |
| "t_start": "2024-03-23T00:00:07", | |
| "failures": 0, | |
| "coverage": 0.6914893617021277, | |
| "covered_lines": 65, | |
| "errors": 0, | |
| "total_lines": 94, | |
| "uncovered_lines": 29, | |
| "time_label": "47s", | |
| "tests": 38 | |
| }, | |
| { | |
| "time": 223546, | |
| "name": "AWWWWW", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:48:58.546", | |
| "t_start": "2024-03-23T00:45:15", | |
| "failures": "0", | |
| "coverage": 0.8016528925619835, | |
| "covered_lines": 97, | |
| "errors": "0", | |
| "total_lines": 121, | |
| "uncovered_lines": 24, | |
| "time_label": "4m43s", | |
| "tests": "204" | |
| }, | |
| { | |
| "time": 343178, | |
| "name": "AWWWWW", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T00:55:34.178", | |
| "t_start": "2024-03-23T00:49:51", | |
| "failures": "0", | |
| "coverage": 0.0, | |
| "covered_lines": 0, | |
| "errors": "0", | |
| "total_lines": 1, | |
| "uncovered_lines": 1, | |
| "time_label": "6m43s", | |
| "tests": "26" | |
| }, | |
| { | |
| "time": 746765, | |
| "name": "WHAAAA", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:00:17.765", | |
| "t_start": "2024-03-23T00:47:51", | |
| "failures": "0", | |
| "coverage": 0.9432432432432433, | |
| "covered_lines": 349, | |
| "errors": "0", | |
| "total_lines": 370, | |
| "uncovered_lines": 21, | |
| "time_label": "12m26s", | |
| "tests": "3845" | |
| }, | |
| { | |
| "time": 814178, | |
| "name": "DSSSSSS", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:01:34.178", | |
| "t_start": "2024-03-23T00:48:00", | |
| "failures": "0", | |
| "coverage": 1.0, | |
| "covered_lines": 40, | |
| "errors": "0", | |
| "total_lines": 40, | |
| "uncovered_lines": 0, | |
| "time_label": "14m34s", | |
| "tests": "4035" | |
| }, | |
| { | |
| "time": 822804, | |
| "name": "DSASSS", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:02:02.804", | |
| "t_start": "2024-03-23T00:48:20", | |
| "failures": "0", | |
| "coverage": 0.0, | |
| "covered_lines": 0, | |
| "errors": "0", | |
| "total_lines": 1, | |
| "uncovered_lines": 1, | |
| "time_label": "14m42s", | |
| "tests": "301" | |
| }, | |
| { | |
| "time": 183324, | |
| "name": "WHAAAA", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:04:47.324", | |
| "t_start": "2024-03-23T01:01:44", | |
| "failures": "0", | |
| "coverage": 0.0, | |
| "covered_lines": 0, | |
| "errors": "0", | |
| "total_lines": 1, | |
| "uncovered_lines": 1, | |
| "time_label": "3m3s", | |
| "tests": "26" | |
| }, | |
| { | |
| "time": 156443, | |
| "name": "DSSSSSS", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:05:25.443", | |
| "t_start": "2024-03-23T01:02:49", | |
| "failures": "0", | |
| "coverage": 0.0, | |
| "covered_lines": 0, | |
| "errors": "0", | |
| "total_lines": 1, | |
| "uncovered_lines": 1, | |
| "time_label": "3m36s", | |
| "tests": "26" | |
| }, | |
| { | |
| "time": 1298816, | |
| "name": "RAAAAAA", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:07:23.816", | |
| "t_start": "2024-03-23T00:45:45", | |
| "failures": "0", | |
| "coverage": 0.0, | |
| "covered_lines": 0, | |
| "errors": "0", | |
| "total_lines": 1, | |
| "uncovered_lines": 1, | |
| "time_label": "22m38s", | |
| "tests": "176" | |
| }, | |
| { | |
| "time": 1725832, | |
| "name": "AAAAAD", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:10:53.832", | |
| "t_start": "2024-03-23T00:42:08", | |
| "failures": "0", | |
| "coverage": 0.7943368107302533, | |
| "covered_lines": 1066, | |
| "errors": "0", | |
| "total_lines": 1342, | |
| "uncovered_lines": 276, | |
| "time_label": "29m45s", | |
| "tests": "5649" | |
| }, | |
| { | |
| "time": 133802, | |
| "name": "AAAAAD", | |
| "status": "Pass", | |
| "t_end": "2024-03-23T01:13:38.802", | |
| "t_start": "2024-03-23T01:11:25", | |
| "failures": "0", | |
| "coverage": 0.0, | |
| "covered_lines": 0, | |
| "errors": "0", | |
| "total_lines": 1, | |
| "uncovered_lines": 1, | |
| "time_label": "134s", | |
| "tests": "30" | |
| } | |
| ] | |
| }, | |
| "title": { | |
| "anchor": "start", | |
| "dy": -15, | |
| "fontSize": 14, | |
| "text": "Tests Gantt Chart", | |
| "color": "#706D6C" | |
| }, | |
| "width": 3700, | |
| "transform": [ | |
| { | |
| "calculate": "if(datum.time > 50000, datum.t_end+12000, datum.t_start+50000)", | |
| "as": "right_of_label" | |
| }, | |
| { | |
| "calculate": "0", | |
| "as": "pie-start" | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment