@connectci/xdmod-charts 0.0.0-stage → 0.2.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 (76) 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/package.json +28 -4
  73. package/rules/README.md +29 -0
  74. package/rules/palette.json +4 -0
  75. package/rules/statistics.json +217 -0
  76. package/schema/chart-payload.v1.json +320 -0
@@ -0,0 +1,147 @@
1
+ {
2
+ "description": "A resource whose last day is inside the chart's last period is marked with that day, with nothing to fill.",
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-10-31",
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": {
28
+ "since": "2026-07-13",
29
+ "days": {
30
+ "Bridges 2 RM": "2026-10-31",
31
+ "Anvil": "2026-10-19"
32
+ }
33
+ },
34
+ "link": "https://xdmod.example/chart",
35
+ "time_zone": "America/New_York",
36
+ "instance": {
37
+ "name": "ACCESS XDMoD",
38
+ "url": "https://xdmod.access-ci.org"
39
+ },
40
+ "series": [
41
+ {
42
+ "name": "Bridges 2 RM",
43
+ "values": {
44
+ "2026-08-01": 1,
45
+ "2026-09-01": 2,
46
+ "2026-10-01": 3
47
+ }
48
+ },
49
+ {
50
+ "name": "Anvil",
51
+ "values": {
52
+ "2026-08-01": 1,
53
+ "2026-09-01": 2,
54
+ "2026-10-01": 3
55
+ }
56
+ }
57
+ ]
58
+ },
59
+ "expected": {
60
+ "version": 1,
61
+ "realm": "Jobs",
62
+ "statistic": "job_count",
63
+ "group_by": "resource",
64
+ "dataset_type": "timeseries",
65
+ "unit": "Month",
66
+ "requested": {
67
+ "start": "2026-08-01",
68
+ "end": "2026-10-31"
69
+ },
70
+ "counted": {
71
+ "start": "2026-08-01",
72
+ "end": "2026-10-31"
73
+ },
74
+ "last_period_incomplete": false,
75
+ "measure": {
76
+ "label": "Number of Jobs Ended",
77
+ "description": "Jobs run",
78
+ "kind": "total",
79
+ "missing": "zero",
80
+ "unit": "jobs"
81
+ },
82
+ "dimension": {
83
+ "name": "resource",
84
+ "ordered": false
85
+ },
86
+ "filters": {
87
+ "notes": []
88
+ },
89
+ "time_basis": {
90
+ "zone": "America/New_York"
91
+ },
92
+ "instance": {
93
+ "name": "ACCESS XDMoD",
94
+ "url": "https://xdmod.access-ci.org"
95
+ },
96
+ "warnings": [],
97
+ "offset": 0,
98
+ "data_through": "2026-10-01",
99
+ "data_through_precision": "period",
100
+ "others_count": 0,
101
+ "last_data_period_partial": false,
102
+ "has_more": false,
103
+ "ranked_by": "value",
104
+ "link": "https://xdmod.example/chart",
105
+ "source": "XDMoD",
106
+ "retrieved": "2026-11-09",
107
+ "series": [
108
+ {
109
+ "name": "Bridges 2 RM",
110
+ "points": [
111
+ {
112
+ "start": "2026-08-01",
113
+ "value": 1
114
+ },
115
+ {
116
+ "start": "2026-09-01",
117
+ "value": 2
118
+ },
119
+ {
120
+ "start": "2026-10-01",
121
+ "value": 3
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ "name": "Anvil",
127
+ "points": [
128
+ {
129
+ "start": "2026-08-01",
130
+ "value": 1
131
+ },
132
+ {
133
+ "start": "2026-09-01",
134
+ "value": 2
135
+ },
136
+ {
137
+ "start": "2026-10-01",
138
+ "value": 3
139
+ }
140
+ ],
141
+ "data_through": "2026-10-19",
142
+ "data_through_precision": "day",
143
+ "data_through_source": "resource"
144
+ }
145
+ ]
146
+ }
147
+ }
@@ -0,0 +1,145 @@
1
+ {
2
+ "description": "The fill goes only as far as the period holding the resource's last day; later periods stay null.",
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-10-31",
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": {
28
+ "since": "2026-07-13",
29
+ "days": {
30
+ "Bridges 2 RM": "2026-10-31",
31
+ "Anvil": "2026-09-19"
32
+ }
33
+ },
34
+ "link": "https://xdmod.example/chart",
35
+ "time_zone": "America/New_York",
36
+ "instance": {
37
+ "name": "ACCESS XDMoD",
38
+ "url": "https://xdmod.access-ci.org"
39
+ },
40
+ "series": [
41
+ {
42
+ "name": "Bridges 2 RM",
43
+ "values": {
44
+ "2026-08-01": 1,
45
+ "2026-09-01": 2,
46
+ "2026-10-01": 3
47
+ }
48
+ },
49
+ {
50
+ "name": "Anvil",
51
+ "values": {
52
+ "2026-08-01": 4
53
+ }
54
+ }
55
+ ]
56
+ },
57
+ "expected": {
58
+ "version": 1,
59
+ "realm": "Jobs",
60
+ "statistic": "job_count",
61
+ "group_by": "resource",
62
+ "dataset_type": "timeseries",
63
+ "unit": "Month",
64
+ "requested": {
65
+ "start": "2026-08-01",
66
+ "end": "2026-10-31"
67
+ },
68
+ "counted": {
69
+ "start": "2026-08-01",
70
+ "end": "2026-10-31"
71
+ },
72
+ "last_period_incomplete": false,
73
+ "measure": {
74
+ "label": "Number of Jobs Ended",
75
+ "description": "Jobs run",
76
+ "kind": "total",
77
+ "missing": "zero",
78
+ "unit": "jobs"
79
+ },
80
+ "dimension": {
81
+ "name": "resource",
82
+ "ordered": false
83
+ },
84
+ "filters": {
85
+ "notes": []
86
+ },
87
+ "time_basis": {
88
+ "zone": "America/New_York"
89
+ },
90
+ "instance": {
91
+ "name": "ACCESS XDMoD",
92
+ "url": "https://xdmod.access-ci.org"
93
+ },
94
+ "warnings": [],
95
+ "offset": 0,
96
+ "data_through": "2026-10-01",
97
+ "data_through_precision": "period",
98
+ "others_count": 0,
99
+ "last_data_period_partial": false,
100
+ "has_more": false,
101
+ "ranked_by": "value",
102
+ "link": "https://xdmod.example/chart",
103
+ "source": "XDMoD",
104
+ "retrieved": "2026-11-09",
105
+ "series": [
106
+ {
107
+ "name": "Bridges 2 RM",
108
+ "points": [
109
+ {
110
+ "start": "2026-08-01",
111
+ "value": 1
112
+ },
113
+ {
114
+ "start": "2026-09-01",
115
+ "value": 2
116
+ },
117
+ {
118
+ "start": "2026-10-01",
119
+ "value": 3
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "name": "Anvil",
125
+ "points": [
126
+ {
127
+ "start": "2026-08-01",
128
+ "value": 4
129
+ },
130
+ {
131
+ "start": "2026-09-01",
132
+ "value": 0
133
+ },
134
+ {
135
+ "start": "2026-10-01",
136
+ "value": null
137
+ }
138
+ ],
139
+ "data_through": "2026-09-19",
140
+ "data_through_precision": "day",
141
+ "data_through_source": "resource"
142
+ }
143
+ ]
144
+ }
145
+ }
@@ -0,0 +1,149 @@
1
+ {
2
+ "description": "A count by resource: empty periods up to the resource's last day are 0, and a day inside the last period is marked source resource.",
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-10-31",
15
+ "filters_notes": [
16
+ "Field of science: field-a"
17
+ ],
18
+ "dimension_filtered": false,
19
+ "offset": 0,
20
+ "limit": 10,
21
+ "unit": "Month"
22
+ },
23
+ "label": "Number of Jobs Ended",
24
+ "description": "Jobs run",
25
+ "today": "2026-11-09",
26
+ "others_count": 0,
27
+ "has_more": false,
28
+ "latest_data_day": null,
29
+ "resource_days": {
30
+ "since": "2026-07-13",
31
+ "days": {
32
+ "Bridges 2 RM": "2026-10-31",
33
+ "Texas A&M U ACES": "2026-10-30"
34
+ }
35
+ },
36
+ "link": "https://xdmod.example/chart",
37
+ "time_zone": "America/New_York",
38
+ "instance": {
39
+ "name": "ACCESS XDMoD",
40
+ "url": "https://xdmod.access-ci.org"
41
+ },
42
+ "series": [
43
+ {
44
+ "name": "Bridges 2 RM",
45
+ "values": {
46
+ "2026-08-01": 1,
47
+ "2026-09-01": 2,
48
+ "2026-10-01": 3
49
+ }
50
+ },
51
+ {
52
+ "name": "Texas A&M U ACES",
53
+ "values": {
54
+ "2026-08-01": 4
55
+ }
56
+ }
57
+ ]
58
+ },
59
+ "expected": {
60
+ "version": 1,
61
+ "realm": "Jobs",
62
+ "statistic": "job_count",
63
+ "group_by": "resource",
64
+ "dataset_type": "timeseries",
65
+ "unit": "Month",
66
+ "requested": {
67
+ "start": "2026-08-01",
68
+ "end": "2026-10-31"
69
+ },
70
+ "counted": {
71
+ "start": "2026-08-01",
72
+ "end": "2026-10-31"
73
+ },
74
+ "last_period_incomplete": false,
75
+ "measure": {
76
+ "label": "Number of Jobs Ended",
77
+ "description": "Jobs run",
78
+ "kind": "total",
79
+ "missing": "zero",
80
+ "unit": "jobs"
81
+ },
82
+ "dimension": {
83
+ "name": "resource",
84
+ "ordered": false
85
+ },
86
+ "filters": {
87
+ "notes": [
88
+ "Field of science: field-a"
89
+ ]
90
+ },
91
+ "time_basis": {
92
+ "zone": "America/New_York"
93
+ },
94
+ "instance": {
95
+ "name": "ACCESS XDMoD",
96
+ "url": "https://xdmod.access-ci.org"
97
+ },
98
+ "warnings": [],
99
+ "offset": 0,
100
+ "data_through": "2026-10-01",
101
+ "data_through_precision": "period",
102
+ "others_count": 0,
103
+ "last_data_period_partial": false,
104
+ "has_more": false,
105
+ "ranked_by": "value",
106
+ "link": "https://xdmod.example/chart",
107
+ "source": "XDMoD",
108
+ "retrieved": "2026-11-09",
109
+ "series": [
110
+ {
111
+ "name": "Bridges 2 RM",
112
+ "points": [
113
+ {
114
+ "start": "2026-08-01",
115
+ "value": 1
116
+ },
117
+ {
118
+ "start": "2026-09-01",
119
+ "value": 2
120
+ },
121
+ {
122
+ "start": "2026-10-01",
123
+ "value": 3
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "name": "Texas A&M U ACES",
129
+ "points": [
130
+ {
131
+ "start": "2026-08-01",
132
+ "value": 4
133
+ },
134
+ {
135
+ "start": "2026-09-01",
136
+ "value": 0
137
+ },
138
+ {
139
+ "start": "2026-10-01",
140
+ "value": 0
141
+ }
142
+ ],
143
+ "data_through": "2026-10-30",
144
+ "data_through_precision": "day",
145
+ "data_through_source": "resource"
146
+ }
147
+ ]
148
+ }
149
+ }
@@ -0,0 +1,145 @@
1
+ {
2
+ "description": "By queue the resource days are ignored: no zero fill, the series that stops early is marked source series.",
3
+ "producers": [
4
+ "ts",
5
+ "py"
6
+ ],
7
+ "input": {
8
+ "request": {
9
+ "realm": "Jobs",
10
+ "statistic": "total_cpu_hours",
11
+ "group_by": "queue",
12
+ "dataset_type": "timeseries",
13
+ "start_date": "2026-08-01",
14
+ "end_date": "2026-10-31",
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": {
28
+ "since": "2026-07-13",
29
+ "days": {
30
+ "queue-b": "2026-10-30"
31
+ }
32
+ },
33
+ "link": "https://xdmod.example/chart",
34
+ "time_zone": "America/New_York",
35
+ "instance": {
36
+ "name": "ACCESS XDMoD",
37
+ "url": "https://xdmod.access-ci.org"
38
+ },
39
+ "series": [
40
+ {
41
+ "name": "queue-a",
42
+ "values": {
43
+ "2026-08-01": 1,
44
+ "2026-09-01": 2,
45
+ "2026-10-01": 3
46
+ }
47
+ },
48
+ {
49
+ "name": "queue-b",
50
+ "values": {
51
+ "2026-08-01": 5,
52
+ "2026-09-01": 6
53
+ }
54
+ }
55
+ ]
56
+ },
57
+ "expected": {
58
+ "version": 1,
59
+ "realm": "Jobs",
60
+ "statistic": "total_cpu_hours",
61
+ "group_by": "queue",
62
+ "dataset_type": "timeseries",
63
+ "unit": "Month",
64
+ "requested": {
65
+ "start": "2026-08-01",
66
+ "end": "2026-10-31"
67
+ },
68
+ "counted": {
69
+ "start": "2026-08-01",
70
+ "end": "2026-10-31"
71
+ },
72
+ "last_period_incomplete": false,
73
+ "measure": {
74
+ "label": "Number of Jobs Ended",
75
+ "description": "Jobs run",
76
+ "kind": "total",
77
+ "missing": "zero",
78
+ "unit": "core-hours"
79
+ },
80
+ "dimension": {
81
+ "name": "queue",
82
+ "ordered": false
83
+ },
84
+ "filters": {
85
+ "notes": []
86
+ },
87
+ "time_basis": {
88
+ "zone": "America/New_York"
89
+ },
90
+ "instance": {
91
+ "name": "ACCESS XDMoD",
92
+ "url": "https://xdmod.access-ci.org"
93
+ },
94
+ "warnings": [],
95
+ "offset": 0,
96
+ "data_through": "2026-10-01",
97
+ "data_through_precision": "period",
98
+ "others_count": 0,
99
+ "last_data_period_partial": false,
100
+ "has_more": false,
101
+ "ranked_by": "value",
102
+ "link": "https://xdmod.example/chart",
103
+ "source": "XDMoD",
104
+ "retrieved": "2026-11-09",
105
+ "series": [
106
+ {
107
+ "name": "queue-a",
108
+ "points": [
109
+ {
110
+ "start": "2026-08-01",
111
+ "value": 1
112
+ },
113
+ {
114
+ "start": "2026-09-01",
115
+ "value": 2
116
+ },
117
+ {
118
+ "start": "2026-10-01",
119
+ "value": 3
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "name": "queue-b",
125
+ "points": [
126
+ {
127
+ "start": "2026-08-01",
128
+ "value": 5
129
+ },
130
+ {
131
+ "start": "2026-09-01",
132
+ "value": 6
133
+ },
134
+ {
135
+ "start": "2026-10-01",
136
+ "value": null
137
+ }
138
+ ],
139
+ "data_through": "2026-09-01",
140
+ "data_through_precision": "period",
141
+ "data_through_source": "series"
142
+ }
143
+ ]
144
+ }
145
+ }