@galaxy-io/dls 1.2.7 → 1.3.1
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/README.md +2 -0
- package/dist/avatar/Avatar.d.ts +2 -1
- package/dist/avatar/Avatar.js +103 -14
- package/dist/buttons/Button.d.ts +6 -1
- package/dist/buttons/Button.js +8 -4
- package/dist/charts/BarChart.d.ts +30 -20
- package/dist/charts/BarChart.js +183 -253
- package/dist/charts/ChartAxis.d.ts +47 -22
- package/dist/charts/ChartAxis.js +81 -60
- package/dist/charts/ChartCategoryTargets.d.ts +27 -0
- package/dist/charts/ChartCategoryTargets.js +75 -0
- package/dist/charts/ChartEmptyState.d.ts +17 -0
- package/dist/charts/ChartEmptyState.js +29 -0
- package/dist/charts/ChartFrame.d.ts +110 -0
- package/dist/charts/ChartFrame.js +143 -0
- package/dist/charts/ChartLegend.d.ts +27 -4
- package/dist/charts/ChartLegend.js +46 -23
- package/dist/charts/ChartPrimitives.d.ts +230 -0
- package/dist/charts/ChartPrimitives.js +305 -0
- package/dist/charts/ChartTooltip.d.ts +25 -4
- package/dist/charts/ChartTooltip.js +55 -49
- package/dist/charts/LineChart.d.ts +42 -20
- package/dist/charts/LineChart.js +175 -241
- package/dist/charts/PieChart.d.ts +48 -32
- package/dist/charts/PieChart.js +180 -170
- package/dist/charts/barChartGeometry.d.ts +120 -0
- package/dist/charts/barChartGeometry.js +210 -0
- package/dist/charts/barChartLegend.d.ts +25 -0
- package/dist/charts/barChartLegend.js +23 -0
- package/dist/charts/chartFormat.d.ts +27 -0
- package/dist/charts/chartFormat.js +71 -0
- package/dist/charts/chartScales.d.ts +120 -0
- package/dist/charts/chartScales.js +165 -0
- package/dist/charts/chartTheme.d.ts +18 -0
- package/dist/charts/chartTheme.js +26 -0
- package/dist/charts/constants.d.ts +241 -18
- package/dist/charts/constants.js +261 -32
- package/dist/charts/lineChartGeometry.d.ts +92 -0
- package/dist/charts/lineChartGeometry.js +134 -0
- package/dist/charts/pieChartGeometry.d.ts +60 -0
- package/dist/charts/pieChartGeometry.js +79 -0
- package/dist/charts/types.d.ts +428 -54
- package/dist/charts/types.js +155 -0
- package/dist/charts/useCartesianChartLayout.d.ts +70 -0
- package/dist/charts/useCartesianChartLayout.js +56 -0
- package/dist/charts/useChartDimensions.d.ts +47 -0
- package/dist/charts/useChartDimensions.js +63 -0
- package/dist/charts/useChartFormatters.d.ts +19 -0
- package/dist/charts/useChartFormatters.js +20 -0
- package/dist/charts/useChartInteraction.d.ts +76 -0
- package/dist/charts/useChartInteraction.js +126 -0
- package/dist/charts/useChartTooltipPosition.d.ts +53 -0
- package/dist/charts/useChartTooltipPosition.js +39 -0
- package/dist/charts/useSeriesColorResolver.d.ts +37 -0
- package/dist/charts/useSeriesColorResolver.js +27 -0
- package/dist/hooks/useElementClientSize.d.ts +20 -0
- package/dist/hooks/useElementClientSize.js +43 -0
- package/dist/inputs/CheckboxInput.d.ts +7 -2
- package/dist/inputs/CheckboxInput.js +30 -14
- package/dist/inputs/Input.d.ts +1 -1
- package/dist/inputs/Input.js +6 -2
- package/dist/inputs/MultiSelectInput.js +1 -1
- package/dist/inputs/RadioInput.js +7 -2
- package/dist/styles.css +69 -74
- package/dist/table/InfiniteSpreadsheet.d.ts +6 -0
- package/dist/table/InfiniteSpreadsheet.js +235 -0
- package/dist/table/InfiniteTable.d.ts +7 -88
- package/dist/table/InfiniteTable.js +366 -577
- package/dist/{spreadsheet → table}/SpreadsheetCell.d.ts +6 -4
- package/dist/table/SpreadsheetCell.js +71 -0
- package/dist/{spreadsheet → table}/SpreadsheetCellEditor.js +27 -21
- package/dist/table/SpreadsheetHeaderCell.d.ts +23 -0
- package/dist/table/SpreadsheetHeaderCell.js +91 -0
- package/dist/table/SpreadsheetMenuItem.d.ts +14 -0
- package/dist/table/SpreadsheetMenuItem.js +33 -0
- package/dist/table/SpreadsheetPrimitives.d.ts +172 -0
- package/dist/table/SpreadsheetPrimitives.js +105 -0
- package/dist/table/SpreadsheetRow.d.ts +33 -0
- package/dist/table/SpreadsheetRow.js +73 -0
- package/dist/{spreadsheet → table}/SpreadsheetRowActionCell.d.ts +5 -7
- package/dist/table/SpreadsheetRowActionCell.js +51 -0
- package/dist/table/TableExpandCell.d.ts +11 -0
- package/dist/table/TableExpandCell.js +24 -0
- package/dist/table/TableExpandedRow.d.ts +16 -0
- package/dist/table/TableExpandedRow.js +77 -0
- package/dist/table/TableHeaderCellContent.d.ts +30 -0
- package/dist/table/TableHeaderCellContent.js +48 -0
- package/dist/table/TablePrimitives.d.ts +307 -0
- package/dist/table/TablePrimitives.js +298 -0
- package/dist/table/TableSelectCell.d.ts +18 -0
- package/dist/table/TableSelectCell.js +26 -0
- package/dist/table/TableStatusRow.d.ts +18 -0
- package/dist/table/TableStatusRow.js +50 -0
- package/dist/table/VirtualizedInfiniteTable.d.ts +11 -27
- package/dist/table/VirtualizedInfiniteTable.js +182 -317
- package/dist/table/types.d.ts +249 -0
- package/dist/table/types.js +51 -0
- package/dist/table/useInfiniteScrollSentinel.d.ts +24 -0
- package/dist/table/useInfiniteScrollSentinel.js +53 -0
- package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.d.ts +1 -1
- package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.js +1 -1
- package/dist/table/useTableColumnLayout.d.ts +28 -0
- package/dist/table/useTableColumnLayout.js +63 -0
- package/dist/table/useTableColumnResize.d.ts +38 -0
- package/dist/table/useTableColumnResize.js +155 -0
- package/dist/table/useTableKeyboardNavigation.d.ts +25 -0
- package/dist/table/useTableKeyboardNavigation.js +83 -0
- package/dist/table/useTableRowExpansion.d.ts +24 -0
- package/dist/table/useTableRowExpansion.js +62 -0
- package/dist/table/useTableRowSelection.d.ts +27 -0
- package/dist/table/useTableRowSelection.js +94 -0
- package/dist/table/utils.d.ts +50 -0
- package/dist/table/utils.js +78 -0
- package/dist/text/MarkdownText.js +45 -27
- package/dist/theme/variants/dark.js +1 -1
- package/dist/widget/Widget.d.ts +2 -0
- package/dist/widget/Widget.js +14 -7
- package/package.json +1 -5
- package/dist/assets/components/enrichment/PerplexityIcon.d.ts +0 -3
- package/dist/assets/components/enrichment/PerplexityIcon.js +0 -35
- package/dist/assets/components/enrichment/TavilyIcon.d.ts +0 -3
- package/dist/assets/components/enrichment/TavilyIcon.js +0 -15
- package/dist/assets/components/onboarding/TenantSetupDark.d.ts +0 -3
- package/dist/assets/components/onboarding/TenantSetupDark.js +0 -498
- package/dist/assets/components/onboarding/TenantSetupLight.d.ts +0 -3
- package/dist/assets/components/onboarding/TenantSetupLight.js +0 -482
- package/dist/assets/components/onboarding/UserSetupDark.d.ts +0 -3
- package/dist/assets/components/onboarding/UserSetupDark.js +0 -1086
- package/dist/assets/components/onboarding/UserSetupLight.d.ts +0 -3
- package/dist/assets/components/onboarding/UserSetupLight.js +0 -1024
- package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.js +0 -466
- package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.js +0 -460
- package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.js +0 -336
- package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.js +0 -336
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.js +0 -153
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.d.ts +0 -3
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.js +0 -153
- package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.js +0 -117
- package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.js +0 -117
- package/dist/assets/components/projects/MappingMethodBlankDark.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankDark.js +0 -150
- package/dist/assets/components/projects/MappingMethodBlankDarkHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankDarkHovered.js +0 -150
- package/dist/assets/components/projects/MappingMethodBlankLight.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankLight.js +0 -150
- package/dist/assets/components/projects/MappingMethodBlankLightHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodBlankLightHovered.js +0 -150
- package/dist/assets/components/projects/MappingMethodJsonDark.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonDark.js +0 -90
- package/dist/assets/components/projects/MappingMethodJsonDarkHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonDarkHovered.js +0 -90
- package/dist/assets/components/projects/MappingMethodJsonLight.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonLight.js +0 -90
- package/dist/assets/components/projects/MappingMethodJsonLightHovered.d.ts +0 -3
- package/dist/assets/components/projects/MappingMethodJsonLightHovered.js +0 -90
- package/dist/assets/components/projects/ProjectsEmptyStateDark.d.ts +0 -3
- package/dist/assets/components/projects/ProjectsEmptyStateDark.js +0 -454
- package/dist/assets/components/projects/ProjectsEmptyStateLight.d.ts +0 -3
- package/dist/assets/components/projects/ProjectsEmptyStateLight.js +0 -456
- package/dist/assets/components/root/CreateProjectActionCardDark.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardDark.js +0 -1796
- package/dist/assets/components/root/CreateProjectActionCardDarkHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardDarkHovered.js +0 -1796
- package/dist/assets/components/root/CreateProjectActionCardLight.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardLight.js +0 -1786
- package/dist/assets/components/root/CreateProjectActionCardLightHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateProjectActionCardLightHovered.js +0 -1786
- package/dist/assets/components/root/CreateSourceActionCardDark.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardDark.js +0 -879
- package/dist/assets/components/root/CreateSourceActionCardDarkHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardDarkHovered.js +0 -879
- package/dist/assets/components/root/CreateSourceActionCardLight.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardLight.js +0 -889
- package/dist/assets/components/root/CreateSourceActionCardLightHovered.d.ts +0 -3
- package/dist/assets/components/root/CreateSourceActionCardLightHovered.js +0 -889
- package/dist/assets/components/sources/AttioIcon.d.ts +0 -3
- package/dist/assets/components/sources/AttioIcon.js +0 -11
- package/dist/assets/components/sources/BigquerySourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/BigquerySourceIcon.js +0 -39
- package/dist/assets/components/sources/BrowserbaseSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/BrowserbaseSourceIcon.js +0 -35
- package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.d.ts +0 -3
- package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.js +0 -13
- package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.d.ts +0 -3
- package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.js +0 -13
- package/dist/assets/components/sources/ConfluenceSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/ConfluenceSourceIcon.js +0 -30
- package/dist/assets/components/sources/GithubSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/GithubSourceIcon.js +0 -27
- package/dist/assets/components/sources/GoogleDriveIcon.d.ts +0 -3
- package/dist/assets/components/sources/GoogleDriveIcon.js +0 -45
- package/dist/assets/components/sources/HubspotSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/HubspotSourceIcon.js +0 -14
- package/dist/assets/components/sources/JiraSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/JiraSourceIcon.js +0 -54
- package/dist/assets/components/sources/LinearSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/LinearSourceIcon.js +0 -14
- package/dist/assets/components/sources/MysqlLogoSourceIconDark.d.ts +0 -3
- package/dist/assets/components/sources/MysqlLogoSourceIconDark.js +0 -17
- package/dist/assets/components/sources/NetsuiteSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/NetsuiteSourceIcon.js +0 -32
- package/dist/assets/components/sources/NotionIcon.d.ts +0 -3
- package/dist/assets/components/sources/NotionIcon.js +0 -20
- package/dist/assets/components/sources/PostgresqlIcon.d.ts +0 -3
- package/dist/assets/components/sources/PostgresqlIcon.js +0 -61
- package/dist/assets/components/sources/S3Icon.d.ts +0 -3
- package/dist/assets/components/sources/S3Icon.js +0 -76
- package/dist/assets/components/sources/SalesforceSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/SalesforceSourceIcon.js +0 -23
- package/dist/assets/components/sources/SlackIcon.d.ts +0 -3
- package/dist/assets/components/sources/SlackIcon.js +0 -32
- package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.d.ts +0 -3
- package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.js +0 -14
- package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.d.ts +0 -3
- package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.js +0 -14
- package/dist/assets/components/sources/WikipediaSourceIcon.d.ts +0 -3
- package/dist/assets/components/sources/WikipediaSourceIcon.js +0 -1490
- package/dist/avatar/AvatarEmpty.d.ts +0 -7
- package/dist/avatar/AvatarEmpty.js +0 -99
- package/dist/avatar/types.d.ts +0 -5
- package/dist/avatar/types.js +0 -9
- package/dist/charts/utils.d.ts +0 -29
- package/dist/charts/utils.js +0 -62
- package/dist/icons/BackIcon.d.ts +0 -3
- package/dist/icons/BackIcon.js +0 -13
- package/dist/icons/CloseIcon.d.ts +0 -3
- package/dist/icons/CloseIcon.js +0 -13
- package/dist/icons/CreateIcon.d.ts +0 -3
- package/dist/icons/CreateIcon.js +0 -13
- package/dist/icons/ForwardIcon.d.ts +0 -3
- package/dist/icons/ForwardIcon.js +0 -13
- package/dist/icons/HelpIcon.d.ts +0 -3
- package/dist/icons/HelpIcon.js +0 -14
- package/dist/icons/ProjectsIcon.d.ts +0 -3
- package/dist/icons/ProjectsIcon.js +0 -12
- package/dist/icons/SearchIcon.d.ts +0 -3
- package/dist/icons/SearchIcon.js +0 -12
- package/dist/icons/SourcesIcon.d.ts +0 -3
- package/dist/icons/SourcesIcon.js +0 -12
- package/dist/icons/TextIcon.d.ts +0 -4
- package/dist/icons/TextIcon.js +0 -22
- package/dist/icons/WebScrapeIcon.d.ts +0 -4
- package/dist/icons/WebScrapeIcon.js +0 -22
- package/dist/icons/WebhookIcon.d.ts +0 -4
- package/dist/icons/WebhookIcon.js +0 -22
- package/dist/icons/sources/AttioLogomark.d.ts +0 -4
- package/dist/icons/sources/AttioLogomark.js +0 -8
- package/dist/icons/sources/BrowserbaseLogomark.d.ts +0 -4
- package/dist/icons/sources/BrowserbaseLogomark.js +0 -8
- package/dist/icons/sources/ClickhouseLogomark.d.ts +0 -4
- package/dist/icons/sources/ClickhouseLogomark.js +0 -16
- package/dist/icons/sources/ConfluenceLogomark.d.ts +0 -4
- package/dist/icons/sources/ConfluenceLogomark.js +0 -8
- package/dist/icons/sources/GithubLogomark.d.ts +0 -4
- package/dist/icons/sources/GithubLogomark.js +0 -8
- package/dist/icons/sources/GoogleBigqueryLogomark.d.ts +0 -4
- package/dist/icons/sources/GoogleBigqueryLogomark.js +0 -8
- package/dist/icons/sources/GoogleDriveLogomark.d.ts +0 -4
- package/dist/icons/sources/GoogleDriveLogomark.js +0 -8
- package/dist/icons/sources/HubspotLogomark.d.ts +0 -4
- package/dist/icons/sources/HubspotLogomark.js +0 -8
- package/dist/icons/sources/JiraLogomark.d.ts +0 -4
- package/dist/icons/sources/JiraLogomark.js +0 -8
- package/dist/icons/sources/LinearLogomark.d.ts +0 -4
- package/dist/icons/sources/LinearLogomark.js +0 -8
- package/dist/icons/sources/MySQLLogomark.d.ts +0 -4
- package/dist/icons/sources/MySQLLogomark.js +0 -8
- package/dist/icons/sources/NetsuiteLogomark.d.ts +0 -4
- package/dist/icons/sources/NetsuiteLogomark.js +0 -8
- package/dist/icons/sources/NotionLogomark.d.ts +0 -4
- package/dist/icons/sources/NotionLogomark.js +0 -8
- package/dist/icons/sources/PostgresLogomark.d.ts +0 -4
- package/dist/icons/sources/PostgresLogomark.js +0 -8
- package/dist/icons/sources/S3Logomark.d.ts +0 -4
- package/dist/icons/sources/S3Logomark.js +0 -8
- package/dist/icons/sources/SalesforceLogomark.d.ts +0 -4
- package/dist/icons/sources/SalesforceLogomark.js +0 -8
- package/dist/icons/sources/SlackLogoIconmark.d.ts +0 -4
- package/dist/icons/sources/SlackLogoIconmark.js +0 -8
- package/dist/icons/sources/SnowflakeLogomark.d.ts +0 -4
- package/dist/icons/sources/SnowflakeLogomark.js +0 -16
- package/dist/icons/sources/WikipediaLogomark.d.ts +0 -4
- package/dist/icons/sources/WikipediaLogomark.js +0 -8
- package/dist/spreadsheet/InfiniteSpreadsheet.d.ts +0 -3
- package/dist/spreadsheet/InfiniteSpreadsheet.js +0 -265
- package/dist/spreadsheet/SpreadsheetAddColumnButton.d.ts +0 -6
- package/dist/spreadsheet/SpreadsheetAddColumnButton.js +0 -32
- package/dist/spreadsheet/SpreadsheetCell.js +0 -115
- package/dist/spreadsheet/SpreadsheetHeaderCell.d.ts +0 -18
- package/dist/spreadsheet/SpreadsheetHeaderCell.js +0 -141
- package/dist/spreadsheet/SpreadsheetRow.d.ts +0 -21
- package/dist/spreadsheet/SpreadsheetRow.js +0 -68
- package/dist/spreadsheet/SpreadsheetRowActionCell.js +0 -78
- package/dist/spreadsheet/hooks/useColumnResize.d.ts +0 -6
- package/dist/spreadsheet/hooks/useColumnResize.js +0 -46
- package/dist/spreadsheet/types.d.ts +0 -92
- package/dist/spreadsheet/types.js +0 -21
- /package/dist/{spreadsheet → table}/SpreadsheetCellEditor.d.ts +0 -0
|
@@ -1,64 +1,70 @@
|
|
|
1
|
-
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
1
|
import Text, { TextSize, TextVariant, TextWeight } from "../text/Text.js";
|
|
2
|
+
import FlexItem from "../containers/FlexItem.js";
|
|
3
3
|
import FlexWrapper, { AlignItems, FlexDirection, JustifyContent } from "../containers/FlexWrapper.js";
|
|
4
4
|
import Circle from "../shapes/Circle.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
5
|
+
import { useChartTooltipPosition } from "./useChartTooltipPosition.js";
|
|
6
|
+
import { ChartTooltipPositioner } from "./ChartPrimitives.js";
|
|
7
|
+
import { useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/charts/ChartTooltip.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
$y: data.y,
|
|
32
|
-
$visible: true,
|
|
33
|
-
children: /* @__PURE__ */ jsxs(FlexWrapper, {
|
|
10
|
+
var ChartTooltip = ({ model, containerWidth, containerHeight, anchorHalfWidth, placeAwayFromX, verticalAlign, renderer }) => {
|
|
11
|
+
const [retained, setRetained] = useState(model);
|
|
12
|
+
if (model !== null && model !== retained) setRetained(model);
|
|
13
|
+
const { tooltipRef, x, y, isMeasured } = useChartTooltipPosition({
|
|
14
|
+
anchorX: model?.anchorX ?? retained?.anchorX ?? 0,
|
|
15
|
+
anchorY: model?.anchorY ?? retained?.anchorY ?? 0,
|
|
16
|
+
containerWidth,
|
|
17
|
+
containerHeight,
|
|
18
|
+
anchorHalfWidth,
|
|
19
|
+
placeAwayFromX,
|
|
20
|
+
verticalAlign
|
|
21
|
+
});
|
|
22
|
+
const displayed = model ?? retained;
|
|
23
|
+
return /* @__PURE__ */ jsx(ChartTooltipPositioner, {
|
|
24
|
+
ref: tooltipRef,
|
|
25
|
+
$x: x,
|
|
26
|
+
$y: y,
|
|
27
|
+
$isVisible: model !== null && isMeasured,
|
|
28
|
+
role: "tooltip",
|
|
29
|
+
"aria-hidden": model === null,
|
|
30
|
+
children: !displayed ? null : renderer ? renderer(displayed) : /* @__PURE__ */ jsxs(FlexWrapper, {
|
|
34
31
|
direction: FlexDirection.COLUMN,
|
|
35
|
-
gap:
|
|
32
|
+
gap: 8,
|
|
33
|
+
fillWidth: true,
|
|
36
34
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
37
35
|
size: TextSize.BODY_SM,
|
|
38
|
-
|
|
39
|
-
children:
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
gap: 32,
|
|
36
|
+
variant: TextVariant.TERTIARY,
|
|
37
|
+
children: displayed.label
|
|
38
|
+
}), /* @__PURE__ */ jsx(FlexWrapper, {
|
|
39
|
+
direction: FlexDirection.COLUMN,
|
|
40
|
+
gap: 6,
|
|
44
41
|
fillWidth: true,
|
|
45
|
-
children:
|
|
42
|
+
children: displayed.rows.map((row) => /* @__PURE__ */ jsxs(FlexWrapper, {
|
|
46
43
|
alignItems: AlignItems.CENTER,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
justifyContent: JustifyContent.SPACE_BETWEEN,
|
|
45
|
+
gap: 16,
|
|
46
|
+
fillWidth: true,
|
|
47
|
+
children: [/* @__PURE__ */ jsxs(FlexWrapper, {
|
|
48
|
+
alignItems: AlignItems.CENTER,
|
|
49
|
+
gap: 6,
|
|
50
|
+
children: [/* @__PURE__ */ jsx(FlexItem, {
|
|
51
|
+
shrink: 0,
|
|
52
|
+
children: /* @__PURE__ */ jsx(Circle, {
|
|
53
|
+
size: 8,
|
|
54
|
+
hex: row.color
|
|
55
|
+
})
|
|
56
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
57
|
+
size: TextSize.BODY_SM,
|
|
58
|
+
isEllipsis: true,
|
|
59
|
+
children: row.label
|
|
60
|
+
})]
|
|
51
61
|
}), /* @__PURE__ */ jsx(Text, {
|
|
52
|
-
size: TextSize.
|
|
53
|
-
|
|
54
|
-
children:
|
|
62
|
+
size: TextSize.BODY_SM,
|
|
63
|
+
weight: TextWeight.MEDIUM,
|
|
64
|
+
children: row.formattedValue
|
|
55
65
|
})]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
weight: TextWeight.MEDIUM,
|
|
59
|
-
children: valueFormatter(item.value)
|
|
60
|
-
})]
|
|
61
|
-
}, item.seriesKey))]
|
|
66
|
+
}, row.key))
|
|
67
|
+
})]
|
|
62
68
|
})
|
|
63
69
|
});
|
|
64
70
|
};
|
|
@@ -1,22 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { LineChartCurve } from "./types";
|
|
2
|
+
import type { BaseCartesianChartProps, ChartSeriesStyles, ChartSize, LineChartLineDatum } from "./types";
|
|
3
|
+
export type LineChartProps<TMetric extends string> = BaseCartesianChartProps & ChartSize & {
|
|
4
|
+
/**
|
|
5
|
+
* Presentation for every metric, keyed by metric.
|
|
6
|
+
*
|
|
7
|
+
* `TMetric` is inferred from these keys alone — `lines` wraps it in
|
|
8
|
+
* `NoInfer` — so a mistyped metric is a compile error rather than a line
|
|
9
|
+
* that silently fails to draw.
|
|
10
|
+
*/
|
|
11
|
+
series: ChartSeriesStyles<TMetric>;
|
|
12
|
+
/** One entry per line. Lines may be sparse. */
|
|
13
|
+
lines: LineChartLineDatum<NoInfer<TMetric>>[];
|
|
14
|
+
/**
|
|
15
|
+
* Explicit category order along the x-axis.
|
|
16
|
+
*
|
|
17
|
+
* Worth supplying whenever the lines are sparse: the inferred order is the
|
|
18
|
+
* union of each line's categories in first-seen order, which is only
|
|
19
|
+
* correct if some line covers them all.
|
|
20
|
+
*/
|
|
21
|
+
categories?: string[];
|
|
22
|
+
/** @default LineChartCurve.SMOOTH */
|
|
23
|
+
curve?: LineChartCurve;
|
|
24
|
+
/** Default stroke width in px, overridable per line. */
|
|
11
25
|
strokeWidth?: number;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
26
|
+
/** Draw a vertical rule at the active category. @default true */
|
|
27
|
+
showCursor?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Notified when a category is pinned or unpinned by a click.
|
|
30
|
+
*
|
|
31
|
+
* The index is a position on the category axis.
|
|
32
|
+
*/
|
|
33
|
+
onPinnedChange?: (categoryIndex: number | null) => void;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Line chart over a categorical x-axis.
|
|
37
|
+
*
|
|
38
|
+
* Hit testing is per category column rather than per stroke: the tooltip
|
|
39
|
+
* reports every line at the hovered category at once, which is almost always
|
|
40
|
+
* what a reader wants, and it avoids the proximity search a
|
|
41
|
+
* nearest-point-to-cursor model needs.
|
|
42
|
+
*/
|
|
43
|
+
declare const LineChart: <TMetric extends string>({ series, lines, categories, width, height, fillWidth, fillHeight, aspectRatio, margin, curve, strokeWidth, showCursor, valueUnit, valueFormatter, labelFormatter, valueDomain, categoryLabelMode, categoryAxisTitle, valueAxisTitle, showGrid, showLegend, noTooltip, tooltipRenderer, isLoading, contentWhenEmpty, ariaLabel, ariaDescription, onPinnedChange, }: LineChartProps<TMetric>) => import("react").JSX.Element;
|
|
22
44
|
export default LineChart;
|
package/dist/charts/LineChart.js
CHANGED
|
@@ -1,250 +1,184 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import { useCallback, useMemo, useRef, useState } from "react";
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { area, curveMonotoneX, line } from "d3-shape";
|
|
1
|
+
import { ChartKind, ChartTargetShape, LineChartCurve } from "./types.js";
|
|
2
|
+
import { LINE_AREA_OPACITY, LINE_POINT_RADIUS } from "./constants.js";
|
|
3
|
+
import { useSeriesColorResolver } from "./useSeriesColorResolver.js";
|
|
4
|
+
import { useChartInteraction } from "./useChartInteraction.js";
|
|
5
|
+
import { useCartesianChartLayout } from "./useCartesianChartLayout.js";
|
|
6
|
+
import { buildLineChartGeometry, getLineValueDomain } from "./lineChartGeometry.js";
|
|
7
|
+
import { ChartAreaPath, ChartCursorLine, ChartLinePath, ChartPointCircle } from "./ChartPrimitives.js";
|
|
8
|
+
import ChartFrame from "./ChartFrame.js";
|
|
9
|
+
import { ChartCategoryAxis, ChartValueAxis } from "./ChartAxis.js";
|
|
10
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
12
|
//#region src/charts/LineChart.tsx
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class: "c8llr95",
|
|
26
|
-
propsAsIs: false,
|
|
27
|
-
vars: {
|
|
28
|
-
"c8llr95-0": [_exp()],
|
|
29
|
-
"c8llr95-1": [_exp2()]
|
|
30
|
-
}
|
|
31
|
-
}));
|
|
32
|
-
var LineChart = ({ data, series, width, height, margin: marginOverride, fillWidth = false, aspectRatio, mode = "NORMAL", strokeWidth = 2, dotRadius = 4, valueFormatter = defaultValueFormatter, labelFormatter = defaultLabelFormatter, tooltipRenderer, noTooltip = false, showLegend = true, showGrid = true, showArea = false, curveType = curveMonotoneX, ariaLabel }) => {
|
|
33
|
-
const { theme } = useGalaxyTheme();
|
|
13
|
+
/**
|
|
14
|
+
* Line chart over a categorical x-axis.
|
|
15
|
+
*
|
|
16
|
+
* Hit testing is per category column rather than per stroke: the tooltip
|
|
17
|
+
* reports every line at the hovered category at once, which is almost always
|
|
18
|
+
* what a reader wants, and it avoids the proximity search a
|
|
19
|
+
* nearest-point-to-cursor model needs.
|
|
20
|
+
*/
|
|
21
|
+
var LineChart = ({ series, lines, categories, width, height, fillWidth, fillHeight, aspectRatio, margin, curve = LineChartCurve.SMOOTH, strokeWidth, showCursor = true, valueUnit, valueFormatter, labelFormatter, valueDomain, categoryLabelMode, categoryAxisTitle, valueAxisTitle, showGrid = true, showLegend = true, noTooltip = false, tooltipRenderer, isLoading = false, contentWhenEmpty, ariaLabel, ariaDescription, onPinnedChange }) => {
|
|
34
22
|
const containerRef = useRef(null);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, [
|
|
73
|
-
data,
|
|
74
|
-
series,
|
|
75
|
-
mode
|
|
23
|
+
const colors = useSeriesColorResolver(series);
|
|
24
|
+
const { dimensions, domain, valueTicks, formatValue, formatLabel } = useCartesianChartLayout({
|
|
25
|
+
containerRef,
|
|
26
|
+
rawDomain: useMemo(() => getLineValueDomain(lines), [lines]),
|
|
27
|
+
valueDomain,
|
|
28
|
+
width,
|
|
29
|
+
height,
|
|
30
|
+
fillWidth,
|
|
31
|
+
fillHeight,
|
|
32
|
+
aspectRatio,
|
|
33
|
+
margin,
|
|
34
|
+
valueUnit,
|
|
35
|
+
valueFormatter,
|
|
36
|
+
labelFormatter,
|
|
37
|
+
valueAxisTitle,
|
|
38
|
+
categoryAxisTitle
|
|
39
|
+
});
|
|
40
|
+
const { plotWidth, plotHeight } = dimensions;
|
|
41
|
+
const resolveColor = useCallback(({ metric }) => colors.resolve(metric), [colors]);
|
|
42
|
+
const geometry = useMemo(() => buildLineChartGeometry({
|
|
43
|
+
lines,
|
|
44
|
+
categories,
|
|
45
|
+
plotWidth,
|
|
46
|
+
plotHeight,
|
|
47
|
+
curve,
|
|
48
|
+
domain,
|
|
49
|
+
strokeWidth,
|
|
50
|
+
resolveColor
|
|
51
|
+
}), [
|
|
52
|
+
lines,
|
|
53
|
+
categories,
|
|
54
|
+
plotWidth,
|
|
55
|
+
plotHeight,
|
|
56
|
+
curve,
|
|
57
|
+
domain,
|
|
58
|
+
strokeWidth,
|
|
59
|
+
resolveColor
|
|
76
60
|
]);
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
61
|
+
const isEmpty = geometry.categories.length === 0 || lines.length === 0;
|
|
62
|
+
const legendItems = useMemo(() => colors.keys.map((metric) => ({
|
|
63
|
+
key: metric,
|
|
64
|
+
label: series[metric].label,
|
|
65
|
+
color: colors.resolve(metric)
|
|
66
|
+
})), [colors, series]);
|
|
67
|
+
const legendKeys = useMemo(() => legendItems.map((item) => item.key), [legendItems]);
|
|
68
|
+
const interaction = useChartInteraction({
|
|
69
|
+
categoryCount: geometry.columns.length,
|
|
70
|
+
seriesKeys: legendKeys,
|
|
71
|
+
disabled: noTooltip || isLoading || isEmpty,
|
|
72
|
+
isLoading,
|
|
73
|
+
onPinnedChange
|
|
74
|
+
});
|
|
75
|
+
const activeColumn = interaction.activeIndex === null ? null : geometry.columns[interaction.activeIndex];
|
|
76
|
+
const buildCategoryTooltip = useCallback((index) => {
|
|
77
|
+
const column = geometry.columns[index];
|
|
78
|
+
if (!column) return null;
|
|
79
|
+
const rows = [...column.points].sort((a, b) => b.value - a.value).map((point) => ({
|
|
80
|
+
key: point.id,
|
|
81
|
+
label: series[point.metric]?.label ?? point.metric,
|
|
82
|
+
value: point.value,
|
|
83
|
+
formattedValue: formatValue(point.value),
|
|
84
|
+
color: point.color
|
|
85
|
+
}));
|
|
86
|
+
return {
|
|
87
|
+
label: formatLabel(column.label),
|
|
88
|
+
rows,
|
|
89
|
+
anchorX: column.x,
|
|
90
|
+
anchorY: column.anchorY
|
|
91
|
+
};
|
|
92
92
|
}, [
|
|
93
|
-
|
|
93
|
+
geometry.columns,
|
|
94
94
|
series,
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
formatValue,
|
|
96
|
+
formatLabel
|
|
97
97
|
]);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
fill: color,
|
|
182
|
-
opacity: hoveredDatumIndex !== null && hoveredDatumIndex !== datumIndex ? .3 : 1,
|
|
183
|
-
style: { transition: `opacity 150ms ease-in-out` },
|
|
184
|
-
role: "graphics-symbol",
|
|
185
|
-
"aria-roledescription": "data point",
|
|
186
|
-
"aria-label": `${s.name} for ${datum.label}: ${valueFormatter(datum.values[s.key] ?? 0)}`
|
|
187
|
-
}), /* @__PURE__ */ jsx("circle", {
|
|
188
|
-
cx,
|
|
189
|
-
cy,
|
|
190
|
-
r: dotRadius + 6,
|
|
191
|
-
fill: "transparent",
|
|
192
|
-
onMouseEnter: () => handlePointMouseEnter(datumIndex, cx, cy),
|
|
193
|
-
onMouseLeave: handlePointMouseLeave,
|
|
194
|
-
onFocus: () => handlePointMouseEnter(datumIndex, cx, cy),
|
|
195
|
-
onBlur: handlePointMouseLeave,
|
|
196
|
-
tabIndex: 0,
|
|
197
|
-
style: { cursor: "pointer" }
|
|
198
|
-
})] }, datum.label);
|
|
199
|
-
})
|
|
200
|
-
] }, s.key);
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
const defaultAriaLabel = `Line chart with ${data.length} data points and ${series.length} series`;
|
|
204
|
-
return /* @__PURE__ */ jsxs(ChartWrapper, {
|
|
205
|
-
ref: containerRef,
|
|
206
|
-
$fillWidth: fillWidth,
|
|
207
|
-
children: [/* @__PURE__ */ jsxs(Wrapper, {
|
|
208
|
-
position: "relative",
|
|
209
|
-
children: [/* @__PURE__ */ jsx("svg", {
|
|
210
|
-
ref: svgRef,
|
|
211
|
-
width: resolvedWidth,
|
|
212
|
-
height: resolvedHeight,
|
|
213
|
-
role: "img",
|
|
214
|
-
"aria-label": ariaLabel ?? defaultAriaLabel,
|
|
215
|
-
children: /* @__PURE__ */ jsxs("g", {
|
|
216
|
-
transform: `translate(${margin.left}, ${margin.top})`,
|
|
217
|
-
children: [
|
|
218
|
-
/* @__PURE__ */ jsx(YAxis, {
|
|
219
|
-
scale: yScale,
|
|
220
|
-
transform: "translate(0, 0)",
|
|
221
|
-
plotWidth,
|
|
222
|
-
formatter: valueFormatter,
|
|
223
|
-
showGrid,
|
|
224
|
-
theme
|
|
225
|
-
}),
|
|
226
|
-
/* @__PURE__ */ jsx(XAxisPoint, {
|
|
227
|
-
scale: xScale,
|
|
228
|
-
transform: `translate(0, ${plotHeight})`,
|
|
229
|
-
plotWidth,
|
|
230
|
-
formatter: labelFormatter
|
|
231
|
-
}),
|
|
232
|
-
mode === "STACKED" ? renderStackedLines() : renderNormalLines()
|
|
233
|
-
]
|
|
234
|
-
})
|
|
235
|
-
}), !noTooltip && (tooltipRenderer ? tooltip && tooltipRenderer(tooltip) : /* @__PURE__ */ jsx(ChartTooltip, {
|
|
236
|
-
data: tooltip,
|
|
237
|
-
valueFormatter
|
|
238
|
-
}))]
|
|
239
|
-
}), showLegend && /* @__PURE__ */ jsxs(FlexWrapper, {
|
|
240
|
-
direction: FlexDirection.ROW,
|
|
241
|
-
gap: 0,
|
|
242
|
-
children: [/* @__PURE__ */ jsx(Wrapper, { minWidth: margin.left }), /* @__PURE__ */ jsx(ChartLegend, {
|
|
243
|
-
series,
|
|
244
|
-
palette
|
|
245
|
-
})]
|
|
246
|
-
})]
|
|
98
|
+
const categoryPositions = useMemo(() => geometry.columns.map((column) => column.x - geometry.step / 2), [geometry.columns, geometry.step]);
|
|
99
|
+
const categoryTargets = useMemo(() => geometry.columns.map((column) => ({
|
|
100
|
+
key: String(column.categoryIndex),
|
|
101
|
+
shape: ChartTargetShape.RECT,
|
|
102
|
+
x: column.bandX,
|
|
103
|
+
y: 0,
|
|
104
|
+
width: column.bandWidth,
|
|
105
|
+
height: plotHeight
|
|
106
|
+
})), [geometry.columns, plotHeight]);
|
|
107
|
+
return /* @__PURE__ */ jsxs(ChartFrame, {
|
|
108
|
+
containerRef,
|
|
109
|
+
dimensions,
|
|
110
|
+
fillWidth,
|
|
111
|
+
fillHeight,
|
|
112
|
+
interaction,
|
|
113
|
+
kind: ChartKind.LINE,
|
|
114
|
+
categoryCount: geometry.categories.length,
|
|
115
|
+
ariaLabel,
|
|
116
|
+
ariaDescription,
|
|
117
|
+
axes: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ChartValueAxis, {
|
|
118
|
+
ticks: valueTicks,
|
|
119
|
+
scale: geometry.valueScale,
|
|
120
|
+
plotWidth,
|
|
121
|
+
plotHeight,
|
|
122
|
+
marginLeft: dimensions.margin.left,
|
|
123
|
+
formatter: formatValue,
|
|
124
|
+
showGrid,
|
|
125
|
+
title: valueAxisTitle
|
|
126
|
+
}), /* @__PURE__ */ jsx(ChartCategoryAxis, {
|
|
127
|
+
labels: geometry.categories,
|
|
128
|
+
positions: categoryPositions,
|
|
129
|
+
step: geometry.step,
|
|
130
|
+
plotWidth,
|
|
131
|
+
plotHeight,
|
|
132
|
+
formatter: formatLabel,
|
|
133
|
+
mode: categoryLabelMode,
|
|
134
|
+
title: categoryAxisTitle
|
|
135
|
+
})] }),
|
|
136
|
+
noTooltip,
|
|
137
|
+
buildCategoryTooltip,
|
|
138
|
+
tooltipRenderer,
|
|
139
|
+
categoryTargets,
|
|
140
|
+
anchorHalfWidth: geometry.step / 2,
|
|
141
|
+
isEmpty,
|
|
142
|
+
isLoading,
|
|
143
|
+
contentWhenEmpty,
|
|
144
|
+
showLegend,
|
|
145
|
+
legendItems,
|
|
146
|
+
children: [
|
|
147
|
+
geometry.paths.map((linePath) => linePath.areaPath ? /* @__PURE__ */ jsx(ChartAreaPath, {
|
|
148
|
+
d: linePath.areaPath,
|
|
149
|
+
fill: linePath.color,
|
|
150
|
+
fillOpacity: LINE_AREA_OPACITY,
|
|
151
|
+
"data-state": interaction.getMarkState({ seriesKey: linePath.metric })
|
|
152
|
+
}, `${linePath.id}:area`) : null),
|
|
153
|
+
showCursor && activeColumn && /* @__PURE__ */ jsx(ChartCursorLine, {
|
|
154
|
+
x1: activeColumn.x,
|
|
155
|
+
x2: activeColumn.x,
|
|
156
|
+
y1: 0,
|
|
157
|
+
y2: plotHeight
|
|
158
|
+
}),
|
|
159
|
+
geometry.paths.map((linePath) => /* @__PURE__ */ jsx(ChartLinePath, {
|
|
160
|
+
d: linePath.path,
|
|
161
|
+
stroke: linePath.color,
|
|
162
|
+
strokeWidth: linePath.strokeWidth,
|
|
163
|
+
strokeDasharray: linePath.dashArray,
|
|
164
|
+
"data-state": interaction.getMarkState({ seriesKey: linePath.metric })
|
|
165
|
+
}, linePath.id)),
|
|
166
|
+
geometry.isolatedPoints.map((point) => /* @__PURE__ */ jsx(ChartPointCircle, {
|
|
167
|
+
cx: point.x,
|
|
168
|
+
cy: point.y,
|
|
169
|
+
r: LINE_POINT_RADIUS,
|
|
170
|
+
fill: point.color,
|
|
171
|
+
"data-state": interaction.getMarkState({ seriesKey: point.metric })
|
|
172
|
+
}, `${point.id}:isolated`)),
|
|
173
|
+
activeColumn?.points.map((point) => /* @__PURE__ */ jsx(ChartPointCircle, {
|
|
174
|
+
cx: point.x,
|
|
175
|
+
cy: point.y,
|
|
176
|
+
r: LINE_POINT_RADIUS,
|
|
177
|
+
fill: point.color,
|
|
178
|
+
"data-state": interaction.getMarkState({ seriesKey: point.metric })
|
|
179
|
+
}, point.id))
|
|
180
|
+
]
|
|
247
181
|
});
|
|
248
182
|
};
|
|
249
183
|
//#endregion
|
|
250
|
-
export {
|
|
184
|
+
export { LineChart as default };
|