@connectci/xdmod-charts 0.0.0-stage → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/dist/caption.d.ts +68 -0
  4. package/dist/caption.js +118 -0
  5. package/dist/csv.d.ts +22 -0
  6. package/dist/csv.js +95 -0
  7. package/dist/fixtures.d.ts +58 -0
  8. package/dist/fixtures.js +1 -0
  9. package/dist/format.d.ts +6 -0
  10. package/dist/format.js +39 -0
  11. package/dist/generated/palette.d.ts +4 -0
  12. package/dist/generated/palette.js +23 -0
  13. package/dist/generated/statistics.d.ts +6 -0
  14. package/dist/generated/statistics.js +217 -0
  15. package/dist/index.d.ts +13 -0
  16. package/dist/index.js +8 -0
  17. package/dist/measure.d.ts +7 -0
  18. package/dist/measure.js +14 -0
  19. package/dist/palette.d.ts +11 -0
  20. package/dist/palette.js +19 -0
  21. package/dist/parse.d.ts +3 -0
  22. package/dist/parse.js +82 -0
  23. package/dist/payload.d.ts +81 -0
  24. package/dist/payload.js +1 -0
  25. package/dist/view.d.ts +58 -0
  26. package/dist/view.js +243 -0
  27. package/fixtures/README.md +13 -0
  28. package/fixtures/aggregate-empty.json +85 -0
  29. package/fixtures/aggregate-fills-empty-buckets.json +118 -0
  30. package/fixtures/aggregate-has-more-others-count.json +103 -0
  31. package/fixtures/aggregate-incomplete-with-probe-day.json +108 -0
  32. package/fixtures/aggregate-jobs-by-resource.json +66 -0
  33. package/fixtures/aggregate-marks-resources-that-stop.json +125 -0
  34. package/fixtures/aggregate-no-fill-for-average.json +115 -0
  35. package/fixtures/aggregate-no-fill-incomplete-buckets.json +110 -0
  36. package/fixtures/aggregate-no-fill-when-bucket-filtered.json +114 -0
  37. package/fixtures/aggregate-no-fill-when-more.json +110 -0
  38. package/fixtures/aggregate-no-fill-with-offset.json +110 -0
  39. package/fixtures/aggregate-nominal-not-reordered.json +107 -0
  40. package/fixtures/aggregate-offset-page.json +103 -0
  41. package/fixtures/aggregate-ordered-bucket-order.json +116 -0
  42. package/fixtures/aggregate-probe-reaches-end.json +108 -0
  43. package/fixtures/aggregate-unknown-bucket-last.json +115 -0
  44. package/fixtures/aggregate-unordered.json +103 -0
  45. package/fixtures/average-leaves-gaps.json +125 -0
  46. package/fixtures/calendar-december-into-january.json +113 -0
  47. package/fixtures/calendar-range-ends-at-month-end.json +108 -0
  48. package/fixtures/cpu-hours-by-resource-incomplete.json +125 -0
  49. package/fixtures/early-end-average-by-resource-not-filled.json +147 -0
  50. package/fixtures/early-end-average-other-dimension.json +144 -0
  51. package/fixtures/early-end-daily-by-queue.json +180 -0
  52. package/fixtures/early-end-daily-series-stops.json +139 -0
  53. package/fixtures/early-end-day-inside-last-period.json +147 -0
  54. package/fixtures/early-end-fill-stops-at-last-day.json +145 -0
  55. package/fixtures/early-end-fills-to-resource-last-day.json +149 -0
  56. package/fixtures/early-end-other-dimension-never-filled.json +145 -0
  57. package/fixtures/early-end-probe-window-too-short.json +144 -0
  58. package/fixtures/early-end-resource-retired.json +144 -0
  59. package/fixtures/early-end-several-resources.json +205 -0
  60. package/fixtures/early-end-without-probe.json +140 -0
  61. package/fixtures/label-stripped-from-description.json +95 -0
  62. package/fixtures/no-series-values.json +86 -0
  63. package/fixtures/partial-last-day.json +119 -0
  64. package/fixtures/partial-last-month.json +122 -0
  65. package/fixtures/probe-day-after-range.json +113 -0
  66. package/fixtures/probe-day-inside-last-month.json +113 -0
  67. package/fixtures/probe-day-last-day-of-period.json +113 -0
  68. package/fixtures/rank-prefixes-on-series.json +130 -0
  69. package/fixtures/series-ended-before-probe-day.json +188 -0
  70. package/fixtures/timeseries-complete-last-period.json +113 -0
  71. package/fixtures/timeseries-month-gaps.json +121 -0
  72. package/fixtures/timeseries-more-series-than-palette.json +328 -0
  73. package/fixtures/warnings-all-three.json +104 -0
  74. package/fixtures/week-total-incomplete-last.json +135 -0
  75. package/fixtures/week-total-midweek-end.json +130 -0
  76. package/fixtures/week-total-midweek-start.json +129 -0
  77. package/package.json +32 -4
  78. package/rules/README.md +29 -0
  79. package/rules/palette.json +4 -0
  80. package/rules/statistics.json +217 -0
  81. package/schema/chart-payload.v1.json +320 -0
@@ -0,0 +1,103 @@
1
+ {
2
+ "description": "An aggregate by a nominal dimension keeps XDMoD's order.",
3
+ "producers": [
4
+ "ts",
5
+ "py"
6
+ ],
7
+ "input": {
8
+ "request": {
9
+ "realm": "Jobs",
10
+ "statistic": "job_count",
11
+ "group_by": "resource",
12
+ "dataset_type": "aggregate",
13
+ "start_date": "2026-08-01",
14
+ "end_date": "2026-11-08",
15
+ "filters_notes": [],
16
+ "dimension_filtered": false,
17
+ "offset": 0,
18
+ "limit": 10,
19
+ "unit": "Month"
20
+ },
21
+ "label": "Number of Jobs Ended",
22
+ "description": "Jobs run",
23
+ "today": "2026-11-09",
24
+ "others_count": 0,
25
+ "has_more": false,
26
+ "latest_data_day": null,
27
+ "resource_days": null,
28
+ "link": "https://xdmod.example/chart",
29
+ "time_zone": "America/New_York",
30
+ "instance": {
31
+ "name": "ACCESS XDMoD",
32
+ "url": "https://xdmod.access-ci.org"
33
+ },
34
+ "categories": [
35
+ {
36
+ "name": "Anvil",
37
+ "value": 9
38
+ },
39
+ {
40
+ "name": "Bridges 2 RM",
41
+ "value": 3
42
+ }
43
+ ]
44
+ },
45
+ "expected": {
46
+ "version": 1,
47
+ "realm": "Jobs",
48
+ "statistic": "job_count",
49
+ "group_by": "resource",
50
+ "dataset_type": "aggregate",
51
+ "requested": {
52
+ "start": "2026-08-01",
53
+ "end": "2026-11-08"
54
+ },
55
+ "counted": {
56
+ "start": "2026-08-01",
57
+ "end": "2026-11-08"
58
+ },
59
+ "last_period_incomplete": false,
60
+ "measure": {
61
+ "label": "Number of Jobs Ended",
62
+ "description": "Jobs run",
63
+ "kind": "total",
64
+ "missing": "zero",
65
+ "unit": "jobs"
66
+ },
67
+ "dimension": {
68
+ "name": "resource",
69
+ "ordered": false
70
+ },
71
+ "filters": {
72
+ "notes": []
73
+ },
74
+ "time_basis": {
75
+ "zone": "America/New_York"
76
+ },
77
+ "instance": {
78
+ "name": "ACCESS XDMoD",
79
+ "url": "https://xdmod.access-ci.org"
80
+ },
81
+ "warnings": [],
82
+ "offset": 0,
83
+ "data_through": null,
84
+ "data_through_precision": null,
85
+ "others_count": 0,
86
+ "last_data_period_partial": false,
87
+ "has_more": false,
88
+ "ranked_by": "value",
89
+ "link": "https://xdmod.example/chart",
90
+ "source": "XDMoD",
91
+ "retrieved": "2026-11-09",
92
+ "categories": [
93
+ {
94
+ "name": "Anvil",
95
+ "value": 9
96
+ },
97
+ {
98
+ "name": "Bridges 2 RM",
99
+ "value": 3
100
+ }
101
+ ]
102
+ }
103
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "description": "An average: missing periods stay null and the measure is a gap kind, with the mean-of-jobs warning.",
3
+ "producers": [
4
+ "ts",
5
+ "py"
6
+ ],
7
+ "input": {
8
+ "request": {
9
+ "realm": "Jobs",
10
+ "statistic": "avg_waitduration_hours",
11
+ "group_by": "resource",
12
+ "dataset_type": "timeseries",
13
+ "start_date": "2026-08-01",
14
+ "end_date": "2026-11-08",
15
+ "filters_notes": [],
16
+ "dimension_filtered": false,
17
+ "offset": 0,
18
+ "limit": 10,
19
+ "unit": "Month"
20
+ },
21
+ "label": "Number of Jobs Ended",
22
+ "description": "Jobs run",
23
+ "today": "2026-11-09",
24
+ "others_count": 0,
25
+ "has_more": false,
26
+ "latest_data_day": null,
27
+ "resource_days": null,
28
+ "link": "https://xdmod.example/chart",
29
+ "time_zone": "America/New_York",
30
+ "instance": {
31
+ "name": "ACCESS XDMoD",
32
+ "url": "https://xdmod.access-ci.org"
33
+ },
34
+ "series": [
35
+ {
36
+ "name": "Anvil",
37
+ "values": {
38
+ "2026-09-01": 5,
39
+ "2026-11-01": 7
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "expected": {
45
+ "version": 1,
46
+ "realm": "Jobs",
47
+ "statistic": "avg_waitduration_hours",
48
+ "group_by": "resource",
49
+ "dataset_type": "timeseries",
50
+ "unit": "Month",
51
+ "requested": {
52
+ "start": "2026-08-01",
53
+ "end": "2026-11-08"
54
+ },
55
+ "counted": {
56
+ "start": "2026-08-01",
57
+ "end": "2026-11-30"
58
+ },
59
+ "last_period_incomplete": true,
60
+ "measure": {
61
+ "label": "Number of Jobs Ended",
62
+ "description": "Jobs run",
63
+ "kind": "average",
64
+ "missing": "gap",
65
+ "unit": "hours"
66
+ },
67
+ "dimension": {
68
+ "name": "resource",
69
+ "ordered": false
70
+ },
71
+ "filters": {
72
+ "notes": []
73
+ },
74
+ "time_basis": {
75
+ "zone": "America/New_York"
76
+ },
77
+ "instance": {
78
+ "name": "ACCESS XDMoD",
79
+ "url": "https://xdmod.access-ci.org"
80
+ },
81
+ "warnings": [
82
+ {
83
+ "code": "waiting-not-counted",
84
+ "text": "Jobs still waiting aren't counted, and the last few days may be incomplete."
85
+ },
86
+ {
87
+ "code": "mean-of-jobs",
88
+ "text": "This is an average per job, so a few long jobs can pull it up."
89
+ }
90
+ ],
91
+ "offset": 0,
92
+ "data_through": "2026-11-01",
93
+ "data_through_precision": "period",
94
+ "others_count": 0,
95
+ "last_data_period_partial": false,
96
+ "has_more": false,
97
+ "ranked_by": "value",
98
+ "link": "https://xdmod.example/chart",
99
+ "source": "XDMoD",
100
+ "retrieved": "2026-11-09",
101
+ "series": [
102
+ {
103
+ "name": "Anvil",
104
+ "points": [
105
+ {
106
+ "start": "2026-08-01",
107
+ "value": null
108
+ },
109
+ {
110
+ "start": "2026-09-01",
111
+ "value": 5
112
+ },
113
+ {
114
+ "start": "2026-10-01",
115
+ "value": null
116
+ },
117
+ {
118
+ "start": "2026-11-01",
119
+ "value": 7
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ }
125
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "description": "Months roll from December into January; counted runs to the end of January.",
3
+ "producers": [
4
+ "ts",
5
+ "py"
6
+ ],
7
+ "input": {
8
+ "request": {
9
+ "realm": "Jobs",
10
+ "statistic": "job_count",
11
+ "group_by": "resource",
12
+ "dataset_type": "timeseries",
13
+ "start_date": "2026-12-01",
14
+ "end_date": "2027-01-05",
15
+ "filters_notes": [],
16
+ "dimension_filtered": false,
17
+ "offset": 0,
18
+ "limit": 10,
19
+ "unit": "Month"
20
+ },
21
+ "label": "Number of Jobs Ended",
22
+ "description": "Jobs run",
23
+ "today": "2026-11-09",
24
+ "others_count": 0,
25
+ "has_more": false,
26
+ "latest_data_day": null,
27
+ "resource_days": null,
28
+ "link": "https://xdmod.example/chart",
29
+ "time_zone": "America/New_York",
30
+ "instance": {
31
+ "name": "ACCESS XDMoD",
32
+ "url": "https://xdmod.access-ci.org"
33
+ },
34
+ "series": [
35
+ {
36
+ "name": "Anvil",
37
+ "values": {
38
+ "2026-12-01": 1,
39
+ "2027-01-01": 2
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "expected": {
45
+ "version": 1,
46
+ "realm": "Jobs",
47
+ "statistic": "job_count",
48
+ "group_by": "resource",
49
+ "dataset_type": "timeseries",
50
+ "unit": "Month",
51
+ "requested": {
52
+ "start": "2026-12-01",
53
+ "end": "2027-01-05"
54
+ },
55
+ "counted": {
56
+ "start": "2026-12-01",
57
+ "end": "2027-01-31"
58
+ },
59
+ "last_period_incomplete": true,
60
+ "measure": {
61
+ "label": "Number of Jobs Ended",
62
+ "description": "Jobs run",
63
+ "kind": "total",
64
+ "missing": "zero",
65
+ "unit": "jobs"
66
+ },
67
+ "dimension": {
68
+ "name": "resource",
69
+ "ordered": false
70
+ },
71
+ "filters": {
72
+ "notes": []
73
+ },
74
+ "time_basis": {
75
+ "zone": "America/New_York"
76
+ },
77
+ "instance": {
78
+ "name": "ACCESS XDMoD",
79
+ "url": "https://xdmod.access-ci.org"
80
+ },
81
+ "warnings": [
82
+ {
83
+ "code": "waiting-not-counted",
84
+ "text": "Jobs still waiting aren't counted, and the last few days may be incomplete."
85
+ }
86
+ ],
87
+ "offset": 0,
88
+ "data_through": "2027-01-01",
89
+ "data_through_precision": "period",
90
+ "others_count": 0,
91
+ "last_data_period_partial": false,
92
+ "has_more": false,
93
+ "ranked_by": "value",
94
+ "link": "https://xdmod.example/chart",
95
+ "source": "XDMoD",
96
+ "retrieved": "2026-11-09",
97
+ "series": [
98
+ {
99
+ "name": "Anvil",
100
+ "points": [
101
+ {
102
+ "start": "2026-12-01",
103
+ "value": 1
104
+ },
105
+ {
106
+ "start": "2027-01-01",
107
+ "value": 2
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ }
113
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "description": "A range that ends on a month's last day counts exactly to it.",
3
+ "producers": [
4
+ "ts",
5
+ "py"
6
+ ],
7
+ "input": {
8
+ "request": {
9
+ "realm": "Jobs",
10
+ "statistic": "job_count",
11
+ "group_by": "resource",
12
+ "dataset_type": "timeseries",
13
+ "start_date": "2026-08-01",
14
+ "end_date": "2026-09-30",
15
+ "filters_notes": [],
16
+ "dimension_filtered": false,
17
+ "offset": 0,
18
+ "limit": 10,
19
+ "unit": "Month"
20
+ },
21
+ "label": "Number of Jobs Ended",
22
+ "description": "Jobs run",
23
+ "today": "2026-11-09",
24
+ "others_count": 0,
25
+ "has_more": false,
26
+ "latest_data_day": null,
27
+ "resource_days": null,
28
+ "link": "https://xdmod.example/chart",
29
+ "time_zone": "America/New_York",
30
+ "instance": {
31
+ "name": "ACCESS XDMoD",
32
+ "url": "https://xdmod.access-ci.org"
33
+ },
34
+ "series": [
35
+ {
36
+ "name": "Anvil",
37
+ "values": {
38
+ "2026-08-01": 1,
39
+ "2026-09-01": 2
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "expected": {
45
+ "version": 1,
46
+ "realm": "Jobs",
47
+ "statistic": "job_count",
48
+ "group_by": "resource",
49
+ "dataset_type": "timeseries",
50
+ "unit": "Month",
51
+ "requested": {
52
+ "start": "2026-08-01",
53
+ "end": "2026-09-30"
54
+ },
55
+ "counted": {
56
+ "start": "2026-08-01",
57
+ "end": "2026-09-30"
58
+ },
59
+ "last_period_incomplete": false,
60
+ "measure": {
61
+ "label": "Number of Jobs Ended",
62
+ "description": "Jobs run",
63
+ "kind": "total",
64
+ "missing": "zero",
65
+ "unit": "jobs"
66
+ },
67
+ "dimension": {
68
+ "name": "resource",
69
+ "ordered": false
70
+ },
71
+ "filters": {
72
+ "notes": []
73
+ },
74
+ "time_basis": {
75
+ "zone": "America/New_York"
76
+ },
77
+ "instance": {
78
+ "name": "ACCESS XDMoD",
79
+ "url": "https://xdmod.access-ci.org"
80
+ },
81
+ "warnings": [],
82
+ "offset": 0,
83
+ "data_through": "2026-09-01",
84
+ "data_through_precision": "period",
85
+ "others_count": 0,
86
+ "last_data_period_partial": false,
87
+ "has_more": false,
88
+ "ranked_by": "value",
89
+ "link": "https://xdmod.example/chart",
90
+ "source": "XDMoD",
91
+ "retrieved": "2026-11-09",
92
+ "series": [
93
+ {
94
+ "name": "Anvil",
95
+ "points": [
96
+ {
97
+ "start": "2026-08-01",
98
+ "value": 1
99
+ },
100
+ {
101
+ "start": "2026-09-01",
102
+ "value": 2
103
+ }
104
+ ]
105
+ }
106
+ ]
107
+ }
108
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "description": "total_cpu_hours by resource with an incomplete last period: unit core-hours, two warnings in order.",
3
+ "producers": [
4
+ "ts",
5
+ "py"
6
+ ],
7
+ "input": {
8
+ "request": {
9
+ "realm": "Jobs",
10
+ "statistic": "total_cpu_hours",
11
+ "group_by": "resource",
12
+ "dataset_type": "timeseries",
13
+ "start_date": "2026-08-01",
14
+ "end_date": "2026-11-08",
15
+ "filters_notes": [],
16
+ "dimension_filtered": false,
17
+ "offset": 0,
18
+ "limit": 10,
19
+ "unit": "Month"
20
+ },
21
+ "label": "Number of Jobs Ended",
22
+ "description": "Jobs run",
23
+ "today": "2026-11-09",
24
+ "others_count": 0,
25
+ "has_more": false,
26
+ "latest_data_day": null,
27
+ "resource_days": null,
28
+ "link": "https://xdmod.example/chart",
29
+ "time_zone": "America/New_York",
30
+ "instance": {
31
+ "name": "ACCESS XDMoD",
32
+ "url": "https://xdmod.access-ci.org"
33
+ },
34
+ "series": [
35
+ {
36
+ "name": "Anvil",
37
+ "values": {
38
+ "2026-09-01": 5,
39
+ "2026-11-01": 7
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "expected": {
45
+ "version": 1,
46
+ "realm": "Jobs",
47
+ "statistic": "total_cpu_hours",
48
+ "group_by": "resource",
49
+ "dataset_type": "timeseries",
50
+ "unit": "Month",
51
+ "requested": {
52
+ "start": "2026-08-01",
53
+ "end": "2026-11-08"
54
+ },
55
+ "counted": {
56
+ "start": "2026-08-01",
57
+ "end": "2026-11-30"
58
+ },
59
+ "last_period_incomplete": true,
60
+ "measure": {
61
+ "label": "Number of Jobs Ended",
62
+ "description": "Jobs run",
63
+ "kind": "total",
64
+ "missing": "zero",
65
+ "unit": "core-hours"
66
+ },
67
+ "dimension": {
68
+ "name": "resource",
69
+ "ordered": false
70
+ },
71
+ "filters": {
72
+ "notes": []
73
+ },
74
+ "time_basis": {
75
+ "zone": "America/New_York"
76
+ },
77
+ "instance": {
78
+ "name": "ACCESS XDMoD",
79
+ "url": "https://xdmod.access-ci.org"
80
+ },
81
+ "warnings": [
82
+ {
83
+ "code": "waiting-not-counted",
84
+ "text": "Jobs still waiting aren't counted, and the last few days may be incomplete."
85
+ },
86
+ {
87
+ "code": "not-comparable-across-resources",
88
+ "text": "CPU hours don't allow for each resource's compute power per core, so they aren't comparable across resources. ACE measures are."
89
+ }
90
+ ],
91
+ "offset": 0,
92
+ "data_through": "2026-11-01",
93
+ "data_through_precision": "period",
94
+ "others_count": 0,
95
+ "last_data_period_partial": false,
96
+ "has_more": false,
97
+ "ranked_by": "value",
98
+ "link": "https://xdmod.example/chart",
99
+ "source": "XDMoD",
100
+ "retrieved": "2026-11-09",
101
+ "series": [
102
+ {
103
+ "name": "Anvil",
104
+ "points": [
105
+ {
106
+ "start": "2026-08-01",
107
+ "value": null
108
+ },
109
+ {
110
+ "start": "2026-09-01",
111
+ "value": 5
112
+ },
113
+ {
114
+ "start": "2026-10-01",
115
+ "value": null
116
+ },
117
+ {
118
+ "start": "2026-11-01",
119
+ "value": 7
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ }
125
+ }