@oneuptime/common 12.0.30 → 12.0.31

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 (489) hide show
  1. package/Models/AnalyticsModels/SecurityEvent.ts +48 -16
  2. package/Models/AnalyticsModels/ThreatIntelIndicator.ts +10 -5
  3. package/Models/DatabaseModels/AlertSeverity.ts +44 -0
  4. package/Models/DatabaseModels/DetectionRule.ts +16 -5
  5. package/Models/DatabaseModels/GoogleSecOpsConnection.ts +14 -5
  6. package/Models/DatabaseModels/IncidentSeverity.ts +44 -0
  7. package/Models/DatabaseModels/Index.ts +2 -0
  8. package/Models/DatabaseModels/NetworkDevice.ts +113 -3
  9. package/Models/DatabaseModels/NetworkDeviceAutoImportRule.ts +88 -0
  10. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +22 -0
  11. package/Models/DatabaseModels/NetworkDeviceOidTemplate.ts +499 -0
  12. package/Models/DatabaseModels/ThreatIntelFeed.ts +16 -5
  13. package/Server/API/GlobalConfigAPI.ts +362 -183
  14. package/Server/API/TelemetryAPI.ts +42 -4
  15. package/Server/EnvironmentConfig.ts +112 -0
  16. package/Server/Infrastructure/Postgres/SchemaMigrations/1790500000000-AddNetworkDeviceOidTemplate.ts +59 -0
  17. package/Server/Infrastructure/Postgres/SchemaMigrations/1790600000000-AddAutoImportRuleOidTemplate.ts +25 -0
  18. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  19. package/Server/Middleware/MultipartFormData.ts +118 -32
  20. package/Server/Services/AlertEpisodeLabelRuleEngineService.ts +9 -1
  21. package/Server/Services/AlertEpisodeOnCallRuleEngineService.ts +9 -1
  22. package/Server/Services/AlertEpisodeOwnerRuleEngineService.ts +9 -1
  23. package/Server/Services/AlertEpisodePrivacyRuleEngineService.ts +9 -1
  24. package/Server/Services/AlertGroupingEngineService.ts +9 -1
  25. package/Server/Services/AlertLabelRuleEngineService.ts +9 -1
  26. package/Server/Services/AlertOnCallRuleEngineService.ts +9 -1
  27. package/Server/Services/AlertOwnerRuleEngineService.ts +9 -1
  28. package/Server/Services/AlertPrivacyRuleEngineService.ts +9 -1
  29. package/Server/Services/AlertReminderRuleService.ts +9 -1
  30. package/Server/Services/AutoRemediationRuleEngineService.ts +9 -1
  31. package/Server/Services/CephClusterLabelRuleEngineService.ts +9 -1
  32. package/Server/Services/CephClusterOwnerRuleEngineService.ts +9 -1
  33. package/Server/Services/CloudResourceLabelRuleEngineService.ts +9 -1
  34. package/Server/Services/CloudResourceOwnerRuleEngineService.ts +9 -1
  35. package/Server/Services/DashboardLabelRuleEngineService.ts +9 -1
  36. package/Server/Services/DashboardOwnerRuleEngineService.ts +9 -1
  37. package/Server/Services/DockerHostLabelRuleEngineService.ts +9 -1
  38. package/Server/Services/DockerHostOwnerRuleEngineService.ts +9 -1
  39. package/Server/Services/DockerSwarmClusterLabelRuleEngineService.ts +9 -1
  40. package/Server/Services/DockerSwarmClusterOwnerRuleEngineService.ts +9 -1
  41. package/Server/Services/HostLabelRuleEngineService.ts +9 -1
  42. package/Server/Services/HostOwnerRuleEngineService.ts +9 -1
  43. package/Server/Services/IncidentEpisodeLabelRuleEngineService.ts +9 -1
  44. package/Server/Services/IncidentEpisodeOnCallRuleEngineService.ts +9 -1
  45. package/Server/Services/IncidentEpisodeOwnerRuleEngineService.ts +9 -1
  46. package/Server/Services/IncidentEpisodePrivacyRuleEngineService.ts +9 -1
  47. package/Server/Services/IncidentGroupingEngineService.ts +9 -1
  48. package/Server/Services/IncidentLabelRuleEngineService.ts +9 -1
  49. package/Server/Services/IncidentOnCallRuleEngineService.ts +9 -1
  50. package/Server/Services/IncidentOwnerRuleEngineService.ts +9 -1
  51. package/Server/Services/IncidentPrivacyRuleEngineService.ts +9 -1
  52. package/Server/Services/IncidentReminderRuleService.ts +9 -1
  53. package/Server/Services/IncidentSlaRuleService.ts +9 -1
  54. package/Server/Services/IncomingCallPolicyLabelRuleEngineService.ts +9 -1
  55. package/Server/Services/IncomingCallPolicyOwnerRuleEngineService.ts +9 -1
  56. package/Server/Services/Index.ts +2 -0
  57. package/Server/Services/IoTFleetLabelRuleEngineService.ts +9 -1
  58. package/Server/Services/IoTFleetOwnerRuleEngineService.ts +9 -1
  59. package/Server/Services/KubernetesClusterLabelRuleEngineService.ts +9 -1
  60. package/Server/Services/KubernetesClusterOwnerRuleEngineService.ts +9 -1
  61. package/Server/Services/KubernetesResourceService.ts +5 -1
  62. package/Server/Services/MonitorLabelRuleEngineService.ts +9 -1
  63. package/Server/Services/MonitorOwnerRuleEngineService.ts +9 -1
  64. package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +35 -0
  65. package/Server/Services/NetworkDeviceAutoImportRuleService.ts +96 -0
  66. package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +9 -1
  67. package/Server/Services/NetworkDeviceOidTemplateService.ts +201 -0
  68. package/Server/Services/NetworkDeviceOwnerRuleEngineService.ts +9 -1
  69. package/Server/Services/NetworkDeviceService.ts +209 -1
  70. package/Server/Services/OnCallDutyPolicyLabelRuleEngineService.ts +9 -1
  71. package/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.ts +9 -1
  72. package/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.ts +9 -1
  73. package/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.ts +9 -1
  74. package/Server/Services/PodmanHostLabelRuleEngineService.ts +9 -1
  75. package/Server/Services/PodmanHostOwnerRuleEngineService.ts +9 -1
  76. package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +9 -1
  77. package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +9 -1
  78. package/Server/Services/RumApplicationLabelRuleEngineService.ts +9 -1
  79. package/Server/Services/RumApplicationOwnerRuleEngineService.ts +9 -1
  80. package/Server/Services/RunbookLabelRuleEngineService.ts +9 -1
  81. package/Server/Services/RunbookOwnerRuleEngineService.ts +9 -1
  82. package/Server/Services/RunbookRuleEngineService.ts +9 -1
  83. package/Server/Services/ScheduledMaintenanceLabelRuleEngineService.ts +9 -1
  84. package/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.ts +9 -1
  85. package/Server/Services/ScheduledMaintenanceReminderRuleService.ts +9 -1
  86. package/Server/Services/ServerlessFunctionLabelRuleEngineService.ts +9 -1
  87. package/Server/Services/ServerlessFunctionOwnerRuleEngineService.ts +9 -1
  88. package/Server/Services/ServiceLabelRuleEngineService.ts +9 -1
  89. package/Server/Services/ServiceOwnerRuleEngineService.ts +9 -1
  90. package/Server/Services/StatusPageLabelRuleEngineService.ts +9 -1
  91. package/Server/Services/StatusPageMonitorRuleEngineService.ts +7 -0
  92. package/Server/Services/StatusPageOwnerRuleEngineService.ts +9 -1
  93. package/Server/Services/TelemetrySourceMapService.ts +266 -23
  94. package/Server/Services/UserService.ts +27 -0
  95. package/Server/Services/WorkflowLabelRuleEngineService.ts +9 -1
  96. package/Server/Services/WorkflowOwnerRuleEngineService.ts +9 -1
  97. package/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.ts +186 -0
  98. package/Server/Utils/Monitor/CapturedMetricAttributeUtil.ts +245 -0
  99. package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +21 -2
  100. package/Server/Utils/Monitor/MonitorMetricUtil.ts +55 -21
  101. package/Server/Utils/Monitor/MonitorTemplateUtil.ts +32 -0
  102. package/Server/Utils/Monitor/NetworkDeviceMetricUtil.ts +15 -2
  103. package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +18 -1
  104. package/Server/Utils/Monitor/NetworkInventoryUtil.ts +10 -0
  105. package/Server/Utils/Monitor/SeriesResourceLabels.ts +34 -0
  106. package/Server/Utils/Rules/RuleEngineRuleRead.ts +48 -0
  107. package/Server/Utils/Telemetry/ExceptionSanitizer.ts +14 -1
  108. package/Server/Utils/Telemetry/LogExceptionExtractor.ts +14 -2
  109. package/Server/Utils/Telemetry/SourceMapResolver.ts +16 -5
  110. package/Server/Utils/Telemetry/StackTraceParser.ts +399 -0
  111. package/Tests/App/Dashboard/EventOverlayHook.test.tsx +125 -0
  112. package/Tests/App/Dashboard/HeaderImageAssets.test.tsx +93 -0
  113. package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +3 -3
  114. package/Tests/App/Dashboard/UserElementEmail.test.tsx +12 -4
  115. package/Tests/App/Dashboard/UserEmailCallSites.test.tsx +1 -1
  116. package/Tests/Models/DatabaseModels/DomainRoleTierCoverage.test.ts +14 -0
  117. package/Tests/Models/DatabaseModels/ModelRegistryInvariants.test.ts +469 -0
  118. package/Tests/Models/SecurityDomainAccessControl.test.ts +429 -0
  119. package/Tests/Server/API/GlobalConfigLicense.test.ts +657 -0
  120. package/Tests/Server/API/SecurityEventAttributesAPI.test.ts +84 -6
  121. package/Tests/Server/API/TelemetryResolveStackTraceAPI.test.ts +805 -0
  122. package/Tests/Server/Infrastructure/Postgres/AddOnCallCalendarFeedsMigration.test.ts +32 -7
  123. package/Tests/Server/Middleware/IdentityRateLimit.test.ts +1144 -0
  124. package/Tests/Server/Middleware/MultipartFormData.test.ts +618 -3
  125. package/Tests/Server/Services/MonitorLabelRuleEngineScale.test.ts +520 -0
  126. package/Tests/Server/Services/NetworkDeviceOidTemplateService.test.ts +332 -0
  127. package/Tests/Server/Services/NetworkDeviceOidTemplateWriteGuards.test.ts +409 -0
  128. package/Tests/Server/Services/RuleEngineRuleFetchLimit.test.ts +239 -0
  129. package/Tests/Server/Services/TelemetrySourceMapService.test.ts +1210 -2
  130. package/Tests/Server/Services/UserServiceSeatLimit.test.ts +182 -0
  131. package/Tests/Server/Types/AnalyticsDatabase/SecurityEventModelPermission.test.ts +255 -0
  132. package/Tests/Server/Types/Database/Permissions/ReadBlockPermission.test.ts +212 -0
  133. package/Tests/Server/Types/Database/Permissions/SecurityRoleAccess.test.ts +413 -0
  134. package/Tests/Server/Utils/CodeRepository.test.ts +689 -0
  135. package/Tests/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.test.ts +495 -0
  136. package/Tests/Server/Utils/ExceptionSanitizer.test.ts +77 -0
  137. package/Tests/Server/Utils/Monitor/CapturedMetricAttributeUtil.test.ts +284 -0
  138. package/Tests/Server/Utils/Monitor/MonitorCustomMetricAttributes.test.ts +503 -0
  139. package/Tests/Server/Utils/Monitor/MonitorTemplatePrototypePollution.test.ts +106 -0
  140. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkLogWritePath.test.ts +33 -4
  141. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +14 -4
  142. package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +44 -0
  143. package/Tests/Server/Utils/OpenAPISpec.test.ts +536 -0
  144. package/Tests/Server/Utils/Rules/RuleEngineRuleRead.test.ts +115 -0
  145. package/Tests/Server/Utils/StackTraceParser.test.ts +610 -0
  146. package/Tests/Server/Utils/Telemetry/LogExceptionExtractor.test.ts +0 -0
  147. package/Tests/Server/Utils/Telemetry/SourceMapLimits.test.ts +656 -0
  148. package/Tests/Server/Utils/Telemetry/SourceMapResolver.test.ts +100 -0
  149. package/Tests/Types/Monitor/SnmpMonitor/SnmpOidListUtil.test.ts +454 -0
  150. package/Tests/Types/SecurityRolePermissions.test.ts +193 -0
  151. package/Tests/UI/Components/Charts/AnnotationLayout.test.ts +773 -0
  152. package/Tests/UI/Components/Charts/ChartAnnotationRail.test.tsx +789 -0
  153. package/Tests/UI/Components/Charts/ChartBucketIdentity.test.ts +254 -0
  154. package/Tests/UI/Components/Charts/TimeAnnotation.test.ts +471 -0
  155. package/Tests/UI/Components/EditionLabelLicenseRefresh.test.tsx +405 -0
  156. package/Tests/UI/Components/ErrorMessageRefreshControl.test.tsx +83 -0
  157. package/Tests/UI/Components/MarkdownConverters.test.ts +686 -0
  158. package/Tests/UI/Components/ModelTable/BaseModelTableDeleteAndEmptyStates.test.tsx +341 -0
  159. package/Tests/UI/Components/OrderedStatesList.test.tsx +5 -5
  160. package/Tests/UI/Components/PendingProjectInvitations.test.tsx +1 -1
  161. package/Tests/UI/Components/TableSortAndMobileColumns.test.tsx +195 -0
  162. package/Tests/UI/Components/XAxis.test.ts +270 -5
  163. package/Tests/UI/Components/XAxisDaylightSaving.test.ts +113 -0
  164. package/Tests/UI/Styles/ChartFocusRing.test.ts +153 -0
  165. package/Tests/UI/Styles/ChartFocusRingCoverage.test.tsx +377 -0
  166. package/Tests/UI/Styles/ThemeStylesheet.ts +162 -0
  167. package/Tests/Utils/EnterpriseLicenseSeats.test.ts +507 -0
  168. package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +951 -1
  169. package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +238 -0
  170. package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +1056 -0
  171. package/Tests/Utils/NetworkDiscovery/ReverseDnsNameUtil.test.ts +882 -0
  172. package/Types/Date.ts +39 -0
  173. package/Types/Monitor/SnmpMonitor/SnmpOidListUtil.ts +333 -0
  174. package/Types/Permission.ts +96 -0
  175. package/Types/Rum/SessionReplay.ts +21 -0
  176. package/Types/Telemetry/SourceMap.ts +8 -0
  177. package/UI/Components/Charts/ChartLibrary/Annotations/AnnotationHoverCard.tsx +176 -0
  178. package/UI/Components/Charts/ChartLibrary/Annotations/AnnotationLayout.ts +745 -0
  179. package/UI/Components/Charts/ChartLibrary/Annotations/ChartAnnotationLayer.tsx +576 -0
  180. package/UI/Components/Charts/ChartLibrary/Annotations/UseChartAnnotations.tsx +204 -0
  181. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +491 -544
  182. package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +324 -372
  183. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +487 -540
  184. package/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.ts +7 -3
  185. package/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.ts +14 -3
  186. package/UI/Components/Charts/Types/ChartEventKind.ts +13 -0
  187. package/UI/Components/Charts/Types/ReferenceRegionProps.ts +6 -0
  188. package/UI/Components/Charts/Types/TimeReferenceLineProps.ts +20 -3
  189. package/UI/Components/Charts/Utils/TimeAnnotation.ts +69 -35
  190. package/UI/Components/Charts/Utils/XAxis.ts +125 -18
  191. package/UI/Components/EditionLabel/EditionLabel.tsx +280 -26
  192. package/UI/Components/ErrorMessage/ErrorMessage.tsx +21 -10
  193. package/UI/Components/Feed/FeedItem.tsx +4 -5
  194. package/UI/Components/Header/HeaderIconDropdownButton.tsx +1 -2
  195. package/UI/Components/Header/UserProfile/UserProfile.tsx +1 -2
  196. package/UI/Components/Image/Image.tsx +20 -3
  197. package/UI/Components/Markdown.tsx/MarkdownConverters.ts +0 -0
  198. package/UI/Components/MemberRoleAssignment/MemberRoleAssignment.tsx +1 -2
  199. package/UI/Components/ModelTable/BaseModelTable.tsx +150 -24
  200. package/UI/Components/Table/TableHeader.tsx +64 -48
  201. package/UI/Components/Table/TableRow.tsx +13 -3
  202. package/UI/Styles/Theme.css +38 -0
  203. package/Utils/EnterpriseLicense/EnterpriseLicenseSeats.ts +271 -0
  204. package/Utils/NetworkDiscovery/AutoImportRuleMatcher.ts +6 -0
  205. package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +141 -10
  206. package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +55 -3
  207. package/Utils/NetworkDiscovery/ReverseDnsNameUtil.ts +151 -0
  208. package/Utils/Rules/RuleEngineLimits.ts +32 -0
  209. package/build/dist/Models/AnalyticsModels/SecurityEvent.js +48 -16
  210. package/build/dist/Models/AnalyticsModels/SecurityEvent.js.map +1 -1
  211. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js +10 -5
  212. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js.map +1 -1
  213. package/build/dist/Models/DatabaseModels/AlertSeverity.js +46 -1
  214. package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
  215. package/build/dist/Models/DatabaseModels/DetectionRule.js +16 -5
  216. package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -1
  217. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js +14 -5
  218. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +1 -1
  219. package/build/dist/Models/DatabaseModels/IncidentSeverity.js +46 -1
  220. package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
  221. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  222. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  223. package/build/dist/Models/DatabaseModels/NetworkDevice.js +115 -3
  224. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  225. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js +88 -0
  226. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js.map +1 -1
  227. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  228. package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js +519 -0
  229. package/build/dist/Models/DatabaseModels/NetworkDeviceOidTemplate.js.map +1 -0
  230. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js +16 -5
  231. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js.map +1 -1
  232. package/build/dist/Server/API/GlobalConfigAPI.js +293 -176
  233. package/build/dist/Server/API/GlobalConfigAPI.js.map +1 -1
  234. package/build/dist/Server/API/TelemetryAPI.js +31 -3
  235. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  236. package/build/dist/Server/EnvironmentConfig.js +83 -0
  237. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  238. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790500000000-AddNetworkDeviceOidTemplate.js +26 -0
  239. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790500000000-AddNetworkDeviceOidTemplate.js.map +1 -0
  240. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790600000000-AddAutoImportRuleOidTemplate.js +14 -0
  241. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790600000000-AddAutoImportRuleOidTemplate.js.map +1 -0
  242. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  243. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  244. package/build/dist/Server/Middleware/MultipartFormData.js +93 -28
  245. package/build/dist/Server/Middleware/MultipartFormData.js.map +1 -1
  246. package/build/dist/Server/Services/AlertEpisodeLabelRuleEngineService.js +8 -1
  247. package/build/dist/Server/Services/AlertEpisodeLabelRuleEngineService.js.map +1 -1
  248. package/build/dist/Server/Services/AlertEpisodeOnCallRuleEngineService.js +8 -1
  249. package/build/dist/Server/Services/AlertEpisodeOnCallRuleEngineService.js.map +1 -1
  250. package/build/dist/Server/Services/AlertEpisodeOwnerRuleEngineService.js +8 -1
  251. package/build/dist/Server/Services/AlertEpisodeOwnerRuleEngineService.js.map +1 -1
  252. package/build/dist/Server/Services/AlertEpisodePrivacyRuleEngineService.js +8 -1
  253. package/build/dist/Server/Services/AlertEpisodePrivacyRuleEngineService.js.map +1 -1
  254. package/build/dist/Server/Services/AlertGroupingEngineService.js +8 -1
  255. package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
  256. package/build/dist/Server/Services/AlertLabelRuleEngineService.js +8 -1
  257. package/build/dist/Server/Services/AlertLabelRuleEngineService.js.map +1 -1
  258. package/build/dist/Server/Services/AlertOnCallRuleEngineService.js +8 -1
  259. package/build/dist/Server/Services/AlertOnCallRuleEngineService.js.map +1 -1
  260. package/build/dist/Server/Services/AlertOwnerRuleEngineService.js +8 -1
  261. package/build/dist/Server/Services/AlertOwnerRuleEngineService.js.map +1 -1
  262. package/build/dist/Server/Services/AlertPrivacyRuleEngineService.js +8 -1
  263. package/build/dist/Server/Services/AlertPrivacyRuleEngineService.js.map +1 -1
  264. package/build/dist/Server/Services/AlertReminderRuleService.js +8 -1
  265. package/build/dist/Server/Services/AlertReminderRuleService.js.map +1 -1
  266. package/build/dist/Server/Services/AutoRemediationRuleEngineService.js +8 -1
  267. package/build/dist/Server/Services/AutoRemediationRuleEngineService.js.map +1 -1
  268. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +8 -1
  269. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -1
  270. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +8 -1
  271. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -1
  272. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js +8 -1
  273. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js.map +1 -1
  274. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js +8 -1
  275. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js.map +1 -1
  276. package/build/dist/Server/Services/DashboardLabelRuleEngineService.js +8 -1
  277. package/build/dist/Server/Services/DashboardLabelRuleEngineService.js.map +1 -1
  278. package/build/dist/Server/Services/DashboardOwnerRuleEngineService.js +8 -1
  279. package/build/dist/Server/Services/DashboardOwnerRuleEngineService.js.map +1 -1
  280. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js +8 -1
  281. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js.map +1 -1
  282. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js +8 -1
  283. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js.map +1 -1
  284. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js +8 -1
  285. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js.map +1 -1
  286. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js +8 -1
  287. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js.map +1 -1
  288. package/build/dist/Server/Services/HostLabelRuleEngineService.js +8 -1
  289. package/build/dist/Server/Services/HostLabelRuleEngineService.js.map +1 -1
  290. package/build/dist/Server/Services/HostOwnerRuleEngineService.js +8 -1
  291. package/build/dist/Server/Services/HostOwnerRuleEngineService.js.map +1 -1
  292. package/build/dist/Server/Services/IncidentEpisodeLabelRuleEngineService.js +8 -1
  293. package/build/dist/Server/Services/IncidentEpisodeLabelRuleEngineService.js.map +1 -1
  294. package/build/dist/Server/Services/IncidentEpisodeOnCallRuleEngineService.js +8 -1
  295. package/build/dist/Server/Services/IncidentEpisodeOnCallRuleEngineService.js.map +1 -1
  296. package/build/dist/Server/Services/IncidentEpisodeOwnerRuleEngineService.js +8 -1
  297. package/build/dist/Server/Services/IncidentEpisodeOwnerRuleEngineService.js.map +1 -1
  298. package/build/dist/Server/Services/IncidentEpisodePrivacyRuleEngineService.js +8 -1
  299. package/build/dist/Server/Services/IncidentEpisodePrivacyRuleEngineService.js.map +1 -1
  300. package/build/dist/Server/Services/IncidentGroupingEngineService.js +8 -1
  301. package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
  302. package/build/dist/Server/Services/IncidentLabelRuleEngineService.js +8 -1
  303. package/build/dist/Server/Services/IncidentLabelRuleEngineService.js.map +1 -1
  304. package/build/dist/Server/Services/IncidentOnCallRuleEngineService.js +8 -1
  305. package/build/dist/Server/Services/IncidentOnCallRuleEngineService.js.map +1 -1
  306. package/build/dist/Server/Services/IncidentOwnerRuleEngineService.js +8 -1
  307. package/build/dist/Server/Services/IncidentOwnerRuleEngineService.js.map +1 -1
  308. package/build/dist/Server/Services/IncidentPrivacyRuleEngineService.js +8 -1
  309. package/build/dist/Server/Services/IncidentPrivacyRuleEngineService.js.map +1 -1
  310. package/build/dist/Server/Services/IncidentReminderRuleService.js +8 -1
  311. package/build/dist/Server/Services/IncidentReminderRuleService.js.map +1 -1
  312. package/build/dist/Server/Services/IncidentSlaRuleService.js +8 -1
  313. package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
  314. package/build/dist/Server/Services/IncomingCallPolicyLabelRuleEngineService.js +8 -1
  315. package/build/dist/Server/Services/IncomingCallPolicyLabelRuleEngineService.js.map +1 -1
  316. package/build/dist/Server/Services/IncomingCallPolicyOwnerRuleEngineService.js +8 -1
  317. package/build/dist/Server/Services/IncomingCallPolicyOwnerRuleEngineService.js.map +1 -1
  318. package/build/dist/Server/Services/Index.js +2 -0
  319. package/build/dist/Server/Services/Index.js.map +1 -1
  320. package/build/dist/Server/Services/IoTFleetLabelRuleEngineService.js +8 -1
  321. package/build/dist/Server/Services/IoTFleetLabelRuleEngineService.js.map +1 -1
  322. package/build/dist/Server/Services/IoTFleetOwnerRuleEngineService.js +8 -1
  323. package/build/dist/Server/Services/IoTFleetOwnerRuleEngineService.js.map +1 -1
  324. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js +8 -1
  325. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js.map +1 -1
  326. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js +8 -1
  327. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js.map +1 -1
  328. package/build/dist/Server/Services/KubernetesResourceService.js +5 -1
  329. package/build/dist/Server/Services/KubernetesResourceService.js.map +1 -1
  330. package/build/dist/Server/Services/MonitorLabelRuleEngineService.js +8 -1
  331. package/build/dist/Server/Services/MonitorLabelRuleEngineService.js.map +1 -1
  332. package/build/dist/Server/Services/MonitorOwnerRuleEngineService.js +8 -1
  333. package/build/dist/Server/Services/MonitorOwnerRuleEngineService.js.map +1 -1
  334. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +30 -21
  335. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
  336. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js +64 -0
  337. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js.map +1 -1
  338. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +8 -1
  339. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -1
  340. package/build/dist/Server/Services/NetworkDeviceOidTemplateService.js +180 -0
  341. package/build/dist/Server/Services/NetworkDeviceOidTemplateService.js.map +1 -0
  342. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js +8 -1
  343. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js.map +1 -1
  344. package/build/dist/Server/Services/NetworkDeviceService.js +154 -1
  345. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  346. package/build/dist/Server/Services/OnCallDutyPolicyLabelRuleEngineService.js +8 -1
  347. package/build/dist/Server/Services/OnCallDutyPolicyLabelRuleEngineService.js.map +1 -1
  348. package/build/dist/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.js +8 -1
  349. package/build/dist/Server/Services/OnCallDutyPolicyOwnerRuleEngineService.js.map +1 -1
  350. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.js +8 -1
  351. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLabelRuleEngineService.js.map +1 -1
  352. package/build/dist/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.js +8 -1
  353. package/build/dist/Server/Services/OnCallDutyPolicyScheduleOwnerRuleEngineService.js.map +1 -1
  354. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js +8 -1
  355. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js.map +1 -1
  356. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js +8 -1
  357. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js.map +1 -1
  358. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +8 -1
  359. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -1
  360. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +8 -1
  361. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -1
  362. package/build/dist/Server/Services/RumApplicationLabelRuleEngineService.js +8 -1
  363. package/build/dist/Server/Services/RumApplicationLabelRuleEngineService.js.map +1 -1
  364. package/build/dist/Server/Services/RumApplicationOwnerRuleEngineService.js +8 -1
  365. package/build/dist/Server/Services/RumApplicationOwnerRuleEngineService.js.map +1 -1
  366. package/build/dist/Server/Services/RunbookLabelRuleEngineService.js +8 -1
  367. package/build/dist/Server/Services/RunbookLabelRuleEngineService.js.map +1 -1
  368. package/build/dist/Server/Services/RunbookOwnerRuleEngineService.js +8 -1
  369. package/build/dist/Server/Services/RunbookOwnerRuleEngineService.js.map +1 -1
  370. package/build/dist/Server/Services/RunbookRuleEngineService.js +8 -1
  371. package/build/dist/Server/Services/RunbookRuleEngineService.js.map +1 -1
  372. package/build/dist/Server/Services/ScheduledMaintenanceLabelRuleEngineService.js +8 -1
  373. package/build/dist/Server/Services/ScheduledMaintenanceLabelRuleEngineService.js.map +1 -1
  374. package/build/dist/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.js +8 -1
  375. package/build/dist/Server/Services/ScheduledMaintenanceOwnerRuleEngineService.js.map +1 -1
  376. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js +8 -1
  377. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js.map +1 -1
  378. package/build/dist/Server/Services/ServerlessFunctionLabelRuleEngineService.js +8 -1
  379. package/build/dist/Server/Services/ServerlessFunctionLabelRuleEngineService.js.map +1 -1
  380. package/build/dist/Server/Services/ServerlessFunctionOwnerRuleEngineService.js +8 -1
  381. package/build/dist/Server/Services/ServerlessFunctionOwnerRuleEngineService.js.map +1 -1
  382. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js +8 -1
  383. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js.map +1 -1
  384. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js +8 -1
  385. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js.map +1 -1
  386. package/build/dist/Server/Services/StatusPageLabelRuleEngineService.js +8 -1
  387. package/build/dist/Server/Services/StatusPageLabelRuleEngineService.js.map +1 -1
  388. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js +6 -0
  389. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js.map +1 -1
  390. package/build/dist/Server/Services/StatusPageOwnerRuleEngineService.js +8 -1
  391. package/build/dist/Server/Services/StatusPageOwnerRuleEngineService.js.map +1 -1
  392. package/build/dist/Server/Services/TelemetrySourceMapService.js +213 -19
  393. package/build/dist/Server/Services/TelemetrySourceMapService.js.map +1 -1
  394. package/build/dist/Server/Services/UserService.js +25 -0
  395. package/build/dist/Server/Services/UserService.js.map +1 -1
  396. package/build/dist/Server/Services/WorkflowLabelRuleEngineService.js +8 -1
  397. package/build/dist/Server/Services/WorkflowLabelRuleEngineService.js.map +1 -1
  398. package/build/dist/Server/Services/WorkflowOwnerRuleEngineService.js +8 -1
  399. package/build/dist/Server/Services/WorkflowOwnerRuleEngineService.js.map +1 -1
  400. package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js +145 -0
  401. package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js.map +1 -0
  402. package/build/dist/Server/Utils/Monitor/CapturedMetricAttributeUtil.js +201 -0
  403. package/build/dist/Server/Utils/Monitor/CapturedMetricAttributeUtil.js.map +1 -0
  404. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +19 -2
  405. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
  406. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +42 -23
  407. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
  408. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +29 -0
  409. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
  410. package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js +11 -2
  411. package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js.map +1 -1
  412. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +16 -1
  413. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -1
  414. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +10 -0
  415. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
  416. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +33 -0
  417. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
  418. package/build/dist/Server/Utils/Rules/RuleEngineRuleRead.js +37 -0
  419. package/build/dist/Server/Utils/Rules/RuleEngineRuleRead.js.map +1 -0
  420. package/build/dist/Server/Utils/Telemetry/ExceptionSanitizer.js +12 -1
  421. package/build/dist/Server/Utils/Telemetry/ExceptionSanitizer.js.map +1 -1
  422. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js +14 -2
  423. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js.map +1 -1
  424. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js +15 -5
  425. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js.map +1 -1
  426. package/build/dist/Server/Utils/Telemetry/StackTraceParser.js +307 -0
  427. package/build/dist/Server/Utils/Telemetry/StackTraceParser.js.map +1 -1
  428. package/build/dist/Types/Date.js +27 -0
  429. package/build/dist/Types/Date.js.map +1 -1
  430. package/build/dist/Types/Monitor/SnmpMonitor/SnmpOidListUtil.js +253 -0
  431. package/build/dist/Types/Monitor/SnmpMonitor/SnmpOidListUtil.js.map +1 -0
  432. package/build/dist/Types/Permission.js +86 -0
  433. package/build/dist/Types/Permission.js.map +1 -1
  434. package/build/dist/Types/Rum/SessionReplay.js +19 -0
  435. package/build/dist/Types/Rum/SessionReplay.js.map +1 -1
  436. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationHoverCard.js +83 -0
  437. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationHoverCard.js.map +1 -0
  438. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationLayout.js +531 -0
  439. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/AnnotationLayout.js.map +1 -0
  440. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/ChartAnnotationLayer.js +264 -0
  441. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/ChartAnnotationLayer.js.map +1 -0
  442. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/UseChartAnnotations.js +122 -0
  443. package/build/dist/UI/Components/Charts/ChartLibrary/Annotations/UseChartAnnotations.js.map +1 -0
  444. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +213 -233
  445. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  446. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +139 -152
  447. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
  448. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +212 -232
  449. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  450. package/build/dist/UI/Components/Charts/Types/ChartEventKind.js +14 -0
  451. package/build/dist/UI/Components/Charts/Types/ChartEventKind.js.map +1 -0
  452. package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js +57 -28
  453. package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js.map +1 -1
  454. package/build/dist/UI/Components/Charts/Utils/XAxis.js +103 -17
  455. package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -1
  456. package/build/dist/UI/Components/EditionLabel/EditionLabel.js +198 -23
  457. package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
  458. package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js +15 -5
  459. package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js.map +1 -1
  460. package/build/dist/UI/Components/Feed/FeedItem.js +4 -5
  461. package/build/dist/UI/Components/Feed/FeedItem.js.map +1 -1
  462. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -2
  463. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
  464. package/build/dist/UI/Components/Header/UserProfile/UserProfile.js.map +1 -1
  465. package/build/dist/UI/Components/Image/Image.js +6 -1
  466. package/build/dist/UI/Components/Image/Image.js.map +1 -1
  467. package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js +0 -0
  468. package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js.map +1 -1
  469. package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js +1 -2
  470. package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js.map +1 -1
  471. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +104 -23
  472. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  473. package/build/dist/UI/Components/Table/TableHeader.js +20 -22
  474. package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
  475. package/build/dist/UI/Components/Table/TableRow.js +13 -4
  476. package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
  477. package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js +153 -0
  478. package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js.map +1 -0
  479. package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js.map +1 -1
  480. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +127 -7
  481. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -1
  482. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +50 -3
  483. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -1
  484. package/build/dist/Utils/NetworkDiscovery/ReverseDnsNameUtil.js +132 -0
  485. package/build/dist/Utils/NetworkDiscovery/ReverseDnsNameUtil.js.map +1 -0
  486. package/build/dist/Utils/Rules/RuleEngineLimits.js +31 -0
  487. package/build/dist/Utils/Rules/RuleEngineLimits.js.map +1 -0
  488. package/jest.config.json +1 -0
  489. package/package.json +2 -2
@@ -37,6 +37,9 @@ import {
37
37
  getColorHex,
38
38
  isHexColorValue,
39
39
  } from "../Utils/ChartColors";
40
+ import useChartAnnotations, {
41
+ UseChartAnnotationsResult,
42
+ } from "../Annotations/UseChartAnnotations";
40
43
  import { cx } from "../Utils/Cx";
41
44
  import { getYAxisDomain } from "../Utils/GetYAxisDomain";
42
45
  import { hasOnlyOneValueForKey } from "../Utils/HasOnlyOneValueForKey";
@@ -46,15 +49,6 @@ import {
46
49
  } from "../Utils/TooltipEntries";
47
50
  import ChartCurve from "../../Types/ChartCurve";
48
51
 
49
- /*
50
- * Incident/alert time markers each label at the same "insideTop" band, so
51
- * several events in one window pile their labels into an unreadable stack.
52
- * A single marker keeps the classic horizontal top label; a handful get
53
- * rotated to run along their lines; past this cap inline labels are hidden
54
- * entirely (the dashed lines and their click-through remain).
55
- */
56
- const MAX_LABELED_TIME_REFERENCE_LINES: number = 6;
57
-
58
52
  /*
59
53
  * recharts invokes child event handlers with varying shapes ((event) for
60
54
  * plain SVG passthrough, (data, event) for adapted children) — find the
@@ -740,10 +734,32 @@ const LineChart: React.ForwardRefExoticComponent<
740
734
  React.useRef<boolean>(false);
741
735
  const categoryColors: Map<string, ChartColorValue> =
742
736
  constructCategoryColors(categories, colors);
743
- const timeReferenceLineCount: number =
744
- formattedTimeReferenceLines?.length || 0;
745
- const showTimeReferenceLineLabels: boolean =
746
- timeReferenceLineCount <= MAX_LABELED_TIME_REFERENCE_LINES;
737
+
738
+ /*
739
+ * Annotations are drawn onto the categorical axis, so the layer needs
740
+ * the same x values recharts is drawing — not the source dates.
741
+ */
742
+ const categoryLabels: Array<string> = React.useMemo(():
743
+ | Array<string>
744
+ | never => {
745
+ return (data as Array<Record<string, unknown>>).map(
746
+ (row: Record<string, unknown>): string => {
747
+ return String(row[index] ?? "");
748
+ },
749
+ );
750
+ }, [data, index]);
751
+
752
+ const annotations: UseChartAnnotationsResult = useChartAnnotations({
753
+ formattedTimeReferenceLines,
754
+ formattedReferenceRegions,
755
+ categoryLabels,
756
+ axisPaddingPx: paddingValue,
757
+ scaleKind: "point",
758
+ hasTopLegend: showLegend,
759
+ isClickSuppressed: (): boolean => {
760
+ return suppressNextClickRef.current;
761
+ },
762
+ });
747
763
 
748
764
  const yAxisDomain: (number | "auto")[] = getYAxisDomain(
749
765
  autoMinValue,
@@ -972,560 +988,491 @@ const LineChart: React.ForwardRefExoticComponent<
972
988
  )}
973
989
  {...other}
974
990
  >
975
- <ResponsiveContainer>
976
- <RechartsLineChart
977
- data={data}
978
- /*
979
- * Omitted, not "": recharts treats "" as a real sync
980
- * channel, so every unsynced chart page-wide would
981
- * accidentally sync with every other one.
982
- */
983
- {...(props.syncid ? { syncId: props.syncid.toString() } : {})}
984
- {...(hasOnTimeRangeSelect
985
- ? {
986
- onMouseDown: handleRangeSelectMouseDown,
987
- onMouseMove: handleRangeSelectMouseMove,
988
- onMouseUp: handleRangeSelectMouseUp,
989
- }
990
- : {})}
991
- onClick={(chartState: RangeSelectionChartState) => {
992
- // Ignore the click that follows a drag-to-select.
993
- if (suppressNextClickRef.current) {
994
- return;
995
- }
996
- /*
997
- * A click while a legend/dot selection is active keeps its
998
- * long-standing meaning — clear the selection — and never
999
- * also pins a bucket.
1000
- */
1001
- if (hasOnValueChange && (activeLegend || activeDot)) {
1002
- setActiveDot(undefined);
1003
- setActiveLegend(undefined);
1004
- onValueChange?.(null);
1005
- return;
1006
- }
1007
- if (!onBucketClick) {
1008
- return;
1009
- }
1010
- const rowIndex: number | null =
1011
- getRowIndexFromChartState(chartState);
1012
- if (rowIndex === null) {
1013
- return;
1014
- }
1015
- const bucketStart: Date | null = getBucketDateAtIndex(rowIndex);
1016
- if (!bucketStart) {
1017
- return;
1018
- }
1019
- /*
1020
- * Cover the full bucket: width from adjacent row dates, the
1021
- * same derivation drag-to-select uses.
1022
- */
1023
- const adjacentDate: Date | null =
1024
- rowIndex > 0
1025
- ? getBucketDateAtIndex(rowIndex - 1)
1026
- : getBucketDateAtIndex(rowIndex + 1);
1027
- const bucketWidthInMs: number = adjacentDate
1028
- ? Math.abs(bucketStart.getTime() - adjacentDate.getTime())
1029
- : 0;
1030
- onBucketClick(
1031
- bucketStart,
1032
- new Date(bucketStart.getTime() + bucketWidthInMs),
1033
- (data[rowIndex] || {}) as Record<string, number | string>,
1034
- );
1035
- }}
1036
- margin={{
991
+ {/*
992
+ * The hover card is HTML over the SVG, so it needs a positioned
993
+ * ancestor that is exactly the chart's box. recharts sizes its
994
+ * <svg> in CSS pixels with no viewBox, so the card can reuse the
995
+ * coordinates the rail was drawn with.
996
+ */}
997
+ <div className={cx("relative isolate h-full w-full")}>
998
+ <ResponsiveContainer>
999
+ <RechartsLineChart
1000
+ data={data}
1037
1001
  /*
1038
- * Tick labels are 10px font with a translate(0, 6) — they
1039
- * need ~20px of bottom space, plus another ~20px for the
1040
- * optional axis label. 8px (the no-axis case) is only
1041
- * valid when the axis is hidden entirely.
1002
+ * Omitted, not "": recharts treats "" as a real sync
1003
+ * channel, so every unsynced chart page-wide would
1004
+ * accidentally sync with every other one.
1042
1005
  */
1043
- bottom: (xAxisLabel
1044
- ? 40
1045
- : showXAxis
1046
- ? 24
1047
- : 8) as unknown as number,
1048
- left: (yAxisLabel ? 20 : 0) as unknown as number,
1049
- right: (yAxisLabel ? 5 : 8) as unknown as number,
1050
- top: 5,
1051
- }}
1052
- >
1053
- {showGridLines ? (
1054
- <CartesianGrid
1055
- className={cx("stroke-gray-100")}
1056
- strokeDasharray="3 3"
1057
- horizontal={true}
1058
- vertical={false}
1059
- />
1060
- ) : null}
1061
- <XAxis
1062
- padding={{ left: paddingValue, right: paddingValue }}
1063
- hide={!showXAxis}
1064
- dataKey={index}
1065
- interval={startEndOnly ? "preserveStartEnd" : intervalType}
1066
- tick={{
1067
- transform: "translate(0, 6)",
1068
- fontSize: 10,
1069
- fontWeight: 500,
1070
- fill: "var(--ou-chart-tick)",
1006
+ {...(props.syncid ? { syncId: props.syncid.toString() } : {})}
1007
+ {...(hasOnTimeRangeSelect
1008
+ ? {
1009
+ onMouseDown: handleRangeSelectMouseDown,
1010
+ onMouseMove: handleRangeSelectMouseMove,
1011
+ onMouseUp: handleRangeSelectMouseUp,
1012
+ }
1013
+ : {})}
1014
+ onClick={(chartState: RangeSelectionChartState) => {
1015
+ // Ignore the click that follows a drag-to-select.
1016
+ if (suppressNextClickRef.current) {
1017
+ return;
1018
+ }
1019
+ /*
1020
+ * A click while a legend/dot selection is active keeps its
1021
+ * long-standing meaning — clear the selection — and never
1022
+ * also pins a bucket.
1023
+ */
1024
+ if (hasOnValueChange && (activeLegend || activeDot)) {
1025
+ setActiveDot(undefined);
1026
+ setActiveLegend(undefined);
1027
+ onValueChange?.(null);
1028
+ return;
1029
+ }
1030
+ if (!onBucketClick) {
1031
+ return;
1032
+ }
1033
+ const rowIndex: number | null =
1034
+ getRowIndexFromChartState(chartState);
1035
+ if (rowIndex === null) {
1036
+ return;
1037
+ }
1038
+ const bucketStart: Date | null = getBucketDateAtIndex(rowIndex);
1039
+ if (!bucketStart) {
1040
+ return;
1041
+ }
1042
+ /*
1043
+ * Cover the full bucket: width from adjacent row dates, the
1044
+ * same derivation drag-to-select uses.
1045
+ */
1046
+ const adjacentDate: Date | null =
1047
+ rowIndex > 0
1048
+ ? getBucketDateAtIndex(rowIndex - 1)
1049
+ : getBucketDateAtIndex(rowIndex + 1);
1050
+ const bucketWidthInMs: number = adjacentDate
1051
+ ? Math.abs(bucketStart.getTime() - adjacentDate.getTime())
1052
+ : 0;
1053
+ onBucketClick(
1054
+ bucketStart,
1055
+ new Date(bucketStart.getTime() + bucketWidthInMs),
1056
+ (data[rowIndex] || {}) as Record<string, number | string>,
1057
+ );
1071
1058
  }}
1072
- ticks={
1073
- startEndOnly
1074
- ? ([
1075
- (data[0] as any)[index],
1076
- (data[data.length - 1] as any)[index],
1077
- ] as any)
1078
- : undefined
1079
- }
1080
- fill=""
1081
- stroke=""
1082
- className={cx(
1083
- // base
1084
- "tabular-nums",
1085
- // text fill
1086
- "fill-gray-500",
1087
- )}
1088
- tickLine={false}
1089
- axisLine={false}
1090
- minTickGap={tickGap}
1091
- >
1092
- {xAxisLabel && (
1093
- <Label
1094
- position="insideBottom"
1095
- offset={-20}
1096
- className="fill-gray-800 text-sm font-medium"
1097
- >
1098
- {xAxisLabel}
1099
- </Label>
1100
- )}
1101
- </XAxis>
1102
- <YAxis
1103
- width={yAxisWidth}
1104
- hide={!showYAxis}
1105
- axisLine={false}
1106
- tickLine={false}
1107
- type="number"
1108
- domain={yAxisDomain as AxisDomain}
1109
- tick={{
1110
- transform: "translate(-4, 0)",
1111
- fontSize: 10,
1112
- fontWeight: 500,
1113
- fill: "var(--ou-chart-tick)",
1059
+ margin={{
1060
+ /*
1061
+ * Tick labels are 10px font with a translate(0, 6) — they
1062
+ * need ~20px of bottom space, plus another ~20px for the
1063
+ * optional axis label. 8px (the no-axis case) is only
1064
+ * valid when the axis is hidden entirely.
1065
+ */
1066
+ bottom: (xAxisLabel
1067
+ ? 40
1068
+ : showXAxis
1069
+ ? 24
1070
+ : 8) as unknown as number,
1071
+ left: (yAxisLabel ? 20 : 0) as unknown as number,
1072
+ right: (yAxisLabel ? 5 : 8) as unknown as number,
1073
+ /*
1074
+ * The annotation rail is drawn in the top margin, so the
1075
+ * margin has to grow to hold it — otherwise chips render
1076
+ * above the SVG's own edge and get clipped.
1077
+ */
1078
+ top: annotations.marginTop,
1114
1079
  }}
1115
- fill=""
1116
- stroke=""
1117
- className={cx(
1118
- // base
1119
- "tabular-nums",
1120
- // text fill
1121
- "fill-gray-500",
1122
- )}
1123
- tickFormatter={valueFormatter}
1124
- allowDecimals={allowDecimals}
1125
1080
  >
1126
- {yAxisLabel && (
1127
- <Label
1128
- position="insideLeft"
1129
- style={{ textAnchor: "middle" }}
1130
- angle={-90}
1131
- offset={-15}
1132
- className="fill-gray-800 text-sm font-medium"
1133
- >
1134
- {yAxisLabel}
1135
- </Label>
1136
- )}
1137
- </YAxis>
1138
- <Tooltip
1139
- wrapperStyle={{ outline: "none", zIndex: 10 }}
1140
- isAnimationActive={true}
1141
- animationDuration={100}
1142
- cursor={{
1143
- stroke: "var(--ou-chart-cursor, #d1d5db)",
1144
- strokeWidth: 1,
1145
- }}
1146
- offset={20}
1147
- position={{ y: 0 }}
1148
- content={({ active, payload, label }: any) => {
1149
- const cleanPayload: TooltipProps["payload"] = payload
1150
- ? payload.map((item: any) => {
1151
- return {
1152
- category: item.dataKey,
1153
- value: item.value,
1154
- index: item.payload[index],
1155
- color: categoryColors.get(
1156
- item.dataKey,
1157
- ) as ChartColorValue,
1158
- type: item.type,
1159
- payload: item.payload,
1160
- };
1161
- })
1162
- : [];
1163
-
1164
- if (
1165
- tooltipCallback &&
1166
- (active !== prevActiveRef.current ||
1167
- label !== prevLabelRef.current)
1168
- ) {
1169
- tooltipCallback({ active, payload: cleanPayload, label });
1170
- prevActiveRef.current = active;
1171
- prevLabelRef.current = label;
1081
+ {showGridLines ? (
1082
+ <CartesianGrid
1083
+ className={cx("stroke-gray-100")}
1084
+ strokeDasharray="3 3"
1085
+ horizontal={true}
1086
+ vertical={false}
1087
+ />
1088
+ ) : null}
1089
+ <XAxis
1090
+ padding={{ left: paddingValue, right: paddingValue }}
1091
+ hide={!showXAxis}
1092
+ dataKey={index}
1093
+ interval={startEndOnly ? "preserveStartEnd" : intervalType}
1094
+ tick={{
1095
+ transform: "translate(0, 6)",
1096
+ fontSize: 10,
1097
+ fontWeight: 500,
1098
+ fill: "var(--ou-chart-tick)",
1099
+ }}
1100
+ ticks={
1101
+ startEndOnly
1102
+ ? ([
1103
+ (data[0] as any)[index],
1104
+ (data[data.length - 1] as any)[index],
1105
+ ] as any)
1106
+ : undefined
1172
1107
  }
1108
+ fill=""
1109
+ stroke=""
1110
+ className={cx(
1111
+ // base
1112
+ "tabular-nums",
1113
+ // text fill
1114
+ "fill-gray-500",
1115
+ )}
1116
+ tickLine={false}
1117
+ axisLine={false}
1118
+ minTickGap={tickGap}
1119
+ >
1120
+ {xAxisLabel && (
1121
+ <Label
1122
+ position="insideBottom"
1123
+ offset={-20}
1124
+ className="fill-gray-800 text-sm font-medium"
1125
+ >
1126
+ {xAxisLabel}
1127
+ </Label>
1128
+ )}
1129
+ </XAxis>
1130
+ <YAxis
1131
+ width={yAxisWidth}
1132
+ hide={!showYAxis}
1133
+ axisLine={false}
1134
+ tickLine={false}
1135
+ type="number"
1136
+ domain={yAxisDomain as AxisDomain}
1137
+ tick={{
1138
+ transform: "translate(-4, 0)",
1139
+ fontSize: 10,
1140
+ fontWeight: 500,
1141
+ fill: "var(--ou-chart-tick)",
1142
+ }}
1143
+ fill=""
1144
+ stroke=""
1145
+ className={cx(
1146
+ // base
1147
+ "tabular-nums",
1148
+ // text fill
1149
+ "fill-gray-500",
1150
+ )}
1151
+ tickFormatter={valueFormatter}
1152
+ allowDecimals={allowDecimals}
1153
+ >
1154
+ {yAxisLabel && (
1155
+ <Label
1156
+ position="insideLeft"
1157
+ style={{ textAnchor: "middle" }}
1158
+ angle={-90}
1159
+ offset={-15}
1160
+ className="fill-gray-800 text-sm font-medium"
1161
+ >
1162
+ {yAxisLabel}
1163
+ </Label>
1164
+ )}
1165
+ </YAxis>
1166
+ <Tooltip
1167
+ wrapperStyle={{ outline: "none", zIndex: 10 }}
1168
+ isAnimationActive={true}
1169
+ animationDuration={100}
1170
+ cursor={{
1171
+ stroke: "var(--ou-chart-cursor, #d1d5db)",
1172
+ strokeWidth: 1,
1173
+ }}
1174
+ offset={20}
1175
+ position={{ y: 0 }}
1176
+ content={({ active, payload, label }: any) => {
1177
+ const cleanPayload: TooltipProps["payload"] = payload
1178
+ ? payload.map((item: any) => {
1179
+ return {
1180
+ category: item.dataKey,
1181
+ value: item.value,
1182
+ index: item.payload[index],
1183
+ color: categoryColors.get(
1184
+ item.dataKey,
1185
+ ) as ChartColorValue,
1186
+ type: item.type,
1187
+ payload: item.payload,
1188
+ };
1189
+ })
1190
+ : [];
1191
+
1192
+ if (
1193
+ tooltipCallback &&
1194
+ (active !== prevActiveRef.current ||
1195
+ label !== prevLabelRef.current)
1196
+ ) {
1197
+ tooltipCallback({ active, payload: cleanPayload, label });
1198
+ prevActiveRef.current = active;
1199
+ prevLabelRef.current = label;
1200
+ }
1173
1201
 
1174
- return showTooltip && active ? (
1175
- CustomTooltip ? (
1176
- <CustomTooltip
1177
- active={active}
1178
- payload={cleanPayload}
1179
- label={label}
1180
- />
1181
- ) : (
1182
- <ChartTooltip
1183
- active={active}
1184
- payload={cleanPayload}
1185
- label={label}
1186
- valueFormatter={valueFormatter}
1187
- />
1188
- )
1189
- ) : null;
1190
- }}
1191
- />
1192
-
1193
- {showLegend ? (
1194
- <RechartsLegend
1195
- verticalAlign="top"
1196
- height={legendHeight}
1197
- content={({ payload }: any) => {
1198
- return ChartLegend(
1199
- { payload },
1200
- categoryColors,
1201
- setLegendHeight,
1202
- activeLegend,
1203
- hasOnValueChange
1204
- ? (clickedLegendItem: string) => {
1205
- return onCategoryClick(clickedLegendItem);
1206
- }
1207
- : undefined,
1208
- enableLegendSlider,
1209
- legendPosition,
1210
- yAxisWidth,
1211
- );
1202
+ return showTooltip && active ? (
1203
+ CustomTooltip ? (
1204
+ <CustomTooltip
1205
+ active={active}
1206
+ payload={cleanPayload}
1207
+ label={label}
1208
+ />
1209
+ ) : (
1210
+ <ChartTooltip
1211
+ active={active}
1212
+ payload={cleanPayload}
1213
+ label={label}
1214
+ valueFormatter={valueFormatter}
1215
+ />
1216
+ )
1217
+ ) : null;
1212
1218
  }}
1213
1219
  />
1214
- ) : null}
1215
- {categories.map((category: string) => {
1216
- const lineColor: ChartColorValue = categoryColors.get(
1217
- category,
1218
- ) as ChartColorValue;
1219
- const isCustomColor: boolean = isHexColorValue(lineColor);
1220
- const lineHex: string = getColorHex(lineColor);
1221
- const isGhost: boolean =
1222
- ghostCategories?.includes(category) || false;
1223
- return (
1224
- <Line
1225
- className={cx(getColorClassName(lineColor, "stroke"))}
1226
- strokeOpacity={
1227
- (activeDot || (activeLegend && activeLegend !== category)
1228
- ? 0.3
1229
- : 1) * (isGhost ? 0.45 : 1)
1230
- }
1231
- activeDot={
1232
- isGhost
1233
- ? false
1234
- : (props: any) => {
1235
- const {
1236
- cx: cxCoord,
1237
- cy: cyCoord,
1238
- stroke,
1239
- strokeLinecap,
1240
- strokeLinejoin,
1241
- strokeWidth,
1242
- } = props;
1243
- return (
1244
- <Dot
1245
- className={cx(
1246
- "stroke-white",
1247
- onValueChange ? "cursor-pointer" : "",
1248
- getColorClassName(lineColor, "fill"),
1249
- )}
1250
- cx={cxCoord}
1251
- cy={cyCoord}
1252
- r={5}
1253
- fill={isCustomColor ? lineHex : ""}
1254
- stroke={stroke}
1255
- strokeLinecap={strokeLinecap}
1256
- strokeLinejoin={strokeLinejoin}
1257
- strokeWidth={strokeWidth}
1258
- onClick={(_: any, event: any) => {
1259
- return onDotClick(props, event);
1260
- }}
1261
- />
1262
- );
1263
- }
1264
- }
1265
- dot={
1266
- isGhost
1267
- ? false
1268
- : (props: any) => {
1269
- const {
1270
- stroke,
1271
- strokeLinecap,
1272
- strokeLinejoin,
1273
- strokeWidth,
1274
- cx: cxCoord,
1275
- cy: cyCoord,
1276
- index,
1277
- } = props;
1278
-
1279
- if (
1280
- (hasOnlyOneValueForKey(data, category) &&
1281
- !(
1282
- activeDot ||
1283
- (activeLegend && activeLegend !== category)
1284
- )) ||
1285
- (activeDot?.index === index &&
1286
- activeDot?.dataKey === category)
1287
- ) {
1220
+
1221
+ {showLegend ? (
1222
+ <RechartsLegend
1223
+ verticalAlign="top"
1224
+ /*
1225
+ * Padded so the annotation rail gets a clear strip between
1226
+ * the legend and the plot; see UseChartAnnotations.
1227
+ */
1228
+ height={legendHeight + annotations.railHeight}
1229
+ content={({ payload }: any) => {
1230
+ return ChartLegend(
1231
+ { payload },
1232
+ categoryColors,
1233
+ setLegendHeight,
1234
+ activeLegend,
1235
+ hasOnValueChange
1236
+ ? (clickedLegendItem: string) => {
1237
+ return onCategoryClick(clickedLegendItem);
1238
+ }
1239
+ : undefined,
1240
+ enableLegendSlider,
1241
+ legendPosition,
1242
+ yAxisWidth,
1243
+ );
1244
+ }}
1245
+ />
1246
+ ) : null}
1247
+ {categories.map((category: string) => {
1248
+ const lineColor: ChartColorValue = categoryColors.get(
1249
+ category,
1250
+ ) as ChartColorValue;
1251
+ const isCustomColor: boolean = isHexColorValue(lineColor);
1252
+ const lineHex: string = getColorHex(lineColor);
1253
+ const isGhost: boolean =
1254
+ ghostCategories?.includes(category) || false;
1255
+ return (
1256
+ <Line
1257
+ className={cx(getColorClassName(lineColor, "stroke"))}
1258
+ strokeOpacity={
1259
+ (activeDot || (activeLegend && activeLegend !== category)
1260
+ ? 0.3
1261
+ : 1) * (isGhost ? 0.45 : 1)
1262
+ }
1263
+ activeDot={
1264
+ isGhost
1265
+ ? false
1266
+ : (props: any) => {
1267
+ const {
1268
+ cx: cxCoord,
1269
+ cy: cyCoord,
1270
+ stroke,
1271
+ strokeLinecap,
1272
+ strokeLinejoin,
1273
+ strokeWidth,
1274
+ } = props;
1288
1275
  return (
1289
1276
  <Dot
1290
- key={index}
1277
+ className={cx(
1278
+ "stroke-white",
1279
+ onValueChange ? "cursor-pointer" : "",
1280
+ getColorClassName(lineColor, "fill"),
1281
+ )}
1291
1282
  cx={cxCoord}
1292
1283
  cy={cyCoord}
1293
1284
  r={5}
1294
- stroke={stroke}
1295
1285
  fill={isCustomColor ? lineHex : ""}
1286
+ stroke={stroke}
1296
1287
  strokeLinecap={strokeLinecap}
1297
1288
  strokeLinejoin={strokeLinejoin}
1298
1289
  strokeWidth={strokeWidth}
1299
- className={cx(
1300
- "stroke-white",
1301
- onValueChange ? "cursor-pointer" : "",
1302
- getColorClassName(lineColor, "fill"),
1303
- )}
1290
+ onClick={(_: any, event: any) => {
1291
+ return onDotClick(props, event);
1292
+ }}
1304
1293
  />
1305
1294
  );
1306
1295
  }
1307
- return <React.Fragment key={index}></React.Fragment>;
1308
- }
1309
- }
1310
- key={category}
1311
- name={category}
1312
- type={props.curve || ChartCurve.LINEAR}
1313
- dataKey={category}
1314
- /*
1315
- * Custom hex → set the stroke inline; named palette → keep ""
1316
- * so the `stroke-*` Tailwind class on the Line applies.
1317
- */
1318
- stroke={isCustomColor ? lineHex : ""}
1319
- strokeWidth={isGhost ? 1.5 : 2}
1320
- strokeLinejoin="round"
1321
- strokeLinecap="round"
1322
- isAnimationActive={false}
1323
- connectNulls={connectNulls}
1324
- {...(isGhost ? { strokeDasharray: "6 4" } : {})}
1325
- />
1326
- );
1327
- })}
1328
- {/* hidden lines to increase clickable target area */}
1329
- {onValueChange
1330
- ? categories
1331
- .filter((category: string) => {
1332
- // Ghosts are context, not click-selectable series.
1333
- return !(ghostCategories?.includes(category) || false);
1334
- })
1335
- .map((category: string) => {
1336
- return (
1337
- <Line
1338
- className={cx("cursor-pointer")}
1339
- strokeOpacity={0}
1340
- key={category}
1341
- name={category}
1342
- type={props.curve || ChartCurve.LINEAR}
1343
- dataKey={category}
1344
- stroke="transparent"
1345
- fill="transparent"
1346
- legendType="none"
1347
- tooltipType="none"
1348
- strokeWidth={12}
1349
- connectNulls={connectNulls}
1350
- onClick={(props: any, event: any) => {
1351
- event.stopPropagation();
1352
- const { name } = props;
1353
- onCategoryClick(name);
1354
- }}
1355
- />
1356
- );
1357
- })
1358
- : null}
1359
- {props.referenceLines?.map(
1360
- (refLine: ChartReferenceLineProps, refIndex: number) => {
1361
- return (
1362
- <ReferenceLine
1363
- key={`ref-${refIndex}`}
1364
- y={refLine.value}
1365
- stroke={refLine.color}
1366
- strokeDasharray={refLine.strokeDasharray || "4 4"}
1367
- strokeWidth={1.5}
1368
- >
1369
- {refLine.label && (
1370
- <Label
1371
- value={refLine.label}
1372
- position="insideTopRight"
1373
- fill={refLine.color}
1374
- fontSize={11}
1375
- fontWeight={500}
1376
- />
1377
- )}
1378
- </ReferenceLine>
1379
- );
1380
- },
1381
- )}
1382
- {/* Time-anchored shaded regions (e.g. incident/maintenance windows) */}
1383
- {formattedReferenceRegions?.map(
1384
- (region: FormattedReferenceRegion, regionIndex: number) => {
1385
- const regionColor: string = region.original.color || "#6366f1";
1386
- return (
1387
- <ReferenceArea
1388
- key={`ref-region-${regionIndex}`}
1389
- x1={region.formattedX1}
1390
- x2={region.formattedX2}
1391
- fill={regionColor}
1392
- fillOpacity={0.12}
1393
- stroke={regionColor}
1394
- strokeOpacity={0.35}
1395
- strokeWidth={1}
1396
- {...(region.original.onClick
1397
- ? {
1398
- style: { cursor: "pointer" as const },
1399
- onClick: (...args: Array<unknown>): void => {
1400
- // Never let an annotation click also pin a bucket.
1401
- stopChartEventPropagation(...args);
1402
- if (suppressNextClickRef.current) {
1403
- return;
1404
- }
1405
- region.original.onClick?.();
1406
- },
1407
- }
1408
- : {})}
1409
- >
1410
- {region.original.label && (
1411
- <Label
1412
- value={region.original.label}
1413
- position="insideTop"
1414
- fill={regionColor}
1415
- fontSize={10}
1416
- fontWeight={500}
1417
- />
1418
- )}
1419
- </ReferenceArea>
1420
- );
1421
- },
1422
- )}
1423
- {/* Time-anchored vertical event markers (e.g. deploys, incidents) */}
1424
- {formattedTimeReferenceLines?.map(
1425
- (
1426
- timeRefLine: FormattedTimeReferenceLine,
1427
- timeRefIndex: number,
1428
- ) => {
1429
- const lineColor: string =
1430
- timeRefLine.original.color || "#f59e0b";
1431
- return (
1432
- <ReferenceLine
1433
- key={`time-ref-${timeRefIndex}`}
1434
- x={timeRefLine.formattedX}
1435
- stroke={lineColor}
1436
- strokeDasharray={
1437
- timeRefLine.original.strokeDasharray || "4 4"
1438
1296
  }
1439
- strokeWidth={1.5}
1440
- {...(timeRefLine.original.onClick
1441
- ? {
1442
- style: { cursor: "pointer" as const },
1443
- onClick: (...args: Array<unknown>): void => {
1444
- // Never let an annotation click also pin a bucket.
1445
- stopChartEventPropagation(...args);
1446
- if (suppressNextClickRef.current) {
1447
- return;
1297
+ dot={
1298
+ isGhost
1299
+ ? false
1300
+ : (props: any) => {
1301
+ const {
1302
+ stroke,
1303
+ strokeLinecap,
1304
+ strokeLinejoin,
1305
+ strokeWidth,
1306
+ cx: cxCoord,
1307
+ cy: cyCoord,
1308
+ index,
1309
+ } = props;
1310
+
1311
+ if (
1312
+ (hasOnlyOneValueForKey(data, category) &&
1313
+ !(
1314
+ activeDot ||
1315
+ (activeLegend && activeLegend !== category)
1316
+ )) ||
1317
+ (activeDot?.index === index &&
1318
+ activeDot?.dataKey === category)
1319
+ ) {
1320
+ return (
1321
+ <Dot
1322
+ key={index}
1323
+ cx={cxCoord}
1324
+ cy={cyCoord}
1325
+ r={5}
1326
+ stroke={stroke}
1327
+ fill={isCustomColor ? lineHex : ""}
1328
+ strokeLinecap={strokeLinecap}
1329
+ strokeLinejoin={strokeLinejoin}
1330
+ strokeWidth={strokeWidth}
1331
+ className={cx(
1332
+ "stroke-white",
1333
+ onValueChange ? "cursor-pointer" : "",
1334
+ getColorClassName(lineColor, "fill"),
1335
+ )}
1336
+ />
1337
+ );
1448
1338
  }
1449
- timeRefLine.original.onClick?.();
1450
- },
1451
- }
1452
- : {})}
1453
- >
1454
- {timeRefLine.original.label &&
1455
- showTimeReferenceLineLabels && (
1339
+ return (
1340
+ <React.Fragment key={index}></React.Fragment>
1341
+ );
1342
+ }
1343
+ }
1344
+ key={category}
1345
+ name={category}
1346
+ type={props.curve || ChartCurve.LINEAR}
1347
+ dataKey={category}
1348
+ /*
1349
+ * Custom hex → set the stroke inline; named palette → keep ""
1350
+ * so the `stroke-*` Tailwind class on the Line applies.
1351
+ */
1352
+ stroke={isCustomColor ? lineHex : ""}
1353
+ strokeWidth={isGhost ? 1.5 : 2}
1354
+ strokeLinejoin="round"
1355
+ strokeLinecap="round"
1356
+ isAnimationActive={false}
1357
+ connectNulls={connectNulls}
1358
+ {...(isGhost ? { strokeDasharray: "6 4" } : {})}
1359
+ />
1360
+ );
1361
+ })}
1362
+ {/* hidden lines to increase clickable target area */}
1363
+ {onValueChange
1364
+ ? categories
1365
+ .filter((category: string) => {
1366
+ // Ghosts are context, not click-selectable series.
1367
+ return !(ghostCategories?.includes(category) || false);
1368
+ })
1369
+ .map((category: string) => {
1370
+ return (
1371
+ <Line
1372
+ className={cx("cursor-pointer")}
1373
+ strokeOpacity={0}
1374
+ key={category}
1375
+ name={category}
1376
+ type={props.curve || ChartCurve.LINEAR}
1377
+ dataKey={category}
1378
+ stroke="transparent"
1379
+ fill="transparent"
1380
+ legendType="none"
1381
+ tooltipType="none"
1382
+ strokeWidth={12}
1383
+ connectNulls={connectNulls}
1384
+ onClick={(props: any, event: any) => {
1385
+ event.stopPropagation();
1386
+ const { name } = props;
1387
+ onCategoryClick(name);
1388
+ }}
1389
+ />
1390
+ );
1391
+ })
1392
+ : null}
1393
+ {props.referenceLines?.map(
1394
+ (refLine: ChartReferenceLineProps, refIndex: number) => {
1395
+ return (
1396
+ <ReferenceLine
1397
+ key={`ref-${refIndex}`}
1398
+ y={refLine.value}
1399
+ stroke={refLine.color}
1400
+ strokeDasharray={refLine.strokeDasharray || "4 4"}
1401
+ strokeWidth={1.5}
1402
+ >
1403
+ {refLine.label && (
1456
1404
  <Label
1457
- value={timeRefLine.original.label}
1458
- {...(timeReferenceLineCount > 1
1459
- ? {
1460
- /*
1461
- * Several markers: run each label down its
1462
- * own line so labels at different x stop
1463
- * sharing one horizontal band.
1464
- */
1465
- position: "insideTopLeft" as const,
1466
- angle: 90,
1467
- }
1468
- : { position: "insideTop" as const })}
1469
- fill={lineColor}
1470
- fontSize={10}
1405
+ value={refLine.label}
1406
+ position="insideTopRight"
1407
+ fill={refLine.color}
1408
+ fontSize={11}
1471
1409
  fontWeight={500}
1472
1410
  />
1473
1411
  )}
1474
- </ReferenceLine>
1475
- );
1476
- },
1477
- )}
1478
- {/* Exemplar dots - clickable markers linking to traces */}
1479
- {props.formattedExemplarPoints?.map(
1480
- (exemplar: FormattedExemplarPoint, exemplarIndex: number) => {
1481
- return (
1482
- <ReferenceDot
1483
- key={`exemplar-${exemplarIndex}`}
1484
- x={exemplar.formattedX}
1485
- y={exemplar.y}
1486
- r={5}
1487
- fill="#7c3aed"
1488
- stroke="var(--ou-chart-marker-ring, #ffffff)"
1489
- strokeWidth={2}
1490
- style={{ cursor: "pointer" }}
1491
- onClick={(...args: Array<unknown>) => {
1492
- // Never let an exemplar click also pin a bucket.
1493
- stopChartEventPropagation(...args);
1494
- // Ignore the click that follows a drag-to-select.
1495
- if (suppressNextClickRef.current) {
1496
- return;
1497
- }
1498
- props.onExemplarClick?.(exemplar.original);
1499
- }}
1500
- >
1501
- <Label
1502
- value="E"
1503
- position="center"
1504
- /*
1505
- * Sits on the dot's purple, not on the surface, so it must
1506
- * not follow the ring token that flips dark with the theme.
1507
- */
1508
- fill="#ffffff"
1509
- fontSize={8}
1510
- fontWeight={700}
1511
- />
1512
- </ReferenceDot>
1513
- );
1514
- },
1515
- )}
1516
- {/* Live drag-to-select highlight */}
1517
- {rangeSelectionStart && rangeSelectionEnd ? (
1518
- <ReferenceArea
1519
- x1={rangeSelectionStart}
1520
- x2={rangeSelectionEnd}
1521
- fill="rgba(99,102,241,0.12)"
1522
- stroke="rgba(99,102,241,0.5)"
1523
- strokeWidth={1}
1524
- radius={2}
1525
- />
1526
- ) : null}
1527
- </RechartsLineChart>
1528
- </ResponsiveContainer>
1412
+ </ReferenceLine>
1413
+ );
1414
+ },
1415
+ )}
1416
+ {/*
1417
+ * Event markers and shaded windows: hairlines through the plot
1418
+ * topped by a chip rail in the chart's top margin. Everything
1419
+ * that used to be painted over the series as rotated text now
1420
+ * lives in the chip's hover card.
1421
+ */}
1422
+ {annotations.layer}
1423
+ {/* Exemplar dots - clickable markers linking to traces */}
1424
+ {props.formattedExemplarPoints?.map(
1425
+ (exemplar: FormattedExemplarPoint, exemplarIndex: number) => {
1426
+ return (
1427
+ <ReferenceDot
1428
+ key={`exemplar-${exemplarIndex}`}
1429
+ x={exemplar.formattedX}
1430
+ y={exemplar.y}
1431
+ r={5}
1432
+ fill="#7c3aed"
1433
+ stroke="var(--ou-chart-marker-ring, #ffffff)"
1434
+ strokeWidth={2}
1435
+ style={{ cursor: "pointer" }}
1436
+ onClick={(...args: Array<unknown>) => {
1437
+ // Never let an exemplar click also pin a bucket.
1438
+ stopChartEventPropagation(...args);
1439
+ // Ignore the click that follows a drag-to-select.
1440
+ if (suppressNextClickRef.current) {
1441
+ return;
1442
+ }
1443
+ props.onExemplarClick?.(exemplar.original);
1444
+ }}
1445
+ >
1446
+ <Label
1447
+ value="E"
1448
+ position="center"
1449
+ /*
1450
+ * Sits on the dot's purple, not on the surface, so it must
1451
+ * not follow the ring token that flips dark with the theme.
1452
+ */
1453
+ fill="#ffffff"
1454
+ fontSize={8}
1455
+ fontWeight={700}
1456
+ />
1457
+ </ReferenceDot>
1458
+ );
1459
+ },
1460
+ )}
1461
+ {/* Live drag-to-select highlight */}
1462
+ {rangeSelectionStart && rangeSelectionEnd ? (
1463
+ <ReferenceArea
1464
+ x1={rangeSelectionStart}
1465
+ x2={rangeSelectionEnd}
1466
+ fill="rgba(99,102,241,0.12)"
1467
+ stroke="rgba(99,102,241,0.5)"
1468
+ strokeWidth={1}
1469
+ radius={2}
1470
+ />
1471
+ ) : null}
1472
+ </RechartsLineChart>
1473
+ </ResponsiveContainer>
1474
+ {annotations.overlay}
1475
+ </div>
1529
1476
  </div>
1530
1477
  );
1531
1478
  },