@oneuptime/common 11.5.8 → 11.5.10
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.
- package/Models/AnalyticsModels/Index.ts +13 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByContainer.ts +178 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.ts +179 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +179 -0
- package/Models/AnalyticsModels/NetworkFlow.ts +397 -0
- package/Models/DatabaseModels/AIAgentTaskPullRequest.ts +15 -6
- package/Models/DatabaseModels/AIRun.ts +37 -0
- package/Models/DatabaseModels/AIRunEvent.ts +34 -1
- package/Models/DatabaseModels/EnterpriseLicenseInstance.ts +18 -0
- package/Models/DatabaseModels/GlobalConfig.ts +36 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/MarketingConversion.ts +198 -0
- package/Models/DatabaseModels/MetricSavedView.ts +34 -0
- package/Models/DatabaseModels/MetricType.ts +74 -0
- package/Models/DatabaseModels/NetworkDevice.ts +332 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +328 -0
- package/Models/DatabaseModels/NetworkInterface.ts +58 -0
- package/Models/DatabaseModels/Project.ts +62 -0
- package/Models/DatabaseModels/StatusPage.ts +42 -0
- package/Models/DatabaseModels/User.ts +37 -0
- package/Server/API/AIAgentTaskAPI.ts +38 -12
- package/Server/API/AIAgentTaskLogAPI.ts +49 -0
- package/Server/API/AIChatAPI.ts +16 -0
- package/Server/API/AIReadinessAPI.ts +84 -0
- package/Server/API/BaseAnalyticsAPI.ts +23 -0
- package/Server/API/CodeFixRunAPI.ts +182 -0
- package/Server/API/EnterpriseLicenseAPI.ts +14 -0
- package/Server/API/TelemetryExceptionAPI.ts +6 -1
- package/Server/EnvironmentConfig.ts +84 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.ts +95 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.ts +52 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.ts +30 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.ts +38 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.ts +28 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.ts +49 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.ts +108 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +20 -0
- package/Server/Services/AIRunEventService.ts +15 -1
- package/Server/Services/AIRunService.ts +38 -1
- package/Server/Services/AnalyticsDatabaseService.ts +70 -1
- package/Server/Services/IncidentService.ts +13 -0
- package/Server/Services/Index.ts +10 -0
- package/Server/Services/LlmProviderService.ts +2 -0
- package/Server/Services/MarketingConversionService.ts +10 -0
- package/Server/Services/MetricItemAggMV1mByContainerService.ts +31 -0
- package/Server/Services/MetricItemAggMV1mByK8sClusterService.ts +31 -0
- package/Server/Services/MetricItemAggMV1mByServiceService.ts +31 -0
- package/Server/Services/MetricService.ts +970 -122
- package/Server/Services/MonitorService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerTeamService.ts +42 -0
- package/Server/Services/NetworkDeviceOwnerUserService.ts +106 -0
- package/Server/Services/NetworkFlowService.ts +11 -0
- package/Server/Services/OnCallDutyPolicyService.ts +11 -1
- package/Server/Services/ProjectService.ts +178 -0
- package/Server/Services/SpanService.ts +13 -9
- package/Server/Services/StatusPageService.ts +97 -0
- package/Server/Services/TeamMemberService.ts +11 -0
- package/Server/Services/TelemetryExceptionService.ts +19 -90
- package/Server/Services/UserService.ts +59 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +37 -7
- package/Server/Types/Markdown.ts +9 -9
- package/Server/Types/MarkdownSlugify.ts +47 -0
- package/Server/Utils/AI/AIRunTranscript.ts +240 -0
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +9 -0
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +119 -5
- package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +75 -0
- package/Server/Utils/AI/CodeFix/CodeFixReadiness.ts +235 -0
- package/Server/Utils/AI/SRE/Insights/FixRouting.ts +2 -3
- package/Server/Utils/AI/Toolbox/CodeTools.ts +883 -0
- package/Server/Utils/AI/Toolbox/CodeWriteTools.ts +519 -0
- package/Server/Utils/AI/Toolbox/Index.ts +27 -0
- package/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.ts +279 -0
- package/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.ts +19 -1
- package/Server/Utils/Attribution.ts +99 -0
- package/Server/Utils/CodeRepository/GitHub/GitHub.ts +600 -0
- package/Server/Utils/CodeRepository/StackTraceRepoResolver.ts +7 -2
- package/Server/Utils/LLM/LLMService.ts +397 -18
- package/Server/Utils/Marketing/ConversionUploadProvider.ts +103 -0
- package/Server/Utils/Marketing/ConversionUploadProviders.ts +22 -0
- package/Server/Utils/Marketing/Providers/GoogleAds.ts +270 -0
- package/Server/Utils/Marketing/Providers/LinkedIn.ts +147 -0
- package/Server/Utils/Marketing/Providers/Meta.ts +148 -0
- package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +196 -0
- package/Server/Utils/Marketing/Providers/Reddit.ts +178 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +71 -7
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +31 -19
- package/Server/Utils/Monitor/MonitorIncident.ts +71 -7
- package/Server/Utils/Monitor/MonitorMetricUtil.ts +57 -0
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +94 -0
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +19 -11
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +125 -14
- package/Server/Utils/ProductAnalytics.ts +133 -0
- package/Server/Utils/Telemetry/Telemetry.ts +39 -0
- package/Server/Utils/Telemetry/TelemetryEntity.ts +21 -0
- package/Tests/Models/StatusPageEnableMcpServer.test.ts +125 -0
- package/Tests/Server/API/BaseAnalyticsAPI.test.ts +72 -0
- package/Tests/Server/Infrastructure/SemaphorePermit.test.ts +9 -1
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +21 -2
- package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +173 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +1391 -0
- package/Tests/Server/Services/NetworkDeviceOwnerServices.test.ts +260 -0
- package/Tests/Server/Services/StatusPageServiceMcp.test.ts +223 -0
- package/Tests/Server/Services/TelemetryExceptionAIFixReadiness.test.ts +26 -3
- package/Tests/Server/Services/TelemetryExceptionCodeFixRun.test.ts +12 -0
- package/Tests/Server/Types/Markdown.test.ts +106 -0
- package/Tests/Server/Utils/AI/AIRunTranscript.test.ts +182 -0
- package/Tests/Server/Utils/AI/CodeFixReadiness.test.ts +411 -0
- package/Tests/Server/Utils/AI/CodeTools.test.ts +596 -0
- package/Tests/Server/Utils/AI/CodeWriteTools.test.ts +475 -0
- package/Tests/Server/Utils/AI/LLMServiceModelCompatibility.test.ts +548 -0
- package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +142 -0
- package/Tests/Server/Utils/AI/ScheduledMaintenanceTools.test.ts +176 -0
- package/Tests/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.test.ts +63 -0
- package/Tests/Server/Utils/GitHubGetFileContent.test.ts +197 -0
- package/Tests/Server/Utils/Monitor/MonitorTemplateUtilNetworkDevice.test.ts +389 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceHydrationUtil.test.ts +502 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +764 -0
- package/Tests/Types/AI/AIAgentTaskStatus.test.ts +7 -6
- package/Tests/Types/AI/AIChatPageContext.test.ts +0 -0
- package/Tests/Types/AI/AIRunStatus.test.ts +42 -0
- package/Tests/Types/BaseDatabase/AggregationIntervalUtil.test.ts +111 -2
- package/Tests/Types/Database/EndsWith.test.ts +64 -0
- package/Tests/Types/Database/GreaterThan.test.ts +62 -0
- package/Tests/Types/Database/GreaterThanOrEqual.test.ts +65 -0
- package/Tests/Types/Database/GreaterThanOrNull.test.ts +63 -0
- package/Tests/Types/Database/Includes.test.ts +65 -0
- package/Tests/Types/Database/IncludesAll.test.ts +65 -0
- package/Tests/Types/Database/IncludesNone.test.ts +65 -0
- package/Tests/Types/Database/IsNull.test.ts +44 -0
- package/Tests/Types/Database/LessThan.test.ts +62 -0
- package/Tests/Types/Database/LessThanOrEqual.test.ts +62 -0
- package/Tests/Types/Database/LessThanOrNull.test.ts +62 -0
- package/Tests/Types/Database/MultiSearch.test.ts +81 -0
- package/Tests/Types/Database/NotContains.test.ts +64 -0
- package/Tests/Types/Database/NotNull.test.ts +44 -0
- package/Tests/Types/Database/StartsWith.test.ts +64 -0
- package/Tests/Types/Log/LogSeverity.test.ts +78 -0
- package/Tests/Types/Monitor/MonitorStepSqlMonitor.test.ts +83 -1
- package/Tests/Types/Monitor/SnmpV3EnumParsing.test.ts +247 -0
- package/Tests/Types/Monitor/SnmpVendorTemplate.test.ts +263 -0
- package/Tests/UI/Components/BasicFormDropdownNormalization.test.tsx +167 -0
- package/Tests/UI/Components/Charts/AxisTickColor.test.tsx +66 -0
- package/Tests/UI/Components/XAxis.test.ts +5 -3
- package/Tests/UI/Utils/AIChatExport/ChatWidgetData.test.ts +319 -0
- package/Tests/UI/Utils/AIChatExport/ChatWidgetMarkdown.test.ts +188 -0
- package/Tests/Utils/EnterpriseLicenseUsage.test.ts +76 -0
- package/Tests/Utils/Metrics/MetricExplorerUrl.test.ts +622 -0
- package/Tests/Utils/Metrics/MetricFormulaEvaluator.test.ts +474 -0
- package/Tests/Utils/Telemetry/HeartbeatAvailability.test.ts +52 -4
- package/Types/AI/AIAgentTaskStatus.ts +13 -0
- package/Types/AI/AIChatPageContext.ts +137 -0
- package/Types/AI/AIChatTypes.ts +44 -0
- package/Types/AI/AIFixReadiness.ts +46 -0
- package/Types/AI/AIRunStatus.ts +11 -0
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +11 -0
- package/Types/BaseDatabase/AggregateBy.ts +31 -2
- package/Types/BaseDatabase/AggregatedResult.ts +22 -0
- package/Types/BaseDatabase/AggregationInterval.ts +11 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.ts +30 -5
- package/Types/Dashboard/DashboardComponents/DashboardTraceChartComponent.ts +16 -0
- package/Types/Email/EmailTemplateType.ts +3 -0
- package/Types/Log/LogSeverity.ts +61 -0
- package/Types/Marketing/MarketingConversion.ts +11 -0
- package/Types/Metrics/MetricQueryConfigData.ts +21 -0
- package/Types/Metrics/MetricQueryData.ts +8 -0
- package/Types/Metrics/MetricViewData.ts +8 -0
- package/Types/Monitor/MonitorMetricType.ts +8 -0
- package/Types/Monitor/MonitorStep.ts +9 -0
- package/Types/Monitor/MonitorStepSqlMonitor.ts +12 -0
- package/Types/Monitor/MonitorType.ts +2 -1
- package/Types/Monitor/SSLMonitor/SslMonitorResponse.ts +17 -12
- package/Types/Monitor/SnmpMonitor/CdpNeighbor.ts +13 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +37 -3
- package/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.ts +46 -0
- package/Types/Monitor/SnmpMonitor/SnmpEntityInfo.ts +15 -0
- package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +8 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +17 -8
- package/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.ts +53 -0
- package/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.ts +43 -0
- package/Types/Monitor/SnmpMonitor/SnmpSystemInfo.ts +16 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +119 -3
- package/Types/Monitor/SnmpMonitor/SnmpVersion.ts +40 -0
- package/Types/NetFlow/NetworkFlowRecord.ts +25 -0
- package/Types/Syslog/SyslogMessage.ts +18 -0
- package/Types/Telemetry/TelemetrySavedViewState.ts +9 -0
- package/Types/Telemetry/TelemetrySavedViewType.ts +12 -0
- package/UI/Components/Charts/Area/AreaChart.tsx +51 -0
- package/UI/Components/Charts/Bar/BarChart.tsx +51 -1
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +97 -26
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +336 -3
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +118 -1
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +336 -3
- package/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.ts +7 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.ts +15 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.ts +13 -0
- package/UI/Components/Charts/Line/LineChart.tsx +51 -0
- package/UI/Components/Charts/Types/ReferenceRegionProps.ts +12 -0
- package/UI/Components/Charts/Types/TimeReferenceLineProps.ts +12 -0
- package/UI/Components/Charts/Types/XAxis/XAxisPrecision.ts +1 -0
- package/UI/Components/Charts/Utils/DataPoint.ts +0 -0
- package/UI/Components/Charts/Utils/TimeAnnotation.ts +169 -0
- package/UI/Components/Charts/Utils/XAxis.ts +28 -4
- package/UI/Components/Forms/BasicForm.tsx +26 -8
- package/UI/Components/Icon/Icon.tsx +33 -13
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +9 -0
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +67 -0
- package/UI/Components/Page/ModelPage.tsx +6 -1
- package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +33 -4
- package/UI/Styles/Theme.css +1324 -0
- package/UI/Utils/AIChatExport/ChatWidgetData.ts +316 -0
- package/UI/Utils/AIChatExport/ChatWidgetMarkdown.ts +349 -0
- package/UI/Utils/AIChatExport/ConversationMarkdown.ts +177 -0
- package/UI/Utils/AIChatExport/MarkdownBlocks.ts +327 -0
- package/UI/Utils/AIChatExport/MarkdownSafety.ts +215 -0
- package/UI/Utils/DownloadFile.ts +54 -0
- package/UI/Utils/User.ts +41 -2
- package/Utils/Analytics.ts +8 -6
- package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +74 -0
- package/Utils/Metrics/MetricExplorerUrl.ts +771 -0
- package/Utils/Metrics/MetricFormulaEvaluator.ts +410 -46
- package/Utils/Monitor/NetworkTopologyUtil.ts +261 -49
- package/Utils/ValueFormatter.ts +22 -1
- package/build/dist/Models/AnalyticsModels/Index.js +13 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js +159 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +158 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +160 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js +351 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js +15 -7
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIRun.js +38 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIRunEvent.js +31 -0
- package/build/dist/Models/DatabaseModels/AIRunEvent.js.map +1 -1
- package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js +19 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +38 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MarketingConversion.js +219 -0
- package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +1 -0
- package/build/dist/Models/DatabaseModels/MetricSavedView.js +35 -0
- package/build/dist/Models/DatabaseModels/MetricSavedView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MetricType.js +76 -0
- package/build/dist/Models/DatabaseModels/MetricType.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +341 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +341 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkInterface.js +60 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +65 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +43 -0
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/User.js +38 -0
- package/build/dist/Models/DatabaseModels/User.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskAPI.js +37 -11
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskLogAPI.js +32 -7
- package/build/dist/Server/API/AIAgentTaskLogAPI.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +9 -0
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/AIReadinessAPI.js +57 -0
- package/build/dist/Server/API/AIReadinessAPI.js.map +1 -0
- package/build/dist/Server/API/BaseAnalyticsAPI.js +19 -0
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/CodeFixRunAPI.js +142 -0
- package/build/dist/Server/API/CodeFixRunAPI.js.map +1 -1
- package/build/dist/Server/API/EnterpriseLicenseAPI.js +8 -0
- package/build/dist/Server/API/EnterpriseLicenseAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryExceptionAPI.js +4 -0
- package/build/dist/Server/API/TelemetryExceptionAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +51 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.js +80 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.js +37 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js +27 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js +21 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js +47 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIRunEventService.js +8 -0
- package/build/dist/Server/Services/AIRunEventService.js.map +1 -1
- package/build/dist/Server/Services/AIRunService.js +29 -0
- package/build/dist/Server/Services/AIRunService.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +58 -4
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +12 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +10 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LlmProviderService.js +2 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
- package/build/dist/Server/Services/MarketingConversionService.js +9 -0
- package/build/dist/Server/Services/MarketingConversionService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js.map +1 -0
- package/build/dist/Server/Services/MetricService.js +761 -125
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +18 -5
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +44 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +88 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/NetworkFlowService.js +9 -0
- package/build/dist/Server/Services/NetworkFlowService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyService.js +15 -6
- package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +146 -6
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/SpanService.js +8 -6
- package/build/dist/Server/Services/SpanService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +91 -0
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +11 -0
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryExceptionService.js +14 -61
- package/build/dist/Server/Services/TelemetryExceptionService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +52 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +33 -7
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
- package/build/dist/Server/Types/Markdown.js +8 -8
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Types/MarkdownSlugify.js +47 -0
- package/build/dist/Server/Types/MarkdownSlugify.js.map +1 -0
- package/build/dist/Server/Utils/AI/AIRunTranscript.js +180 -0
- package/build/dist/Server/Utils/AI/AIRunTranscript.js.map +1 -0
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +1 -0
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +103 -5
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +55 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js +211 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/FixRouting.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js +654 -0
- package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/CodeWriteTools.js +389 -0
- package/build/dist/Server/Utils/AI/Toolbox/CodeWriteTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +19 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.js +239 -0
- package/build/dist/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.js.map +1 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js +19 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js.map +1 -1
- package/build/dist/Server/Utils/Attribution.js +74 -0
- package/build/dist/Server/Utils/Attribution.js.map +1 -0
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +439 -0
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js +1 -1
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +275 -19
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +40 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js +20 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +177 -0
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +113 -0
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js +109 -0
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +130 -0
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +126 -0
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +53 -9
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +21 -10
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +54 -11
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +43 -3
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +68 -0
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +17 -11
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +100 -15
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/ProductAnalytics.js +111 -0
- package/build/dist/Server/Utils/ProductAnalytics.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/Telemetry.js +32 -5
- package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -0
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Types/AI/AIAgentTaskStatus.js +12 -0
- package/build/dist/Types/AI/AIAgentTaskStatus.js.map +1 -1
- package/build/dist/Types/AI/AIChatPageContext.js +101 -0
- package/build/dist/Types/AI/AIChatPageContext.js.map +1 -0
- package/build/dist/Types/AI/AIChatTypes.js +2 -0
- package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
- package/build/dist/Types/AI/AIFixReadiness.js +9 -0
- package/build/dist/Types/AI/AIFixReadiness.js.map +1 -0
- package/build/dist/Types/AI/AIRunStatus.js +11 -0
- package/build/dist/Types/AI/AIRunStatus.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +11 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationInterval.js +11 -0
- package/build/dist/Types/BaseDatabase/AggregationInterval.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +33 -5
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Log/LogSeverity.js +56 -0
- package/build/dist/Types/Log/LogSeverity.js.map +1 -1
- package/build/dist/Types/Marketing/MarketingConversion.js +13 -0
- package/build/dist/Types/Marketing/MarketingConversion.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js +7 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +6 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js +3 -0
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +2 -1
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js +41 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js +48 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js +38 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +96 -3
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVersion.js +38 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVersion.js.map +1 -1
- package/build/dist/Types/NetFlow/NetworkFlowRecord.js +2 -0
- package/build/dist/Types/NetFlow/NetworkFlowRecord.js.map +1 -0
- package/build/dist/Types/Syslog/SyslogMessage.js +2 -0
- package/build/dist/Types/Syslog/SyslogMessage.js.map +1 -0
- package/build/dist/Types/Telemetry/TelemetrySavedViewState.js +0 -7
- package/build/dist/Types/Telemetry/TelemetrySavedViewState.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetrySavedViewType.js +13 -0
- package/build/dist/Types/Telemetry/TelemetrySavedViewType.js.map +1 -0
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +25 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +26 -2
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +36 -12
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +217 -8
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +55 -4
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +217 -8
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js +6 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js.map +1 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +25 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js +2 -0
- package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js.map +1 -0
- package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js +2 -0
- package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js.map +1 -0
- package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js +1 -0
- package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js +0 -0
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js +121 -0
- package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js.map +1 -0
- package/build/dist/UI/Components/Charts/Utils/XAxis.js +27 -4
- package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js +24 -6
- package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +15 -8
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +58 -0
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Components/Page/ModelPage.js +7 -1
- package/build/dist/UI/Components/Page/ModelPage.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +10 -4
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
- package/build/dist/UI/Utils/AIChatExport/ChatWidgetData.js +217 -0
- package/build/dist/UI/Utils/AIChatExport/ChatWidgetData.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/ChatWidgetMarkdown.js +234 -0
- package/build/dist/UI/Utils/AIChatExport/ChatWidgetMarkdown.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js +111 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownBlocks.js +233 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownBlocks.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownSafety.js +134 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownSafety.js.map +1 -0
- package/build/dist/UI/Utils/DownloadFile.js +41 -0
- package/build/dist/UI/Utils/DownloadFile.js.map +1 -0
- package/build/dist/UI/Utils/User.js +35 -2
- package/build/dist/UI/Utils/User.js.map +1 -1
- package/build/dist/Utils/Analytics.js +8 -5
- package/build/dist/Utils/Analytics.js.map +1 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js +57 -0
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js.map +1 -1
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js +418 -0
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -0
- package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js +296 -37
- package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +176 -40
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/ValueFormatter.js +20 -1
- package/build/dist/Utils/ValueFormatter.js.map +1 -1
- package/package.json +6 -2
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Line,
|
|
13
13
|
Legend as RechartsLegend,
|
|
14
14
|
LineChart as RechartsLineChart,
|
|
15
|
+
ReferenceArea,
|
|
15
16
|
ReferenceDot,
|
|
16
17
|
ReferenceLine,
|
|
17
18
|
ResponsiveContainer,
|
|
@@ -22,6 +23,9 @@ import {
|
|
|
22
23
|
import ChartReferenceLineProps from "../../Types/ReferenceLineProps";
|
|
23
24
|
import ExemplarPoint from "../../Types/ExemplarPoint";
|
|
24
25
|
import FormattedExemplarPoint from "../Types/FormattedExemplarPoint";
|
|
26
|
+
import FormattedReferenceRegion from "../Types/FormattedReferenceRegion";
|
|
27
|
+
import FormattedTimeReferenceLine from "../Types/FormattedTimeReferenceLine";
|
|
28
|
+
import { CHART_DATA_POINT_DATE_KEY } from "../Types/ChartDataPoint";
|
|
25
29
|
import { AxisDomain } from "recharts/types/util/types";
|
|
26
30
|
|
|
27
31
|
import { useOnWindowResize } from "../Utils/UseWindowOnResize";
|
|
@@ -38,6 +42,15 @@ import { getYAxisDomain } from "../Utils/GetYAxisDomain";
|
|
|
38
42
|
import { hasOnlyOneValueForKey } from "../Utils/HasOnlyOneValueForKey";
|
|
39
43
|
import ChartCurve from "../../Types/ChartCurve";
|
|
40
44
|
|
|
45
|
+
/*
|
|
46
|
+
* Incident/alert time markers each label at the same "insideTop" band, so
|
|
47
|
+
* several events in one window pile their labels into an unreadable stack.
|
|
48
|
+
* A single marker keeps the classic horizontal top label; a handful get
|
|
49
|
+
* rotated to run along their lines; past this cap inline labels are hidden
|
|
50
|
+
* entirely (the dashed lines and their click-through remain).
|
|
51
|
+
*/
|
|
52
|
+
const MAX_LABELED_TIME_REFERENCE_LINES: number = 6;
|
|
53
|
+
|
|
41
54
|
//#region Legend
|
|
42
55
|
|
|
43
56
|
interface LegendItemProps {
|
|
@@ -559,6 +572,15 @@ type BaseEventProps = {
|
|
|
559
572
|
|
|
560
573
|
type LineChartEventProps = BaseEventProps | null | undefined;
|
|
561
574
|
|
|
575
|
+
/*
|
|
576
|
+
* Subset of the recharts MouseHandlerDataParam passed to chart-level
|
|
577
|
+
* mouse handlers — just the fields range selection needs.
|
|
578
|
+
*/
|
|
579
|
+
type RangeSelectionChartState = {
|
|
580
|
+
activeTooltipIndex?: number | string | null | undefined;
|
|
581
|
+
activeLabel?: string | number | undefined;
|
|
582
|
+
};
|
|
583
|
+
|
|
562
584
|
interface LineChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
563
585
|
data: Record<string, any>[];
|
|
564
586
|
index: string;
|
|
@@ -589,8 +611,11 @@ interface LineChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
589
611
|
customTooltip?: React.ComponentType<TooltipProps>;
|
|
590
612
|
syncid?: string | undefined;
|
|
591
613
|
referenceLines?: Array<ChartReferenceLineProps> | undefined;
|
|
614
|
+
formattedTimeReferenceLines?: Array<FormattedTimeReferenceLine> | undefined;
|
|
615
|
+
formattedReferenceRegions?: Array<FormattedReferenceRegion> | undefined;
|
|
592
616
|
formattedExemplarPoints?: Array<FormattedExemplarPoint> | undefined;
|
|
593
617
|
onExemplarClick?: ((exemplar: ExemplarPoint) => void) | undefined;
|
|
618
|
+
onTimeRangeSelect?: ((startTime: Date, endTime: Date) => void) | undefined;
|
|
594
619
|
}
|
|
595
620
|
|
|
596
621
|
const LineChart: React.ForwardRefExoticComponent<
|
|
@@ -627,6 +652,9 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
627
652
|
legendPosition = "right",
|
|
628
653
|
tooltipCallback,
|
|
629
654
|
customTooltip,
|
|
655
|
+
formattedTimeReferenceLines,
|
|
656
|
+
formattedReferenceRegions,
|
|
657
|
+
onTimeRangeSelect,
|
|
630
658
|
...other
|
|
631
659
|
} = props;
|
|
632
660
|
const CustomTooltip: React.ComponentType<TooltipProps> | undefined =
|
|
@@ -640,8 +668,27 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
640
668
|
const [activeLegend, setActiveLegend] = React.useState<string | undefined>(
|
|
641
669
|
undefined,
|
|
642
670
|
);
|
|
671
|
+
const hasOnTimeRangeSelect: boolean = Boolean(onTimeRangeSelect);
|
|
672
|
+
const [rangeSelectionStart, setRangeSelectionStart] = React.useState<
|
|
673
|
+
string | null
|
|
674
|
+
>(null);
|
|
675
|
+
const [rangeSelectionEnd, setRangeSelectionEnd] = React.useState<
|
|
676
|
+
string | null
|
|
677
|
+
>(null);
|
|
678
|
+
const isRangeSelecting: React.MutableRefObject<boolean> =
|
|
679
|
+
React.useRef<boolean>(false);
|
|
680
|
+
const rangeSelectionStartIndexRef: React.MutableRefObject<number | null> =
|
|
681
|
+
React.useRef<number | null>(null);
|
|
682
|
+
const rangeSelectionEndIndexRef: React.MutableRefObject<number | null> =
|
|
683
|
+
React.useRef<number | null>(null);
|
|
684
|
+
const suppressNextClickRef: React.MutableRefObject<boolean> =
|
|
685
|
+
React.useRef<boolean>(false);
|
|
643
686
|
const categoryColors: Map<string, ChartColorValue> =
|
|
644
687
|
constructCategoryColors(categories, colors);
|
|
688
|
+
const timeReferenceLineCount: number =
|
|
689
|
+
formattedTimeReferenceLines?.length || 0;
|
|
690
|
+
const showTimeReferenceLineLabels: boolean =
|
|
691
|
+
timeReferenceLineCount <= MAX_LABELED_TIME_REFERENCE_LINES;
|
|
645
692
|
|
|
646
693
|
const yAxisDomain: (number | "auto")[] = getYAxisDomain(
|
|
647
694
|
autoMinValue,
|
|
@@ -657,6 +704,11 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
657
704
|
function onDotClick(itemData: any, event: React.MouseEvent): void {
|
|
658
705
|
event.stopPropagation();
|
|
659
706
|
|
|
707
|
+
// Ignore the click that immediately follows a drag-to-select.
|
|
708
|
+
if (suppressNextClickRef.current) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
|
|
660
712
|
if (!hasOnValueChange) {
|
|
661
713
|
return;
|
|
662
714
|
}
|
|
@@ -685,6 +737,10 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
685
737
|
}
|
|
686
738
|
|
|
687
739
|
function onCategoryClick(dataKey: string): void {
|
|
740
|
+
// Ignore the click that immediately follows a drag-to-select.
|
|
741
|
+
if (suppressNextClickRef.current) {
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
688
744
|
if (!hasOnValueChange) {
|
|
689
745
|
return;
|
|
690
746
|
}
|
|
@@ -706,15 +762,179 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
706
762
|
setActiveDot(undefined);
|
|
707
763
|
}
|
|
708
764
|
|
|
765
|
+
function getRowIndexFromChartState(
|
|
766
|
+
chartState: RangeSelectionChartState,
|
|
767
|
+
): number | null {
|
|
768
|
+
const activeTooltipIndex: number | string | null | undefined =
|
|
769
|
+
chartState.activeTooltipIndex;
|
|
770
|
+
const numericIndex: number =
|
|
771
|
+
typeof activeTooltipIndex === "number"
|
|
772
|
+
? activeTooltipIndex
|
|
773
|
+
: Number(activeTooltipIndex);
|
|
774
|
+
if (
|
|
775
|
+
activeTooltipIndex !== undefined &&
|
|
776
|
+
activeTooltipIndex !== null &&
|
|
777
|
+
Number.isInteger(numericIndex) &&
|
|
778
|
+
numericIndex >= 0 &&
|
|
779
|
+
numericIndex < data.length
|
|
780
|
+
) {
|
|
781
|
+
return numericIndex;
|
|
782
|
+
}
|
|
783
|
+
// Fall back to matching activeLabel against the row labels.
|
|
784
|
+
if (chartState.activeLabel !== undefined) {
|
|
785
|
+
const rowIndex: number = data.findIndex(
|
|
786
|
+
(row: Record<string, unknown>) => {
|
|
787
|
+
return row[index] === chartState.activeLabel;
|
|
788
|
+
},
|
|
789
|
+
);
|
|
790
|
+
return rowIndex >= 0 ? rowIndex : null;
|
|
791
|
+
}
|
|
792
|
+
return null;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
function getBucketDateAtIndex(rowIndex: number): Date | null {
|
|
796
|
+
const rawDate: unknown = data[rowIndex]?.[CHART_DATA_POINT_DATE_KEY];
|
|
797
|
+
return typeof rawDate === "number" ? new Date(rawDate) : null;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function handleRangeSelectMouseDown(
|
|
801
|
+
chartState: RangeSelectionChartState,
|
|
802
|
+
): void {
|
|
803
|
+
if (!hasOnTimeRangeSelect) {
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
const rowIndex: number | null = getRowIndexFromChartState(chartState);
|
|
807
|
+
if (rowIndex === null) {
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
const rowLabel: unknown = data[rowIndex]?.[index];
|
|
811
|
+
if (typeof rowLabel !== "string") {
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
isRangeSelecting.current = true;
|
|
815
|
+
rangeSelectionStartIndexRef.current = rowIndex;
|
|
816
|
+
rangeSelectionEndIndexRef.current = rowIndex;
|
|
817
|
+
setRangeSelectionStart(rowLabel);
|
|
818
|
+
setRangeSelectionEnd(null);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
function handleRangeSelectMouseMove(
|
|
822
|
+
chartState: RangeSelectionChartState,
|
|
823
|
+
mouseEvent: React.MouseEvent<SVGGraphicsElement>,
|
|
824
|
+
): void {
|
|
825
|
+
if (!isRangeSelecting.current) {
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
// Button was released outside the chart — abandon the selection.
|
|
829
|
+
if (mouseEvent.buttons === 0) {
|
|
830
|
+
isRangeSelecting.current = false;
|
|
831
|
+
rangeSelectionStartIndexRef.current = null;
|
|
832
|
+
rangeSelectionEndIndexRef.current = null;
|
|
833
|
+
setRangeSelectionStart(null);
|
|
834
|
+
setRangeSelectionEnd(null);
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
const rowIndex: number | null = getRowIndexFromChartState(chartState);
|
|
838
|
+
if (rowIndex === null) {
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
const rowLabel: unknown = data[rowIndex]?.[index];
|
|
842
|
+
if (typeof rowLabel !== "string") {
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
rangeSelectionEndIndexRef.current = rowIndex;
|
|
846
|
+
setRangeSelectionEnd(rowLabel);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
function handleRangeSelectMouseUp(): void {
|
|
850
|
+
if (!isRangeSelecting.current) {
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
isRangeSelecting.current = false;
|
|
854
|
+
|
|
855
|
+
const startIndex: number | null = rangeSelectionStartIndexRef.current;
|
|
856
|
+
const endIndex: number | null = rangeSelectionEndIndexRef.current;
|
|
857
|
+
rangeSelectionStartIndexRef.current = null;
|
|
858
|
+
rangeSelectionEndIndexRef.current = null;
|
|
859
|
+
setRangeSelectionStart(null);
|
|
860
|
+
setRangeSelectionEnd(null);
|
|
861
|
+
|
|
862
|
+
/*
|
|
863
|
+
* A plain click (pointer never left the starting bucket) must keep
|
|
864
|
+
* behaving exactly as before — only a real drag selects a range.
|
|
865
|
+
*/
|
|
866
|
+
if (startIndex === null || endIndex === null || startIndex === endIndex) {
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/*
|
|
871
|
+
* The browser fires a click right after mouseup; swallow it so a
|
|
872
|
+
* drag doesn't also toggle legend/dot selection. Cleared on a
|
|
873
|
+
* timeout so a never-delivered click can't suppress a later one.
|
|
874
|
+
*/
|
|
875
|
+
suppressNextClickRef.current = true;
|
|
876
|
+
setTimeout(() => {
|
|
877
|
+
suppressNextClickRef.current = false;
|
|
878
|
+
}, 0);
|
|
879
|
+
|
|
880
|
+
if (!onTimeRangeSelect) {
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
const lowerIndex: number = Math.min(startIndex, endIndex);
|
|
885
|
+
const upperIndex: number = Math.max(startIndex, endIndex);
|
|
886
|
+
const startDate: Date | null = getBucketDateAtIndex(lowerIndex);
|
|
887
|
+
const lastBucketDate: Date | null = getBucketDateAtIndex(upperIndex);
|
|
888
|
+
if (!startDate || !lastBucketDate) {
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/*
|
|
893
|
+
* Cover the full final bucket: its end is its start plus one
|
|
894
|
+
* bucket width, derived from adjacent row dates.
|
|
895
|
+
*/
|
|
896
|
+
const adjacentDate: Date | null =
|
|
897
|
+
upperIndex > 0
|
|
898
|
+
? getBucketDateAtIndex(upperIndex - 1)
|
|
899
|
+
: getBucketDateAtIndex(upperIndex + 1);
|
|
900
|
+
const bucketWidthInMs: number = adjacentDate
|
|
901
|
+
? Math.abs(lastBucketDate.getTime() - adjacentDate.getTime())
|
|
902
|
+
: 0;
|
|
903
|
+
const endDate: Date = new Date(
|
|
904
|
+
lastBucketDate.getTime() + bucketWidthInMs,
|
|
905
|
+
);
|
|
906
|
+
|
|
907
|
+
onTimeRangeSelect(startDate, endDate);
|
|
908
|
+
}
|
|
909
|
+
|
|
709
910
|
return (
|
|
710
|
-
<div
|
|
911
|
+
<div
|
|
912
|
+
ref={ref}
|
|
913
|
+
className={cx(
|
|
914
|
+
"flex-1 w-full",
|
|
915
|
+
hasOnTimeRangeSelect && "cursor-crosshair",
|
|
916
|
+
className,
|
|
917
|
+
)}
|
|
918
|
+
{...other}
|
|
919
|
+
>
|
|
711
920
|
<ResponsiveContainer>
|
|
712
921
|
<RechartsLineChart
|
|
713
922
|
data={data}
|
|
714
923
|
syncId={props.syncid?.toString() || ""}
|
|
924
|
+
{...(hasOnTimeRangeSelect
|
|
925
|
+
? {
|
|
926
|
+
onMouseDown: handleRangeSelectMouseDown,
|
|
927
|
+
onMouseMove: handleRangeSelectMouseMove,
|
|
928
|
+
onMouseUp: handleRangeSelectMouseUp,
|
|
929
|
+
}
|
|
930
|
+
: {})}
|
|
715
931
|
onClick={
|
|
716
932
|
hasOnValueChange && (activeLegend || activeDot)
|
|
717
933
|
? () => {
|
|
934
|
+
// Ignore the click that follows a drag-to-select.
|
|
935
|
+
if (suppressNextClickRef.current) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
718
938
|
setActiveDot(undefined);
|
|
719
939
|
setActiveLegend(undefined);
|
|
720
940
|
onValueChange?.(null);
|
|
@@ -755,6 +975,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
755
975
|
transform: "translate(0, 6)",
|
|
756
976
|
fontSize: 10,
|
|
757
977
|
fontWeight: 500,
|
|
978
|
+
fill: "var(--ou-chart-tick)",
|
|
758
979
|
}}
|
|
759
980
|
ticks={
|
|
760
981
|
startEndOnly
|
|
@@ -797,6 +1018,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
797
1018
|
transform: "translate(-4, 0)",
|
|
798
1019
|
fontSize: 10,
|
|
799
1020
|
fontWeight: 500,
|
|
1021
|
+
fill: "var(--ou-chart-tick)",
|
|
800
1022
|
}}
|
|
801
1023
|
fill=""
|
|
802
1024
|
stroke=""
|
|
@@ -822,7 +1044,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
822
1044
|
)}
|
|
823
1045
|
</YAxis>
|
|
824
1046
|
<Tooltip
|
|
825
|
-
wrapperStyle={{ outline: "none" }}
|
|
1047
|
+
wrapperStyle={{ outline: "none", zIndex: 10 }}
|
|
826
1048
|
isAnimationActive={true}
|
|
827
1049
|
animationDuration={100}
|
|
828
1050
|
cursor={{
|
|
@@ -1049,6 +1271,98 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
1049
1271
|
);
|
|
1050
1272
|
},
|
|
1051
1273
|
)}
|
|
1274
|
+
{/* Time-anchored shaded regions (e.g. incident/maintenance windows) */}
|
|
1275
|
+
{formattedReferenceRegions?.map(
|
|
1276
|
+
(region: FormattedReferenceRegion, regionIndex: number) => {
|
|
1277
|
+
const regionColor: string = region.original.color || "#6366f1";
|
|
1278
|
+
return (
|
|
1279
|
+
<ReferenceArea
|
|
1280
|
+
key={`ref-region-${regionIndex}`}
|
|
1281
|
+
x1={region.formattedX1}
|
|
1282
|
+
x2={region.formattedX2}
|
|
1283
|
+
fill={regionColor}
|
|
1284
|
+
fillOpacity={0.12}
|
|
1285
|
+
stroke={regionColor}
|
|
1286
|
+
strokeOpacity={0.35}
|
|
1287
|
+
strokeWidth={1}
|
|
1288
|
+
{...(region.original.onClick
|
|
1289
|
+
? {
|
|
1290
|
+
style: { cursor: "pointer" as const },
|
|
1291
|
+
onClick: (): void => {
|
|
1292
|
+
if (suppressNextClickRef.current) {
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
region.original.onClick?.();
|
|
1296
|
+
},
|
|
1297
|
+
}
|
|
1298
|
+
: {})}
|
|
1299
|
+
>
|
|
1300
|
+
{region.original.label && (
|
|
1301
|
+
<Label
|
|
1302
|
+
value={region.original.label}
|
|
1303
|
+
position="insideTop"
|
|
1304
|
+
fill={regionColor}
|
|
1305
|
+
fontSize={10}
|
|
1306
|
+
fontWeight={500}
|
|
1307
|
+
/>
|
|
1308
|
+
)}
|
|
1309
|
+
</ReferenceArea>
|
|
1310
|
+
);
|
|
1311
|
+
},
|
|
1312
|
+
)}
|
|
1313
|
+
{/* Time-anchored vertical event markers (e.g. deploys, incidents) */}
|
|
1314
|
+
{formattedTimeReferenceLines?.map(
|
|
1315
|
+
(
|
|
1316
|
+
timeRefLine: FormattedTimeReferenceLine,
|
|
1317
|
+
timeRefIndex: number,
|
|
1318
|
+
) => {
|
|
1319
|
+
const lineColor: string =
|
|
1320
|
+
timeRefLine.original.color || "#f59e0b";
|
|
1321
|
+
return (
|
|
1322
|
+
<ReferenceLine
|
|
1323
|
+
key={`time-ref-${timeRefIndex}`}
|
|
1324
|
+
x={timeRefLine.formattedX}
|
|
1325
|
+
stroke={lineColor}
|
|
1326
|
+
strokeDasharray={
|
|
1327
|
+
timeRefLine.original.strokeDasharray || "4 4"
|
|
1328
|
+
}
|
|
1329
|
+
strokeWidth={1.5}
|
|
1330
|
+
{...(timeRefLine.original.onClick
|
|
1331
|
+
? {
|
|
1332
|
+
style: { cursor: "pointer" as const },
|
|
1333
|
+
onClick: (): void => {
|
|
1334
|
+
if (suppressNextClickRef.current) {
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
timeRefLine.original.onClick?.();
|
|
1338
|
+
},
|
|
1339
|
+
}
|
|
1340
|
+
: {})}
|
|
1341
|
+
>
|
|
1342
|
+
{timeRefLine.original.label &&
|
|
1343
|
+
showTimeReferenceLineLabels && (
|
|
1344
|
+
<Label
|
|
1345
|
+
value={timeRefLine.original.label}
|
|
1346
|
+
{...(timeReferenceLineCount > 1
|
|
1347
|
+
? {
|
|
1348
|
+
/*
|
|
1349
|
+
* Several markers: run each label down its
|
|
1350
|
+
* own line so labels at different x stop
|
|
1351
|
+
* sharing one horizontal band.
|
|
1352
|
+
*/
|
|
1353
|
+
position: "insideTopLeft" as const,
|
|
1354
|
+
angle: 90,
|
|
1355
|
+
}
|
|
1356
|
+
: { position: "insideTop" as const })}
|
|
1357
|
+
fill={lineColor}
|
|
1358
|
+
fontSize={10}
|
|
1359
|
+
fontWeight={500}
|
|
1360
|
+
/>
|
|
1361
|
+
)}
|
|
1362
|
+
</ReferenceLine>
|
|
1363
|
+
);
|
|
1364
|
+
},
|
|
1365
|
+
)}
|
|
1052
1366
|
{/* Exemplar dots - clickable markers linking to traces */}
|
|
1053
1367
|
{props.formattedExemplarPoints?.map(
|
|
1054
1368
|
(exemplar: FormattedExemplarPoint, exemplarIndex: number) => {
|
|
@@ -1063,13 +1377,21 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
1063
1377
|
strokeWidth={2}
|
|
1064
1378
|
style={{ cursor: "pointer" }}
|
|
1065
1379
|
onClick={() => {
|
|
1380
|
+
// Ignore the click that follows a drag-to-select.
|
|
1381
|
+
if (suppressNextClickRef.current) {
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1066
1384
|
props.onExemplarClick?.(exemplar.original);
|
|
1067
1385
|
}}
|
|
1068
1386
|
>
|
|
1069
1387
|
<Label
|
|
1070
1388
|
value="E"
|
|
1071
1389
|
position="center"
|
|
1072
|
-
|
|
1390
|
+
/*
|
|
1391
|
+
* Sits on the dot's purple, not on the surface, so it must
|
|
1392
|
+
* not follow the ring token that flips dark with the theme.
|
|
1393
|
+
*/
|
|
1394
|
+
fill="#ffffff"
|
|
1073
1395
|
fontSize={8}
|
|
1074
1396
|
fontWeight={700}
|
|
1075
1397
|
/>
|
|
@@ -1077,6 +1399,17 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
1077
1399
|
);
|
|
1078
1400
|
},
|
|
1079
1401
|
)}
|
|
1402
|
+
{/* Live drag-to-select highlight */}
|
|
1403
|
+
{rangeSelectionStart && rangeSelectionEnd ? (
|
|
1404
|
+
<ReferenceArea
|
|
1405
|
+
x1={rangeSelectionStart}
|
|
1406
|
+
x2={rangeSelectionEnd}
|
|
1407
|
+
fill="rgba(99,102,241,0.12)"
|
|
1408
|
+
stroke="rgba(99,102,241,0.5)"
|
|
1409
|
+
strokeWidth={1}
|
|
1410
|
+
radius={2}
|
|
1411
|
+
/>
|
|
1412
|
+
) : null}
|
|
1080
1413
|
</RechartsLineChart>
|
|
1081
1414
|
</ResponsiveContainer>
|
|
1082
1415
|
</div>
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden per-row field carrying the raw bucket start as ms since epoch.
|
|
3
|
+
* Underscore-prefixed so it cannot collide with real series names, and it
|
|
4
|
+
* is never rendered as a series (only `categories` keys are drawn).
|
|
5
|
+
*/
|
|
6
|
+
export const CHART_DATA_POINT_DATE_KEY: string = "__date";
|
|
7
|
+
|
|
1
8
|
export default interface ChartDataPoint {
|
|
2
9
|
[x: string]: number | string;
|
|
3
10
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import ChartReferenceRegionProps from "../../Types/ReferenceRegionProps";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A time-anchored shaded region whose endpoints have been formatted to
|
|
5
|
+
* (and clamped onto) the chart's categorical x-axis labels. Used
|
|
6
|
+
* internally by chart library components.
|
|
7
|
+
*/
|
|
8
|
+
export default interface FormattedReferenceRegion {
|
|
9
|
+
/** The formatted x-axis label of the region start bucket */
|
|
10
|
+
formattedX1: string;
|
|
11
|
+
/** The formatted x-axis label of the region end bucket */
|
|
12
|
+
formattedX2: string;
|
|
13
|
+
/** The original annotation for label/color/click handling */
|
|
14
|
+
original: ChartReferenceRegionProps;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ChartTimeReferenceLineProps from "../../Types/TimeReferenceLineProps";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A time-anchored vertical reference line whose x value has been formatted
|
|
5
|
+
* to match the chart's categorical x-axis labels. Used internally by chart
|
|
6
|
+
* library components.
|
|
7
|
+
*/
|
|
8
|
+
export default interface FormattedTimeReferenceLine {
|
|
9
|
+
/** The formatted x-axis label (e.g. "12:30", "22 Feb") */
|
|
10
|
+
formattedX: string;
|
|
11
|
+
/** The original annotation for label/color/click handling */
|
|
12
|
+
original: ChartTimeReferenceLineProps;
|
|
13
|
+
}
|
|
@@ -15,8 +15,13 @@ import YAxis from "../Types/YAxis/YAxis";
|
|
|
15
15
|
import ChartCurve from "../Types/ChartCurve";
|
|
16
16
|
import ChartDataPoint from "../ChartLibrary/Types/ChartDataPoint";
|
|
17
17
|
import FormattedExemplarPoint from "../ChartLibrary/Types/FormattedExemplarPoint";
|
|
18
|
+
import FormattedReferenceRegion from "../ChartLibrary/Types/FormattedReferenceRegion";
|
|
19
|
+
import FormattedTimeReferenceLine from "../ChartLibrary/Types/FormattedTimeReferenceLine";
|
|
18
20
|
import DataPointUtil from "../Utils/DataPoint";
|
|
21
|
+
import TimeAnnotationUtil from "../Utils/TimeAnnotation";
|
|
19
22
|
import ChartReferenceLineProps from "../Types/ReferenceLineProps";
|
|
23
|
+
import ChartReferenceRegionProps from "../Types/ReferenceRegionProps";
|
|
24
|
+
import ChartTimeReferenceLineProps from "../Types/TimeReferenceLineProps";
|
|
20
25
|
import ExemplarPoint from "../Types/ExemplarPoint";
|
|
21
26
|
import XAxisUtil from "../Utils/XAxis";
|
|
22
27
|
import NoDataMessage from "../ChartGroup/NoDataMessage";
|
|
@@ -41,8 +46,20 @@ export interface ComponentProps {
|
|
|
41
46
|
sync: boolean;
|
|
42
47
|
heightInPx?: number | undefined;
|
|
43
48
|
referenceLines?: Array<ChartReferenceLineProps> | undefined;
|
|
49
|
+
/*
|
|
50
|
+
* Time-anchored annotations: vertical event markers and shaded regions.
|
|
51
|
+
* Dates are snapped onto the categorical x-axis buckets; annotations
|
|
52
|
+
* outside the charted window are dropped (regions clamp to the edge).
|
|
53
|
+
*/
|
|
54
|
+
timeReferenceLines?: Array<ChartTimeReferenceLineProps> | undefined;
|
|
55
|
+
referenceRegions?: Array<ChartReferenceRegionProps> | undefined;
|
|
44
56
|
exemplarPoints?: Array<ExemplarPoint> | undefined;
|
|
45
57
|
onExemplarClick?: ((exemplar: ExemplarPoint) => void) | undefined;
|
|
58
|
+
/*
|
|
59
|
+
* When provided, the chart supports drag-to-select: dragging across
|
|
60
|
+
* buckets calls back with the [start, end) of the selected time range.
|
|
61
|
+
*/
|
|
62
|
+
onTimeRangeSelect?: ((startTime: Date, endTime: Date) => void) | undefined;
|
|
46
63
|
showLegend?: boolean | undefined;
|
|
47
64
|
/*
|
|
48
65
|
* Optional per-series color override (named palette keys or hex strings).
|
|
@@ -95,6 +112,29 @@ const LineChartElement: FunctionComponent<LineInternalProps> = (
|
|
|
95
112
|
});
|
|
96
113
|
}, [props.exemplarPoints, props.xAxis]);
|
|
97
114
|
|
|
115
|
+
// Snap time annotations onto the categorical x-axis bucket labels
|
|
116
|
+
const formattedTimeReferenceLines: Array<FormattedTimeReferenceLine> =
|
|
117
|
+
useMemo(() => {
|
|
118
|
+
if (!props.timeReferenceLines || props.timeReferenceLines.length === 0) {
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
return TimeAnnotationUtil.formatTimeReferenceLines({
|
|
122
|
+
timeReferenceLines: props.timeReferenceLines,
|
|
123
|
+
xAxis: props.xAxis,
|
|
124
|
+
});
|
|
125
|
+
}, [props.timeReferenceLines, props.xAxis]);
|
|
126
|
+
|
|
127
|
+
const formattedReferenceRegions: Array<FormattedReferenceRegion> =
|
|
128
|
+
useMemo(() => {
|
|
129
|
+
if (!props.referenceRegions || props.referenceRegions.length === 0) {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
return TimeAnnotationUtil.formatReferenceRegions({
|
|
133
|
+
referenceRegions: props.referenceRegions,
|
|
134
|
+
xAxis: props.xAxis,
|
|
135
|
+
});
|
|
136
|
+
}, [props.referenceRegions, props.xAxis]);
|
|
137
|
+
|
|
98
138
|
const hasNoData: boolean =
|
|
99
139
|
!props.data ||
|
|
100
140
|
props.data.length === 0 ||
|
|
@@ -144,10 +184,21 @@ const LineChartElement: FunctionComponent<LineInternalProps> = (
|
|
|
144
184
|
{...maxValueProp}
|
|
145
185
|
onValueChange={() => {}}
|
|
146
186
|
referenceLines={props.referenceLines}
|
|
187
|
+
formattedTimeReferenceLines={
|
|
188
|
+
formattedTimeReferenceLines.length > 0
|
|
189
|
+
? formattedTimeReferenceLines
|
|
190
|
+
: undefined
|
|
191
|
+
}
|
|
192
|
+
formattedReferenceRegions={
|
|
193
|
+
formattedReferenceRegions.length > 0
|
|
194
|
+
? formattedReferenceRegions
|
|
195
|
+
: undefined
|
|
196
|
+
}
|
|
147
197
|
formattedExemplarPoints={
|
|
148
198
|
formattedExemplars.length > 0 ? formattedExemplars : undefined
|
|
149
199
|
}
|
|
150
200
|
onExemplarClick={props.onExemplarClick}
|
|
201
|
+
onTimeRangeSelect={props.onTimeRangeSelect}
|
|
151
202
|
/>
|
|
152
203
|
{hasNoData && <NoDataMessage />}
|
|
153
204
|
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A time-anchored shaded region (e.g. an incident or maintenance window).
|
|
3
|
+
* Endpoints are clamped to the nearest in-window x-axis buckets, so a
|
|
4
|
+
* region overlapping the window edge is trimmed rather than dropped.
|
|
5
|
+
*/
|
|
6
|
+
export default interface ChartReferenceRegionProps {
|
|
7
|
+
startDate: Date;
|
|
8
|
+
endDate: Date;
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
color?: string | undefined; // CSS color, e.g. "#6366f1" or "red"
|
|
11
|
+
onClick?: (() => void) | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A time-anchored vertical event marker (e.g. a deploy or an incident
|
|
3
|
+
* start). The date is snapped to the chart's categorical x-axis buckets
|
|
4
|
+
* before rendering.
|
|
5
|
+
*/
|
|
6
|
+
export default interface ChartTimeReferenceLineProps {
|
|
7
|
+
date: Date;
|
|
8
|
+
label?: string | undefined;
|
|
9
|
+
color?: string | undefined; // CSS color, e.g. "#f59e0b" or "red"
|
|
10
|
+
strokeDasharray?: string | undefined; // e.g. "4 4" for dashed
|
|
11
|
+
onClick?: (() => void) | undefined;
|
|
12
|
+
}
|
|
Binary file
|