@oneuptime/common 11.5.9 → 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/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 +113 -0
- package/Models/DatabaseModels/NetworkInterface.ts +58 -0
- package/Models/DatabaseModels/Project.ts +37 -0
- package/Models/DatabaseModels/User.ts +37 -0
- package/Server/API/BaseAnalyticsAPI.ts +23 -0
- package/Server/API/EnterpriseLicenseAPI.ts +14 -0
- package/Server/EnvironmentConfig.ts +84 -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/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 +12 -0
- package/Server/Services/AnalyticsDatabaseService.ts +70 -1
- package/Server/Services/IncidentService.ts +13 -0
- package/Server/Services/Index.ts +10 -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 +136 -0
- package/Server/Services/SpanService.ts +13 -9
- package/Server/Services/StatusPageService.ts +10 -0
- package/Server/Services/TeamMemberService.ts +11 -0
- package/Server/Services/UserService.ts +59 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +37 -7
- package/Server/Utils/Attribution.ts +99 -0
- 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 +15 -0
- 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/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/Utils/Monitor/MonitorTemplateUtilNetworkDevice.test.ts +389 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +764 -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/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/XAxis.test.ts +5 -3
- 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/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/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/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 +328 -1
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +115 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +328 -1
- 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/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 +10 -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/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 +116 -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 +38 -0
- package/build/dist/Models/DatabaseModels/Project.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/BaseAnalyticsAPI.js +19 -0
- package/build/dist/Server/API/BaseAnalyticsAPI.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/EnvironmentConfig.js +51 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- 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/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 +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.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/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 +107 -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 +10 -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/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/Utils/Attribution.js +74 -0
- package/build/dist/Server/Utils/Attribution.js.map +1 -0
- 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 +15 -0
- 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/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/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/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 +208 -6
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +52 -3
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +208 -6
- 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/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/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 +2 -2
|
@@ -2,6 +2,7 @@ import { AreaChart } from "../ChartLibrary/AreaChart/AreaChart";
|
|
|
2
2
|
import React, { useEffect, useMemo, } from "react";
|
|
3
3
|
import ChartCurve from "../Types/ChartCurve";
|
|
4
4
|
import DataPointUtil from "../Utils/DataPoint";
|
|
5
|
+
import TimeAnnotationUtil from "../Utils/TimeAnnotation";
|
|
5
6
|
import XAxisUtil from "../Utils/XAxis";
|
|
6
7
|
import NoDataMessage from "../ChartGroup/NoDataMessage";
|
|
7
8
|
export const AreaChartPalette = [
|
|
@@ -57,6 +58,25 @@ const AreaChartElement = (props) => {
|
|
|
57
58
|
};
|
|
58
59
|
});
|
|
59
60
|
}, [props.exemplarPoints, props.xAxis]);
|
|
61
|
+
// Snap time annotations onto the categorical x-axis bucket labels
|
|
62
|
+
const formattedTimeReferenceLines = useMemo(() => {
|
|
63
|
+
if (!props.timeReferenceLines || props.timeReferenceLines.length === 0) {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
return TimeAnnotationUtil.formatTimeReferenceLines({
|
|
67
|
+
timeReferenceLines: props.timeReferenceLines,
|
|
68
|
+
xAxis: props.xAxis,
|
|
69
|
+
});
|
|
70
|
+
}, [props.timeReferenceLines, props.xAxis]);
|
|
71
|
+
const formattedReferenceRegions = useMemo(() => {
|
|
72
|
+
if (!props.referenceRegions || props.referenceRegions.length === 0) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
return TimeAnnotationUtil.formatReferenceRegions({
|
|
76
|
+
referenceRegions: props.referenceRegions,
|
|
77
|
+
xAxis: props.xAxis,
|
|
78
|
+
});
|
|
79
|
+
}, [props.referenceRegions, props.xAxis]);
|
|
60
80
|
const hasNoData = !props.data ||
|
|
61
81
|
props.data.length === 0 ||
|
|
62
82
|
props.data.every((series) => {
|
|
@@ -75,7 +95,11 @@ const AreaChartElement = (props) => {
|
|
|
75
95
|
return (React.createElement("div", { className: "relative flex flex-1", style: props.heightInPx ? { height: `${props.heightInPx}px` } : undefined },
|
|
76
96
|
React.createElement(AreaChart, Object.assign({ data: records, tickGap: 30, index: "Time", categories: categories, colors: props.colors && props.colors.length > 0
|
|
77
97
|
? props.colors
|
|
78
|
-
: AreaChartPalette, valueFormatter: props.yAxis.options.formatter || undefined, showTooltip: true, showLegend: props.showLegend !== false, connectNulls: true, curve: props.curve || ChartCurve.MONOTONE, syncid: props.sync ? props.syncid : undefined, yAxisWidth: 64, autoMinValue: autoMinValue }, minValueProp, maxValueProp, { onValueChange: () => { }, referenceLines: props.referenceLines,
|
|
98
|
+
: AreaChartPalette, valueFormatter: props.yAxis.options.formatter || undefined, showTooltip: true, showLegend: props.showLegend !== false, connectNulls: true, curve: props.curve || ChartCurve.MONOTONE, syncid: props.sync ? props.syncid : undefined, yAxisWidth: 64, autoMinValue: autoMinValue }, minValueProp, maxValueProp, { onValueChange: () => { }, referenceLines: props.referenceLines, formattedTimeReferenceLines: formattedTimeReferenceLines.length > 0
|
|
99
|
+
? formattedTimeReferenceLines
|
|
100
|
+
: undefined, formattedReferenceRegions: formattedReferenceRegions.length > 0
|
|
101
|
+
? formattedReferenceRegions
|
|
102
|
+
: undefined, formattedExemplarPoints: formattedExemplars.length > 0 ? formattedExemplars : undefined, onExemplarClick: props.onExemplarClick, onTimeRangeSelect: props.onTimeRangeSelect, anomalyBandLowerKey: bandLower, anomalyBandUpperKey: bandUpper })),
|
|
79
103
|
hasNoData && React.createElement(NoDataMessage, null)));
|
|
80
104
|
};
|
|
81
105
|
export default AreaChartElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.js","sourceRoot":"","sources":["../../../../../../UI/Components/Charts/Area/AreaChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAKhE,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,OAAO,GACR,MAAM,OAAO,CAAC;AAIf,OAAO,UAAU,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"AreaChart.js","sourceRoot":"","sources":["../../../../../../UI/Components/Charts/Area/AreaChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAKhE,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,OAAO,GACR,MAAM,OAAO,CAAC;AAIf,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAK7C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAKzD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAoC;IAC/D,MAAM;IACN,SAAS;IACT,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,QAAQ;IACR,MAAM;CACP,CAAC;AA8CF,MAAM,gBAAgB,GAAyC,CAC7D,KAAwB,EACV,EAAE;IAChB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAwB,EAAE,CAAC,CAAC;IAExE,MAAM,SAAS,GAAuB,KAAK,CAAC,0BAA0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UAAU,EAAE,EAAE,EACd,YAAY,EAAE,YAAY,IACtB,YAAY,EACZ,YAAY,IAChB,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC,EACvB,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,2BAA2B,EACzB,2BAA2B,CAAC,MAAM,GAAG,CAAC;gBACpC,CAAC,CAAC,2BAA2B;gBAC7B,CAAC,CAAC,SAAS,EAEf,yBAAyB,EACvB,yBAAyB,CAAC,MAAM,GAAG,CAAC;gBAClC,CAAC,CAAC,yBAAyB;gBAC3B,CAAC,CAAC,SAAS,EAEf,uBAAuB,EACrB,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,EAEhE,eAAe,EAAE,KAAK,CAAC,eAAe,EACtC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,mBAAmB,EAAE,SAAS,EAC9B,mBAAmB,EAAE,SAAS,IAC9B;QACD,SAAS,IAAI,oBAAC,aAAa,OAAG,CAC3B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BarChart } from "../ChartLibrary/BarChart/BarChart";
|
|
2
|
-
import React, { useEffect } from "react";
|
|
2
|
+
import React, { useEffect, useMemo, } from "react";
|
|
3
3
|
import DataPointUtil from "../Utils/DataPoint";
|
|
4
|
+
import TimeAnnotationUtil from "../Utils/TimeAnnotation";
|
|
4
5
|
import NoDataMessage from "../ChartGroup/NoDataMessage";
|
|
5
6
|
export const BarChartPalette = [
|
|
6
7
|
"indigo",
|
|
@@ -26,6 +27,25 @@ const BarChartElement = (props) => {
|
|
|
26
27
|
});
|
|
27
28
|
setRecords(records);
|
|
28
29
|
}, [props.data]);
|
|
30
|
+
// Snap time annotations onto the categorical x-axis bucket labels
|
|
31
|
+
const formattedTimeReferenceLines = useMemo(() => {
|
|
32
|
+
if (!props.timeReferenceLines || props.timeReferenceLines.length === 0) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
return TimeAnnotationUtil.formatTimeReferenceLines({
|
|
36
|
+
timeReferenceLines: props.timeReferenceLines,
|
|
37
|
+
xAxis: props.xAxis,
|
|
38
|
+
});
|
|
39
|
+
}, [props.timeReferenceLines, props.xAxis]);
|
|
40
|
+
const formattedReferenceRegions = useMemo(() => {
|
|
41
|
+
if (!props.referenceRegions || props.referenceRegions.length === 0) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
return TimeAnnotationUtil.formatReferenceRegions({
|
|
45
|
+
referenceRegions: props.referenceRegions,
|
|
46
|
+
xAxis: props.xAxis,
|
|
47
|
+
});
|
|
48
|
+
}, [props.referenceRegions, props.xAxis]);
|
|
29
49
|
const hasNoData = !props.data ||
|
|
30
50
|
props.data.length === 0 ||
|
|
31
51
|
props.data.every((series) => {
|
|
@@ -34,7 +54,11 @@ const BarChartElement = (props) => {
|
|
|
34
54
|
return (React.createElement("div", { className: "relative flex flex-1", style: props.heightInPx ? { height: `${props.heightInPx}px` } : undefined },
|
|
35
55
|
React.createElement(BarChart, { data: records, tickGap: 30, index: "Time", categories: categories, colors: props.colors && props.colors.length > 0
|
|
36
56
|
? props.colors
|
|
37
|
-
: BarChartPalette, valueFormatter: props.yAxis.options.formatter || undefined, showTooltip: true, showLegend: props.showLegend !== false, yAxisWidth: 64, syncid: props.sync ? props.syncid : undefined, onValueChange: () => { }, referenceLines: props.referenceLines
|
|
57
|
+
: BarChartPalette, valueFormatter: props.yAxis.options.formatter || undefined, showTooltip: true, showLegend: props.showLegend !== false, yAxisWidth: 64, syncid: props.sync ? props.syncid : undefined, onValueChange: () => { }, referenceLines: props.referenceLines, formattedTimeReferenceLines: formattedTimeReferenceLines.length > 0
|
|
58
|
+
? formattedTimeReferenceLines
|
|
59
|
+
: undefined, formattedReferenceRegions: formattedReferenceRegions.length > 0
|
|
60
|
+
? formattedReferenceRegions
|
|
61
|
+
: undefined }),
|
|
38
62
|
hasNoData && React.createElement(NoDataMessage, null)));
|
|
39
63
|
};
|
|
40
64
|
export default BarChartElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.js","sourceRoot":"","sources":["../../../../../../UI/Components/Charts/Bar/BarChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAK7D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BarChart.js","sourceRoot":"","sources":["../../../../../../UI/Components/Charts/Bar/BarChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAK7D,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,OAAO,GACR,MAAM,OAAO,CAAC;AAOf,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAIzD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC9D,QAAQ;IACR,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;CACV,CAAC;AA8BF,MAAM,eAAe,GAAwC,CAC3D,KAAuB,EACT,EAAE;IAChB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAwB,EAAE,CAAC,CAAC;IAExE,MAAM,UAAU,GAAkB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAiB,EAAE,EAAE;QACrE,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAA0B,aAAa,CAAC,kBAAkB,CAAC;YACtE,YAAY,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE;YAC9B,KAAK,EAAE,KAAK,CAAC,KAAK;YACl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L,OAAO,CACL,6BACE,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;QAEzE,oBAAC,QAAQ,IACP,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,EAAE,EACX,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,UAAU,EACtB,MAAM,EACJ,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBACrC,CAAC,CAAC,KAAK,CAAC,MAAM;gBACd,CAAC,CAAC,eAAe,EAErB,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,IAAI,SAAS,EAC1D,WAAW,EAAE,IAAI,EACjB,UAAU,EAAE,KAAK,CAAC,UAAU,KAAK,KAAK,EACtC,UAAU,EAAE,EAAE,EACd,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC7C,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC,EACvB,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,2BAA2B,EACzB,2BAA2B,CAAC,MAAM,GAAG,CAAC;gBACpC,CAAC,CAAC,2BAA2B;gBAC7B,CAAC,CAAC,SAAS,EAEf,yBAAyB,EACvB,yBAAyB,CAAC,MAAM,GAAG,CAAC;gBAClC,CAAC,CAAC,yBAAyB;gBAC3B,CAAC,CAAC,SAAS,GAEf;QACD,SAAS,IAAI,oBAAC,aAAa,OAAG,CAC3B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -34,15 +34,34 @@ const ChartGroup = (props) => {
|
|
|
34
34
|
return React.createElement(React.Fragment, null);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
// Same subtle hint the log/telemetry histograms show for drag-to-zoom.
|
|
38
|
+
const getDragToZoomHint = (chart) => {
|
|
39
|
+
const supportsTimeRangeSelect = (chart.type === ChartType.LINE || chart.type === ChartType.AREA) &&
|
|
40
|
+
Boolean(chart.props.onTimeRangeSelect);
|
|
41
|
+
if (!supportsTimeRangeSelect) {
|
|
42
|
+
return React.createElement(React.Fragment, null);
|
|
43
|
+
}
|
|
44
|
+
return (React.createElement("span", { className: "ml-auto shrink-0 whitespace-nowrap text-[10px] text-gray-400" }, "Drag to zoom"));
|
|
45
|
+
};
|
|
37
46
|
const getInfoIcon = (chart) => {
|
|
38
47
|
if (!chart.metricInfo) {
|
|
39
48
|
return React.createElement(React.Fragment, null);
|
|
40
49
|
}
|
|
41
|
-
return (React.createElement("button", { type: "button", className: "ml-1.5 inline-flex items-center justify-center rounded-full w-5 h-5 text-gray-
|
|
50
|
+
return (React.createElement("button", { type: "button", className: "ml-1.5 inline-flex items-center justify-center rounded-full w-5 h-5 text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-all duration-150", title: "View metric details", onClick: () => {
|
|
42
51
|
setMetricInfoModalChart(chart.metricInfo || null);
|
|
43
52
|
} },
|
|
44
53
|
React.createElement(Icon, { icon: IconProp.InformationCircle, size: SizeProp.Smaller, className: "h-3.5 w-3.5" })));
|
|
45
54
|
};
|
|
55
|
+
const getExplorerIcon = (chart) => {
|
|
56
|
+
if (!chart.onOpenInExplorer) {
|
|
57
|
+
return React.createElement(React.Fragment, null);
|
|
58
|
+
}
|
|
59
|
+
return (React.createElement("button", { type: "button", className: "ml-1.5 inline-flex items-center justify-center rounded-full w-5 h-5 text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-all duration-150", title: "Open in Metric Explorer", onClick: () => {
|
|
60
|
+
var _a;
|
|
61
|
+
(_a = chart.onOpenInExplorer) === null || _a === void 0 ? void 0 : _a.call(chart);
|
|
62
|
+
} },
|
|
63
|
+
React.createElement(Icon, { icon: IconProp.ExternalLink, size: SizeProp.Smaller, className: "h-3.5 w-3.5" })));
|
|
64
|
+
};
|
|
46
65
|
const renderMetricInfoModal = () => {
|
|
47
66
|
if (!metricInfoModalChart) {
|
|
48
67
|
return React.createElement(React.Fragment, null);
|
|
@@ -98,25 +117,30 @@ const ChartGroup = (props) => {
|
|
|
98
117
|
React.createElement("div", { className: "px-5 pt-4 pb-4 flex flex-col flex-1" },
|
|
99
118
|
React.createElement("div", { className: "mb-3 pb-3 border-b border-gray-100" },
|
|
100
119
|
React.createElement("div", { className: "flex items-center" },
|
|
101
|
-
React.createElement("h3", { className: "text-sm font-semibold text-gray-800 tracking-tight" }, chart.title),
|
|
102
|
-
getInfoIcon(chart)
|
|
120
|
+
React.createElement("h3", { className: "min-w-0 truncate text-sm font-semibold text-gray-800 tracking-tight", title: chart.title }, chart.title),
|
|
121
|
+
getInfoIcon(chart),
|
|
122
|
+
getExplorerIcon(chart),
|
|
123
|
+
getDragToZoomHint(chart)),
|
|
103
124
|
chart.description && (React.createElement("p", { className: "mt-1 text-xs text-gray-500 hidden md:block" }, chart.description))),
|
|
104
125
|
getChartContent(chart, index),
|
|
105
|
-
chart.seriesControls ? (React.createElement("div", { className: "
|
|
126
|
+
chart.seriesControls ? (React.createElement("div", { className: "mt-3" }, chart.seriesControls)) : null)));
|
|
106
127
|
}))));
|
|
107
128
|
}
|
|
108
129
|
// When showing cards, use the grid layout
|
|
109
130
|
const gridCols = props.charts.length > 1 ? "lg:grid-cols-2" : "lg:grid-cols-1";
|
|
110
131
|
return (React.createElement(React.Fragment, null,
|
|
111
132
|
renderMetricInfoModal(),
|
|
112
|
-
React.createElement("div", { className: `grid grid-cols-1 ${gridCols} gap-4
|
|
113
|
-
return (React.createElement("div", { key: index, className: `
|
|
114
|
-
React.createElement("div", { className: "
|
|
115
|
-
React.createElement("
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
133
|
+
React.createElement("div", { className: `grid grid-cols-1 ${gridCols} gap-4` }, props.charts.map((chart, index) => {
|
|
134
|
+
return (React.createElement("div", { key: index, className: `flex flex-col rounded-lg border border-gray-200 bg-white shadow-sm ${props.chartCssClass || ""}` },
|
|
135
|
+
React.createElement("div", { className: "border-b border-gray-100 px-4 py-2.5" },
|
|
136
|
+
React.createElement("div", { className: "flex items-center" },
|
|
137
|
+
React.createElement("h2", { "data-testid": "card-details-heading", id: "card-details-heading", className: "min-w-0 truncate text-sm font-semibold leading-6 text-gray-900", title: chart.title }, chart.title),
|
|
138
|
+
getInfoIcon(chart),
|
|
139
|
+
getExplorerIcon(chart),
|
|
140
|
+
getDragToZoomHint(chart)),
|
|
141
|
+
chart.description && (React.createElement("p", { "data-testid": "card-description", className: "mt-0.5 w-full truncate text-xs text-gray-500 hidden md:block", title: chart.description }, chart.description))),
|
|
142
|
+
React.createElement("div", { className: "flex-1 flex flex-col min-h-80 px-4 pt-3 pb-2" }, getChartContent(chart, index)),
|
|
143
|
+
chart.seriesControls ? (React.createElement("div", { className: "border-t border-gray-100 px-4 py-3" }, chart.seriesControls)) : null));
|
|
120
144
|
}))));
|
|
121
145
|
};
|
|
122
146
|
export default ChartGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartGroup.js","sourceRoot":"","sources":["../../../../../../UI/Components/Charts/ChartGroup/ChartGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAE1C,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,SAA+C,MAAM,mBAAmB,CAAC;AAChF,OAAO,eAEN,MAAM,iBAAiB,CAAC;AACzB,OAAO,gBAEN,MAAM,mBAAmB,CAAC;AAE3B,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,EAAmC,QAAQ,EAAE,MAAM,OAAO,C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IAAI,CACJ,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -13,13 +13,22 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
};
|
|
14
14
|
import React from "react";
|
|
15
15
|
import { RiArrowLeftSLine, RiArrowRightSLine } from "@remixicon/react";
|
|
16
|
-
import { Area, AreaChart as RechartsAreaChart, CartesianGrid, Dot, Label, Legend as RechartsLegend, ReferenceDot, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
|
|
16
|
+
import { Area, AreaChart as RechartsAreaChart, CartesianGrid, Dot, Label, Legend as RechartsLegend, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
|
|
17
|
+
import { CHART_DATA_POINT_DATE_KEY } from "../Types/ChartDataPoint";
|
|
17
18
|
import { useOnWindowResize } from "../Utils/UseWindowOnResize";
|
|
18
19
|
import { AvailableChartColors, constructCategoryColors, getColorClassName, getColorHex, isHexColorValue, } from "../Utils/ChartColors";
|
|
19
20
|
import { cx } from "../Utils/Cx";
|
|
20
21
|
import { getYAxisDomain } from "../Utils/GetYAxisDomain";
|
|
21
22
|
import { hasOnlyOneValueForKey } from "../Utils/HasOnlyOneValueForKey";
|
|
22
23
|
import ChartCurve from "../../Types/ChartCurve";
|
|
24
|
+
/*
|
|
25
|
+
* Incident/alert time markers each label at the same "insideTop" band, so
|
|
26
|
+
* several events in one window pile their labels into an unreadable stack.
|
|
27
|
+
* A single marker keeps the classic horizontal top label; a handful get
|
|
28
|
+
* rotated to run along their lines; past this cap inline labels are hidden
|
|
29
|
+
* entirely (the dashed lines and their click-through remain).
|
|
30
|
+
*/
|
|
31
|
+
const MAX_LABELED_TIME_REFERENCE_LINES = 6;
|
|
23
32
|
const LegendItem = ({ name, color, onClick, activeLegend, }) => {
|
|
24
33
|
const hasOnValueChange = Boolean(onClick);
|
|
25
34
|
return (React.createElement("li", { className: cx("group inline-flex flex-nowrap items-center gap-1.5 whitespace-nowrap rounded px-2 py-1 transition", hasOnValueChange
|
|
@@ -221,13 +230,22 @@ const AreaChart = React.forwardRef((props, ref) => {
|
|
|
221
230
|
var _a, _b, _c;
|
|
222
231
|
const { data = [], categories = [], index, colors = AvailableChartColors, valueFormatter = (value) => {
|
|
223
232
|
return value.toString();
|
|
224
|
-
}, startEndOnly = false, showXAxis = true, showYAxis = true, showGridLines = true, yAxisWidth = 56, intervalType = "equidistantPreserveStart", showTooltip = true, showLegend = true, autoMinValue = false, minValue, maxValue, allowDecimals = true, connectNulls = false, className, onValueChange, enableLegendSlider = false, tickGap = 5, xAxisLabel, yAxisLabel, legendPosition = "right", tooltipCallback, customTooltip } = props, other = __rest(props, ["data", "categories", "index", "colors", "valueFormatter", "startEndOnly", "showXAxis", "showYAxis", "showGridLines", "yAxisWidth", "intervalType", "showTooltip", "showLegend", "autoMinValue", "minValue", "maxValue", "allowDecimals", "connectNulls", "className", "onValueChange", "enableLegendSlider", "tickGap", "xAxisLabel", "yAxisLabel", "legendPosition", "tooltipCallback", "customTooltip"]);
|
|
233
|
+
}, startEndOnly = false, showXAxis = true, showYAxis = true, showGridLines = true, yAxisWidth = 56, intervalType = "equidistantPreserveStart", showTooltip = true, showLegend = true, autoMinValue = false, minValue, maxValue, allowDecimals = true, connectNulls = false, className, onValueChange, enableLegendSlider = false, tickGap = 5, xAxisLabel, yAxisLabel, legendPosition = "right", tooltipCallback, customTooltip, formattedTimeReferenceLines, formattedReferenceRegions, onTimeRangeSelect } = props, other = __rest(props, ["data", "categories", "index", "colors", "valueFormatter", "startEndOnly", "showXAxis", "showYAxis", "showGridLines", "yAxisWidth", "intervalType", "showTooltip", "showLegend", "autoMinValue", "minValue", "maxValue", "allowDecimals", "connectNulls", "className", "onValueChange", "enableLegendSlider", "tickGap", "xAxisLabel", "yAxisLabel", "legendPosition", "tooltipCallback", "customTooltip", "formattedTimeReferenceLines", "formattedReferenceRegions", "onTimeRangeSelect"]);
|
|
225
234
|
const CustomTooltip = customTooltip;
|
|
226
235
|
const paddingValue = (!showXAxis && !showYAxis) || (startEndOnly && !showYAxis) ? 0 : 20;
|
|
227
236
|
const [legendHeight, setLegendHeight] = React.useState(60);
|
|
228
237
|
const [activeDot, setActiveDot] = React.useState(undefined);
|
|
229
238
|
const [activeLegend, setActiveLegend] = React.useState(undefined);
|
|
239
|
+
const hasOnTimeRangeSelect = Boolean(onTimeRangeSelect);
|
|
240
|
+
const [rangeSelectionStart, setRangeSelectionStart] = React.useState(null);
|
|
241
|
+
const [rangeSelectionEnd, setRangeSelectionEnd] = React.useState(null);
|
|
242
|
+
const isRangeSelecting = React.useRef(false);
|
|
243
|
+
const rangeSelectionStartIndexRef = React.useRef(null);
|
|
244
|
+
const rangeSelectionEndIndexRef = React.useRef(null);
|
|
245
|
+
const suppressNextClickRef = React.useRef(false);
|
|
230
246
|
const categoryColors = constructCategoryColors(categories, colors);
|
|
247
|
+
const timeReferenceLineCount = (formattedTimeReferenceLines === null || formattedTimeReferenceLines === void 0 ? void 0 : formattedTimeReferenceLines.length) || 0;
|
|
248
|
+
const showTimeReferenceLineLabels = timeReferenceLineCount <= MAX_LABELED_TIME_REFERENCE_LINES;
|
|
231
249
|
const yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
|
|
232
250
|
const hasOnValueChange = Boolean(onValueChange);
|
|
233
251
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -236,6 +254,10 @@ const AreaChart = React.forwardRef((props, ref) => {
|
|
|
236
254
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
237
255
|
function onDotClick(itemData, event) {
|
|
238
256
|
event.stopPropagation();
|
|
257
|
+
// Ignore the click that immediately follows a drag-to-select.
|
|
258
|
+
if (suppressNextClickRef.current) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
239
261
|
if (!hasOnValueChange) {
|
|
240
262
|
return;
|
|
241
263
|
}
|
|
@@ -258,6 +280,10 @@ const AreaChart = React.forwardRef((props, ref) => {
|
|
|
258
280
|
}
|
|
259
281
|
}
|
|
260
282
|
function onCategoryClick(dataKey) {
|
|
283
|
+
// Ignore the click that immediately follows a drag-to-select.
|
|
284
|
+
if (suppressNextClickRef.current) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
261
287
|
if (!hasOnValueChange) {
|
|
262
288
|
return;
|
|
263
289
|
}
|
|
@@ -277,10 +303,140 @@ const AreaChart = React.forwardRef((props, ref) => {
|
|
|
277
303
|
}
|
|
278
304
|
setActiveDot(undefined);
|
|
279
305
|
}
|
|
280
|
-
|
|
306
|
+
function getRowIndexFromChartState(chartState) {
|
|
307
|
+
const activeTooltipIndex = chartState.activeTooltipIndex;
|
|
308
|
+
const numericIndex = typeof activeTooltipIndex === "number"
|
|
309
|
+
? activeTooltipIndex
|
|
310
|
+
: Number(activeTooltipIndex);
|
|
311
|
+
if (activeTooltipIndex !== undefined &&
|
|
312
|
+
activeTooltipIndex !== null &&
|
|
313
|
+
Number.isInteger(numericIndex) &&
|
|
314
|
+
numericIndex >= 0 &&
|
|
315
|
+
numericIndex < data.length) {
|
|
316
|
+
return numericIndex;
|
|
317
|
+
}
|
|
318
|
+
// Fall back to matching activeLabel against the row labels.
|
|
319
|
+
if (chartState.activeLabel !== undefined) {
|
|
320
|
+
const rowIndex = data.findIndex((row) => {
|
|
321
|
+
return row[index] === chartState.activeLabel;
|
|
322
|
+
});
|
|
323
|
+
return rowIndex >= 0 ? rowIndex : null;
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
function getBucketDateAtIndex(rowIndex) {
|
|
328
|
+
var _a;
|
|
329
|
+
const rawDate = (_a = data[rowIndex]) === null || _a === void 0 ? void 0 : _a[CHART_DATA_POINT_DATE_KEY];
|
|
330
|
+
return typeof rawDate === "number" ? new Date(rawDate) : null;
|
|
331
|
+
}
|
|
332
|
+
function handleRangeSelectMouseDown(chartState) {
|
|
333
|
+
var _a;
|
|
334
|
+
if (!hasOnTimeRangeSelect) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const rowIndex = getRowIndexFromChartState(chartState);
|
|
338
|
+
if (rowIndex === null) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const rowLabel = (_a = data[rowIndex]) === null || _a === void 0 ? void 0 : _a[index];
|
|
342
|
+
if (typeof rowLabel !== "string") {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
isRangeSelecting.current = true;
|
|
346
|
+
rangeSelectionStartIndexRef.current = rowIndex;
|
|
347
|
+
rangeSelectionEndIndexRef.current = rowIndex;
|
|
348
|
+
setRangeSelectionStart(rowLabel);
|
|
349
|
+
setRangeSelectionEnd(null);
|
|
350
|
+
}
|
|
351
|
+
function handleRangeSelectMouseMove(chartState, mouseEvent) {
|
|
352
|
+
var _a;
|
|
353
|
+
if (!isRangeSelecting.current) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
// Button was released outside the chart — abandon the selection.
|
|
357
|
+
if (mouseEvent.buttons === 0) {
|
|
358
|
+
isRangeSelecting.current = false;
|
|
359
|
+
rangeSelectionStartIndexRef.current = null;
|
|
360
|
+
rangeSelectionEndIndexRef.current = null;
|
|
361
|
+
setRangeSelectionStart(null);
|
|
362
|
+
setRangeSelectionEnd(null);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
const rowIndex = getRowIndexFromChartState(chartState);
|
|
366
|
+
if (rowIndex === null) {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const rowLabel = (_a = data[rowIndex]) === null || _a === void 0 ? void 0 : _a[index];
|
|
370
|
+
if (typeof rowLabel !== "string") {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
rangeSelectionEndIndexRef.current = rowIndex;
|
|
374
|
+
setRangeSelectionEnd(rowLabel);
|
|
375
|
+
}
|
|
376
|
+
function handleRangeSelectMouseUp() {
|
|
377
|
+
if (!isRangeSelecting.current) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
isRangeSelecting.current = false;
|
|
381
|
+
const startIndex = rangeSelectionStartIndexRef.current;
|
|
382
|
+
const endIndex = rangeSelectionEndIndexRef.current;
|
|
383
|
+
rangeSelectionStartIndexRef.current = null;
|
|
384
|
+
rangeSelectionEndIndexRef.current = null;
|
|
385
|
+
setRangeSelectionStart(null);
|
|
386
|
+
setRangeSelectionEnd(null);
|
|
387
|
+
/*
|
|
388
|
+
* A plain click (pointer never left the starting bucket) must keep
|
|
389
|
+
* behaving exactly as before — only a real drag selects a range.
|
|
390
|
+
*/
|
|
391
|
+
if (startIndex === null || endIndex === null || startIndex === endIndex) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
/*
|
|
395
|
+
* The browser fires a click right after mouseup; swallow it so a
|
|
396
|
+
* drag doesn't also toggle legend/dot selection. Cleared on a
|
|
397
|
+
* timeout so a never-delivered click can't suppress a later one.
|
|
398
|
+
*/
|
|
399
|
+
suppressNextClickRef.current = true;
|
|
400
|
+
setTimeout(() => {
|
|
401
|
+
suppressNextClickRef.current = false;
|
|
402
|
+
}, 0);
|
|
403
|
+
if (!onTimeRangeSelect) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const lowerIndex = Math.min(startIndex, endIndex);
|
|
407
|
+
const upperIndex = Math.max(startIndex, endIndex);
|
|
408
|
+
const startDate = getBucketDateAtIndex(lowerIndex);
|
|
409
|
+
const lastBucketDate = getBucketDateAtIndex(upperIndex);
|
|
410
|
+
if (!startDate || !lastBucketDate) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
/*
|
|
414
|
+
* Cover the full final bucket: its end is its start plus one
|
|
415
|
+
* bucket width, derived from adjacent row dates.
|
|
416
|
+
*/
|
|
417
|
+
const adjacentDate = upperIndex > 0
|
|
418
|
+
? getBucketDateAtIndex(upperIndex - 1)
|
|
419
|
+
: getBucketDateAtIndex(upperIndex + 1);
|
|
420
|
+
const bucketWidthInMs = adjacentDate
|
|
421
|
+
? Math.abs(lastBucketDate.getTime() - adjacentDate.getTime())
|
|
422
|
+
: 0;
|
|
423
|
+
const endDate = new Date(lastBucketDate.getTime() + bucketWidthInMs);
|
|
424
|
+
onTimeRangeSelect(startDate, endDate);
|
|
425
|
+
}
|
|
426
|
+
return (React.createElement("div", Object.assign({ ref: ref, className: cx("flex-1 w-full", hasOnTimeRangeSelect && "cursor-crosshair", className) }, other),
|
|
281
427
|
React.createElement(ResponsiveContainer, null,
|
|
282
|
-
React.createElement(RechartsAreaChart, { data: data, syncId: ((_a = props.syncid) === null || _a === void 0 ? void 0 : _a.toString()) || "",
|
|
428
|
+
React.createElement(RechartsAreaChart, Object.assign({ data: data, syncId: ((_a = props.syncid) === null || _a === void 0 ? void 0 : _a.toString()) || "" }, (hasOnTimeRangeSelect
|
|
429
|
+
? {
|
|
430
|
+
onMouseDown: handleRangeSelectMouseDown,
|
|
431
|
+
onMouseMove: handleRangeSelectMouseMove,
|
|
432
|
+
onMouseUp: handleRangeSelectMouseUp,
|
|
433
|
+
}
|
|
434
|
+
: {}), { onClick: hasOnValueChange && (activeLegend || activeDot)
|
|
283
435
|
? () => {
|
|
436
|
+
// Ignore the click that follows a drag-to-select.
|
|
437
|
+
if (suppressNextClickRef.current) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
284
440
|
setActiveDot(undefined);
|
|
285
441
|
setActiveLegend(undefined);
|
|
286
442
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(null);
|
|
@@ -294,7 +450,7 @@ const AreaChart = React.forwardRef((props, ref) => {
|
|
|
294
450
|
left: (yAxisLabel ? 20 : 0),
|
|
295
451
|
right: (yAxisLabel ? 5 : 8),
|
|
296
452
|
top: 5,
|
|
297
|
-
} },
|
|
453
|
+
} }),
|
|
298
454
|
React.createElement("defs", null, categories.map((category, i) => {
|
|
299
455
|
const colorKey = colors[i % colors.length] || "blue";
|
|
300
456
|
const hex = getColorHex(colorKey);
|
|
@@ -403,10 +559,55 @@ const AreaChart = React.forwardRef((props, ref) => {
|
|
|
403
559
|
}), (_b = props.referenceLines) === null || _b === void 0 ? void 0 :
|
|
404
560
|
_b.map((refLine, refIndex) => {
|
|
405
561
|
return (React.createElement(ReferenceLine, { key: `ref-${refIndex}`, y: refLine.value, stroke: refLine.color, strokeDasharray: refLine.strokeDasharray || "4 4", strokeWidth: 1.5 }, refLine.label && (React.createElement(Label, { value: refLine.label, position: "insideTopRight", fill: refLine.color, fontSize: 11, fontWeight: 500 }))));
|
|
562
|
+
}), formattedReferenceRegions === null || formattedReferenceRegions === void 0 ? void 0 :
|
|
563
|
+
formattedReferenceRegions.map((region, regionIndex) => {
|
|
564
|
+
const regionColor = region.original.color || "#6366f1";
|
|
565
|
+
return (React.createElement(ReferenceArea, Object.assign({ key: `ref-region-${regionIndex}`, x1: region.formattedX1, x2: region.formattedX2, fill: regionColor, fillOpacity: 0.12, stroke: regionColor, strokeOpacity: 0.35, strokeWidth: 1 }, (region.original.onClick
|
|
566
|
+
? {
|
|
567
|
+
style: { cursor: "pointer" },
|
|
568
|
+
onClick: () => {
|
|
569
|
+
var _a, _b;
|
|
570
|
+
if (suppressNextClickRef.current) {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
(_b = (_a = region.original).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
574
|
+
},
|
|
575
|
+
}
|
|
576
|
+
: {})), region.original.label && (React.createElement(Label, { value: region.original.label, position: "insideTop", fill: regionColor, fontSize: 10, fontWeight: 500 }))));
|
|
577
|
+
}), formattedTimeReferenceLines === null || formattedTimeReferenceLines === void 0 ? void 0 :
|
|
578
|
+
formattedTimeReferenceLines.map((timeRefLine, timeRefIndex) => {
|
|
579
|
+
const lineColor = timeRefLine.original.color || "#f59e0b";
|
|
580
|
+
return (React.createElement(ReferenceLine, Object.assign({ key: `time-ref-${timeRefIndex}`, x: timeRefLine.formattedX, stroke: lineColor, strokeDasharray: timeRefLine.original.strokeDasharray || "4 4", strokeWidth: 1.5 }, (timeRefLine.original.onClick
|
|
581
|
+
? {
|
|
582
|
+
style: { cursor: "pointer" },
|
|
583
|
+
onClick: () => {
|
|
584
|
+
var _a, _b;
|
|
585
|
+
if (suppressNextClickRef.current) {
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
(_b = (_a = timeRefLine.original).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
589
|
+
},
|
|
590
|
+
}
|
|
591
|
+
: {})), timeRefLine.original.label &&
|
|
592
|
+
showTimeReferenceLineLabels && (React.createElement(Label, Object.assign({ value: timeRefLine.original.label }, (timeReferenceLineCount > 1
|
|
593
|
+
? {
|
|
594
|
+
/*
|
|
595
|
+
* Several markers: run each label down its
|
|
596
|
+
* own line so labels at different x stop
|
|
597
|
+
* sharing one horizontal band.
|
|
598
|
+
*/
|
|
599
|
+
position: "insideTopLeft",
|
|
600
|
+
angle: 90,
|
|
601
|
+
}
|
|
602
|
+
: { position: "insideTop" }), { fill: lineColor, fontSize: 10, fontWeight: 500 })))));
|
|
406
603
|
}), (_c = props.formattedExemplarPoints) === null || _c === void 0 ? void 0 :
|
|
407
604
|
_c.map((exemplar, exemplarIndex) => {
|
|
408
605
|
return (React.createElement(ReferenceDot, { key: `exemplar-${exemplarIndex}`, x: exemplar.formattedX, y: exemplar.y, r: 5, fill: "#7c3aed", stroke: "var(--ou-chart-marker-ring, #ffffff)", strokeWidth: 2, style: { cursor: "pointer" }, onClick: () => {
|
|
409
606
|
var _a;
|
|
607
|
+
// Ignore the click that follows a drag-to-select.
|
|
608
|
+
if (suppressNextClickRef.current) {
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
410
611
|
(_a = props.onExemplarClick) === null || _a === void 0 ? void 0 : _a.call(props, exemplar.original);
|
|
411
612
|
} },
|
|
412
613
|
React.createElement(Label, { value: "E", position: "center",
|
|
@@ -415,7 +616,8 @@ const AreaChart = React.forwardRef((props, ref) => {
|
|
|
415
616
|
* not follow the ring token that flips dark with the theme.
|
|
416
617
|
*/
|
|
417
618
|
fill: "#ffffff", fontSize: 8, fontWeight: 700 })));
|
|
418
|
-
})
|
|
619
|
+
}),
|
|
620
|
+
rangeSelectionStart && rangeSelectionEnd ? (React.createElement(ReferenceArea, { x1: rangeSelectionStart, x2: rangeSelectionEnd, fill: "rgba(99,102,241,0.12)", stroke: "rgba(99,102,241,0.5)", strokeWidth: 1, radius: 2 })) : null))));
|
|
419
621
|
});
|
|
420
622
|
AreaChart.displayName = "AreaChart";
|
|
421
623
|
export { AreaChart };
|