@gravity-ui/querieskit 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/build/cjs/components/AttachmentList/AttachmentList.js +1 -0
- package/build/cjs/components/AttachmentList/AttachmentList.js.map +1 -1
- package/build/cjs/components/QueryGraph/QueryGraph.css +70 -0
- package/build/cjs/components/QueryGraph/QueryGraph.css.map +1 -0
- package/build/cjs/components/QueryGraph/QueryGraph.d.ts +4 -0
- package/build/cjs/components/QueryGraph/QueryGraph.js +517 -0
- package/build/cjs/components/QueryGraph/QueryGraph.js.map +1 -0
- package/build/cjs/components/QueryGraph/QueryGraph.stories.d.ts +16 -0
- package/build/cjs/components/QueryGraph/QueryGraph.stories.js +339 -0
- package/build/cjs/components/QueryGraph/QueryGraph.stories.js.map +1 -0
- package/build/cjs/components/QueryGraph/helpers/layout.d.ts +9 -0
- package/build/cjs/components/QueryGraph/helpers/layout.js +138 -0
- package/build/cjs/components/QueryGraph/helpers/layout.js.map +1 -0
- package/build/cjs/components/QueryGraph/helpers/presentation.d.ts +18 -0
- package/build/cjs/components/QueryGraph/helpers/presentation.js +44 -0
- package/build/cjs/components/QueryGraph/helpers/presentation.js.map +1 -0
- package/build/cjs/components/QueryGraph/i18n/dicts.d.ts +55 -0
- package/build/cjs/components/QueryGraph/i18n/dicts.js +14 -0
- package/build/cjs/components/QueryGraph/i18n/dicts.js.map +1 -0
- package/build/cjs/components/QueryGraph/i18n/en.json +26 -0
- package/build/cjs/components/QueryGraph/i18n/index.d.ts +6 -0
- package/build/cjs/components/QueryGraph/i18n/index.js +11 -0
- package/build/cjs/components/QueryGraph/i18n/index.js.map +1 -0
- package/build/cjs/components/QueryGraph/i18n/ru.json +26 -0
- package/build/cjs/components/QueryGraph/index.d.ts +2 -0
- package/build/cjs/components/QueryGraph/index.js +13 -0
- package/build/cjs/components/QueryGraph/index.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.d.ts +24 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.js +307 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.d.ts +5 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.js +242 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/queryGraphIcons.d.ts +12 -0
- package/build/cjs/components/QueryGraph/internal/queryGraphIcons.js +161 -0
- package/build/cjs/components/QueryGraph/internal/queryGraphIcons.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.d.ts +22 -0
- package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.js +60 -0
- package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.js.map +1 -0
- package/build/cjs/components/QueryGraph/story/largeGraphData.d.ts +3 -0
- package/build/cjs/components/QueryGraph/story/largeGraphData.js +227 -0
- package/build/cjs/components/QueryGraph/story/largeGraphData.js.map +1 -0
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +9 -1
- package/build/cjs/components/index.js.map +1 -1
- package/build/cjs/helpers/buildColumnsFromKeys.d.ts +1 -1
- package/build/cjs/helpers/buildColumnsFromKeys.js.map +1 -1
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +11 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/modules/Attachments/Attachments.css +13 -1
- package/build/cjs/modules/Attachments/Attachments.css.map +1 -1
- package/build/cjs/modules/Attachments/Attachments.js +4 -4
- package/build/cjs/modules/Attachments/Attachments.js.map +1 -1
- package/build/cjs/modules/Attachments/Attachments.stories.d.ts +1 -0
- package/build/cjs/modules/Attachments/Attachments.stories.js +92 -2
- package/build/cjs/modules/Attachments/Attachments.stories.js.map +1 -1
- package/build/cjs/modules/ClustersList/ClustersList.d.ts +1 -1
- package/build/cjs/modules/ClustersList/ClustersList.js +4 -3
- package/build/cjs/modules/ClustersList/ClustersList.js.map +1 -1
- package/build/cjs/modules/HistoryHeader/HistoryHeader.js +4 -3
- package/build/cjs/modules/HistoryHeader/HistoryHeader.js.map +1 -1
- package/build/cjs/modules/HistoryRow/HistoryRow.js +12 -7
- package/build/cjs/modules/HistoryRow/HistoryRow.js.map +1 -1
- package/build/cjs/modules/HistorySearchRow/HistorySearchRow.js +8 -5
- package/build/cjs/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
- package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.d.ts +1 -1
- package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js +5 -5
- package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js.map +1 -1
- package/build/cjs/modules/NavigationDetail/NavigationDetail.d.ts +1 -1
- package/build/cjs/modules/NavigationDetail/NavigationDetail.js +2 -2
- package/build/cjs/modules/NavigationDetail/NavigationDetail.js.map +1 -1
- package/build/cjs/modules/NavigationHeader/NavigationHeader.d.ts +1 -1
- package/build/cjs/modules/NavigationHeader/NavigationHeader.js +2 -2
- package/build/cjs/modules/NavigationHeader/NavigationHeader.js.map +1 -1
- package/build/cjs/modules/NavigationItemsList/NavigationItemsList.d.ts +1 -1
- package/build/cjs/modules/NavigationItemsList/NavigationItemsList.js +4 -3
- package/build/cjs/modules/NavigationItemsList/NavigationItemsList.js.map +1 -1
- package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.d.ts +1 -1
- package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js +2 -2
- package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js.map +1 -1
- package/build/cjs/modules/NavigationMeta/NavigationMeta.js +4 -3
- package/build/cjs/modules/NavigationMeta/NavigationMeta.js.map +1 -1
- package/build/cjs/modules/NavigationMeta/i18n/index.d.ts +2 -2
- package/build/cjs/modules/NavigationPreview/NavigationPreview.d.ts +1 -1
- package/build/cjs/modules/NavigationPreview/NavigationPreview.js +6 -4
- package/build/cjs/modules/NavigationPreview/NavigationPreview.js.map +1 -1
- package/build/cjs/modules/NavigationPreview/helpers/buildPreviewColumns.d.ts +1 -1
- package/build/cjs/modules/NavigationPreview/helpers/buildPreviewColumns.js.map +1 -1
- package/build/cjs/modules/NavigationSchema/NavigationSchema.d.ts +1 -1
- package/build/cjs/modules/NavigationSchema/NavigationSchema.js +4 -3
- package/build/cjs/modules/NavigationSchema/NavigationSchema.js.map +1 -1
- package/build/cjs/modules/NavigationSchema/helpers/buildSchemaColumns.d.ts +1 -1
- package/build/cjs/modules/NavigationSchema/helpers/buildSchemaColumns.js.map +1 -1
- package/build/cjs/modules/NavigationView/NavigationView.d.ts +1 -1
- package/build/cjs/modules/NavigationView/NavigationView.js +4 -3
- package/build/cjs/modules/NavigationView/NavigationView.js.map +1 -1
- package/build/cjs/modules/NavigationView/helpers/buildViewColumns.d.ts +1 -1
- package/build/cjs/modules/NavigationView/helpers/buildViewColumns.js.map +1 -1
- package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.d.ts +1 -1
- package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.js +4 -3
- package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.js.map +1 -1
- package/build/cjs/modules/QueriesList/QueriesList.js +2 -2
- package/build/cjs/modules/QueriesList/QueriesList.js.map +1 -1
- package/build/cjs/modules/QueryProgress/QueryProgress.css +64 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.css.map +1 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.d.ts +4 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.js +135 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.js.map +1 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.stories.d.ts +7 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.stories.js +38 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.stories.js.map +1 -0
- package/build/cjs/modules/QueryProgress/i18n/dicts.d.ts +25 -0
- package/build/cjs/modules/QueryProgress/i18n/dicts.js +14 -0
- package/build/cjs/modules/QueryProgress/i18n/dicts.js.map +1 -0
- package/build/cjs/modules/QueryProgress/i18n/en.json +11 -0
- package/build/cjs/modules/QueryProgress/i18n/index.d.ts +6 -0
- package/build/cjs/modules/QueryProgress/i18n/index.js +11 -0
- package/build/cjs/modules/QueryProgress/i18n/index.js.map +1 -0
- package/build/cjs/modules/QueryProgress/i18n/ru.json +11 -0
- package/build/cjs/modules/QueryProgress/index.d.ts +2 -0
- package/build/cjs/modules/QueryProgress/index.js +13 -0
- package/build/cjs/modules/QueryProgress/index.js.map +1 -0
- package/build/cjs/modules/QueryStatistics/i18n/index.d.ts +2 -2
- package/build/cjs/modules/RowsList/RowsList.js +4 -3
- package/build/cjs/modules/RowsList/RowsList.js.map +1 -1
- package/build/cjs/modules/SavedQueryRow/SavedQueryRow.d.ts +2 -2
- package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js +6 -4
- package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js.map +1 -1
- package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +2 -2
- package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +4 -3
- package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -1
- package/build/cjs/modules/TutorialRow/TutorialRow.d.ts +1 -1
- package/build/cjs/modules/TutorialRow/TutorialRow.js +2 -2
- package/build/cjs/modules/TutorialRow/TutorialRow.js.map +1 -1
- package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.d.ts +1 -1
- package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.js +4 -3
- package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.js.map +1 -1
- package/build/cjs/modules/index.d.ts +2 -0
- package/build/cjs/modules/index.js +8 -0
- package/build/cjs/modules/index.js.map +1 -1
- package/build/cjs/types/queryGraph.d.ts +87 -0
- package/build/cjs/types/queryGraph.js +6 -0
- package/build/cjs/types/queryGraph.js.map +1 -0
- package/build/cjs/widgets/DashboardCharts/DashboardCharts.js +8 -6
- package/build/cjs/widgets/DashboardCharts/DashboardCharts.js.map +1 -1
- package/build/cjs/widgets/DashboardCharts/types.d.ts +3 -3
- package/build/cjs/widgets/DashboardCharts/types.js.map +1 -1
- package/build/cjs/widgets/QueriesHistory/QueriesHistory.js +2 -2
- package/build/cjs/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
- package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.js +6 -5
- package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -1
- package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.d.ts +1 -1
- package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.js +13 -9
- package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.js.map +1 -1
- package/build/cjs/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js +2 -2
- package/build/cjs/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js.map +1 -1
- package/build/cjs/widgets/QueriesNavigation/helpers/createTableDetailConfig.js +8 -5
- package/build/cjs/widgets/QueriesNavigation/helpers/createTableDetailConfig.js.map +1 -1
- package/build/cjs/widgets/QueryResults/QueryResults.js +2 -2
- package/build/cjs/widgets/QueryResults/QueryResults.js.map +1 -1
- package/build/cjs/widgets/QueryResults/i18n/index.d.ts +2 -2
- package/build/cjs/widgets/QueryResults/internal/QueryResultsSchema.js +4 -3
- package/build/cjs/widgets/QueryResults/internal/QueryResultsSchema.js.map +1 -1
- package/build/cjs/widgets/SavedQueries/SavedQueries.d.ts +2 -2
- package/build/cjs/widgets/SavedQueries/SavedQueries.js +2 -2
- package/build/cjs/widgets/SavedQueries/SavedQueries.js.map +1 -1
- package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.d.ts +2 -2
- package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js +6 -5
- package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -1
- package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
- package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js +6 -5
- package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
- package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.d.ts +2 -2
- package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js +6 -4
- package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
- package/build/esm/components/AttachmentList/AttachmentList.js +1 -0
- package/build/esm/components/AttachmentList/AttachmentList.js.map +1 -1
- package/build/esm/components/QueryGraph/QueryGraph.css +70 -0
- package/build/esm/components/QueryGraph/QueryGraph.css.map +1 -0
- package/build/esm/components/QueryGraph/QueryGraph.d.ts +4 -0
- package/build/esm/components/QueryGraph/QueryGraph.js +510 -0
- package/build/esm/components/QueryGraph/QueryGraph.js.map +1 -0
- package/build/esm/components/QueryGraph/QueryGraph.scss +81 -0
- package/build/esm/components/QueryGraph/QueryGraph.stories.d.ts +16 -0
- package/build/esm/components/QueryGraph/QueryGraph.stories.js +331 -0
- package/build/esm/components/QueryGraph/QueryGraph.stories.js.map +1 -0
- package/build/esm/components/QueryGraph/helpers/layout.d.ts +9 -0
- package/build/esm/components/QueryGraph/helpers/layout.js +128 -0
- package/build/esm/components/QueryGraph/helpers/layout.js.map +1 -0
- package/build/esm/components/QueryGraph/helpers/presentation.d.ts +18 -0
- package/build/esm/components/QueryGraph/helpers/presentation.js +35 -0
- package/build/esm/components/QueryGraph/helpers/presentation.js.map +1 -0
- package/build/esm/components/QueryGraph/i18n/dicts.d.ts +55 -0
- package/build/esm/components/QueryGraph/i18n/dicts.js +7 -0
- package/build/esm/components/QueryGraph/i18n/dicts.js.map +1 -0
- package/build/esm/components/QueryGraph/i18n/en.json +26 -0
- package/build/esm/components/QueryGraph/i18n/index.d.ts +6 -0
- package/build/esm/components/QueryGraph/i18n/index.js +4 -0
- package/build/esm/components/QueryGraph/i18n/index.js.map +1 -0
- package/build/esm/components/QueryGraph/i18n/ru.json +26 -0
- package/build/esm/components/QueryGraph/index.d.ts +2 -0
- package/build/esm/components/QueryGraph/index.js +2 -0
- package/build/esm/components/QueryGraph/index.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.d.ts +24 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js +299 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphPopup.d.ts +5 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js +234 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/queryGraphIcons.d.ts +12 -0
- package/build/esm/components/QueryGraph/internal/queryGraphIcons.js +150 -0
- package/build/esm/components/QueryGraph/internal/queryGraphIcons.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.d.ts +22 -0
- package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js +53 -0
- package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js.map +1 -0
- package/build/esm/components/QueryGraph/story/largeGraphData.d.ts +3 -0
- package/build/esm/components/QueryGraph/story/largeGraphData.js +220 -0
- package/build/esm/components/QueryGraph/story/largeGraphData.js.map +1 -0
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +1 -0
- package/build/esm/components/index.js.map +1 -1
- package/build/esm/helpers/buildColumnsFromKeys.d.ts +1 -1
- package/build/esm/helpers/buildColumnsFromKeys.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/modules/Attachments/Attachments.css +13 -1
- package/build/esm/modules/Attachments/Attachments.css.map +1 -1
- package/build/esm/modules/Attachments/Attachments.js +5 -5
- package/build/esm/modules/Attachments/Attachments.js.map +1 -1
- package/build/esm/modules/Attachments/Attachments.scss +13 -1
- package/build/esm/modules/Attachments/Attachments.stories.d.ts +1 -0
- package/build/esm/modules/Attachments/Attachments.stories.js +91 -1
- package/build/esm/modules/Attachments/Attachments.stories.js.map +1 -1
- package/build/esm/modules/ClustersList/ClustersList.d.ts +1 -1
- package/build/esm/modules/ClustersList/ClustersList.js +2 -1
- package/build/esm/modules/ClustersList/ClustersList.js.map +1 -1
- package/build/esm/modules/HistoryHeader/HistoryHeader.js +2 -1
- package/build/esm/modules/HistoryHeader/HistoryHeader.js.map +1 -1
- package/build/esm/modules/HistoryRow/HistoryRow.js +6 -1
- package/build/esm/modules/HistoryRow/HistoryRow.js.map +1 -1
- package/build/esm/modules/HistorySearchRow/HistorySearchRow.js +4 -1
- package/build/esm/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
- package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.d.ts +1 -1
- package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js +1 -1
- package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js.map +1 -1
- package/build/esm/modules/NavigationDetail/NavigationDetail.d.ts +1 -1
- package/build/esm/modules/NavigationDetail/NavigationDetail.js +1 -1
- package/build/esm/modules/NavigationDetail/NavigationDetail.js.map +1 -1
- package/build/esm/modules/NavigationHeader/NavigationHeader.d.ts +1 -1
- package/build/esm/modules/NavigationHeader/NavigationHeader.js +1 -1
- package/build/esm/modules/NavigationHeader/NavigationHeader.js.map +1 -1
- package/build/esm/modules/NavigationItemsList/NavigationItemsList.d.ts +1 -1
- package/build/esm/modules/NavigationItemsList/NavigationItemsList.js +2 -1
- package/build/esm/modules/NavigationItemsList/NavigationItemsList.js.map +1 -1
- package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.d.ts +1 -1
- package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js +1 -1
- package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js.map +1 -1
- package/build/esm/modules/NavigationMeta/NavigationMeta.js +2 -1
- package/build/esm/modules/NavigationMeta/NavigationMeta.js.map +1 -1
- package/build/esm/modules/NavigationMeta/i18n/index.d.ts +2 -2
- package/build/esm/modules/NavigationPreview/NavigationPreview.d.ts +1 -1
- package/build/esm/modules/NavigationPreview/NavigationPreview.js +3 -1
- package/build/esm/modules/NavigationPreview/NavigationPreview.js.map +1 -1
- package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.d.ts +1 -1
- package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.js.map +1 -1
- package/build/esm/modules/NavigationSchema/NavigationSchema.d.ts +1 -1
- package/build/esm/modules/NavigationSchema/NavigationSchema.js +2 -1
- package/build/esm/modules/NavigationSchema/NavigationSchema.js.map +1 -1
- package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.d.ts +1 -1
- package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.js.map +1 -1
- package/build/esm/modules/NavigationView/NavigationView.d.ts +1 -1
- package/build/esm/modules/NavigationView/NavigationView.js +2 -1
- package/build/esm/modules/NavigationView/NavigationView.js.map +1 -1
- package/build/esm/modules/NavigationView/helpers/buildViewColumns.d.ts +1 -1
- package/build/esm/modules/NavigationView/helpers/buildViewColumns.js.map +1 -1
- package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.d.ts +1 -1
- package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js +2 -1
- package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js.map +1 -1
- package/build/esm/modules/QueriesList/QueriesList.js +1 -1
- package/build/esm/modules/QueriesList/QueriesList.js.map +1 -1
- package/build/esm/modules/QueryProgress/QueryProgress.css +64 -0
- package/build/esm/modules/QueryProgress/QueryProgress.css.map +1 -0
- package/build/esm/modules/QueryProgress/QueryProgress.d.ts +4 -0
- package/build/esm/modules/QueryProgress/QueryProgress.js +127 -0
- package/build/esm/modules/QueryProgress/QueryProgress.js.map +1 -0
- package/build/esm/modules/QueryProgress/QueryProgress.scss +72 -0
- package/build/esm/modules/QueryProgress/QueryProgress.stories.d.ts +7 -0
- package/build/esm/modules/QueryProgress/QueryProgress.stories.js +31 -0
- package/build/esm/modules/QueryProgress/QueryProgress.stories.js.map +1 -0
- package/build/esm/modules/QueryProgress/i18n/dicts.d.ts +25 -0
- package/build/esm/modules/QueryProgress/i18n/dicts.js +7 -0
- package/build/esm/modules/QueryProgress/i18n/dicts.js.map +1 -0
- package/build/esm/modules/QueryProgress/i18n/en.json +11 -0
- package/build/esm/modules/QueryProgress/i18n/index.d.ts +6 -0
- package/build/esm/modules/QueryProgress/i18n/index.js +4 -0
- package/build/esm/modules/QueryProgress/i18n/index.js.map +1 -0
- package/build/esm/modules/QueryProgress/i18n/ru.json +11 -0
- package/build/esm/modules/QueryProgress/index.d.ts +2 -0
- package/build/esm/modules/QueryProgress/index.js +2 -0
- package/build/esm/modules/QueryProgress/index.js.map +1 -0
- package/build/esm/modules/QueryStatistics/i18n/index.d.ts +2 -2
- package/build/esm/modules/RowsList/RowsList.js +2 -1
- package/build/esm/modules/RowsList/RowsList.js.map +1 -1
- package/build/esm/modules/SavedQueryRow/SavedQueryRow.d.ts +2 -2
- package/build/esm/modules/SavedQueryRow/SavedQueryRow.js +3 -1
- package/build/esm/modules/SavedQueryRow/SavedQueryRow.js.map +1 -1
- package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +2 -2
- package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +2 -1
- package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -1
- package/build/esm/modules/TutorialRow/TutorialRow.d.ts +1 -1
- package/build/esm/modules/TutorialRow/TutorialRow.js +1 -1
- package/build/esm/modules/TutorialRow/TutorialRow.js.map +1 -1
- package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.d.ts +1 -1
- package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js +2 -1
- package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js.map +1 -1
- package/build/esm/modules/index.d.ts +2 -0
- package/build/esm/modules/index.js +1 -0
- package/build/esm/modules/index.js.map +1 -1
- package/build/esm/types/queryGraph.d.ts +87 -0
- package/build/esm/types/queryGraph.js +2 -0
- package/build/esm/types/queryGraph.js.map +1 -0
- package/build/esm/widgets/DashboardCharts/DashboardCharts.js +4 -2
- package/build/esm/widgets/DashboardCharts/DashboardCharts.js.map +1 -1
- package/build/esm/widgets/DashboardCharts/types.d.ts +3 -3
- package/build/esm/widgets/DashboardCharts/types.js.map +1 -1
- package/build/esm/widgets/QueriesHistory/QueriesHistory.js +1 -1
- package/build/esm/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
- package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js +3 -2
- package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -1
- package/build/esm/widgets/QueriesNavigation/QueriesNavigation.d.ts +1 -1
- package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js +6 -2
- package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js.map +1 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js +1 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js.map +1 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js +4 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js.map +1 -1
- package/build/esm/widgets/QueryResults/QueryResults.js +1 -1
- package/build/esm/widgets/QueryResults/QueryResults.js.map +1 -1
- package/build/esm/widgets/QueryResults/i18n/index.d.ts +2 -2
- package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js +2 -1
- package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js.map +1 -1
- package/build/esm/widgets/SavedQueries/SavedQueries.d.ts +2 -2
- package/build/esm/widgets/SavedQueries/SavedQueries.js +1 -1
- package/build/esm/widgets/SavedQueries/SavedQueries.js.map +1 -1
- package/build/esm/widgets/SavedQueries/SavedQueryRowContent.d.ts +2 -2
- package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js +3 -2
- package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -1
- package/build/esm/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
- package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js +3 -2
- package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
- package/build/esm/widgets/TutorialsHistory/TutorialsHistory.d.ts +2 -2
- package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js +3 -1
- package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
- package/package.json +84 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OPERATION_SIZE","RESOURCE_WIDTH","RESOURCE_HEIGHT","getQueryGraphNodeSize","node","kind","width","height","validateQueryGraph","nodes","edges","ids","Set","_iterator","_createForOfIteratorHelper","_step","s","n","done","value","has","id","Error","concat","add","err","e","f","edgeIds","_iterator2","_step2","edge","source","target","incoming","Map","map","outgoing","forEach","_incoming$get","_outgoing$get","set","get","push","queue","filter","visited","index","length","_outgoing$get2","_iterator3","_step3","_incoming$get2","nextIncoming","createQueryGraphConnections","routes","_objectSpread","sourceBlockId","targetBlockId","getQueryGraphProgress","_node$progress","_node$progress$total","_node$progress2","_node$progress$comple","_node$progress3","fraction","progress","Math","min","max","total","completed"],"sources":["layout.ts"],"sourcesContent":["import type {TMultipointConnection} from '@gravity-ui/graph';\n\nimport type {QueryGraphEdge, QueryGraphNode} from '../../../types/queryGraph';\n\nconst OPERATION_SIZE = 65;\nconst RESOURCE_WIDTH = 36;\nconst RESOURCE_HEIGHT = 36;\n\nexport function getQueryGraphNodeSize(node: QueryGraphNode) {\n return node.kind === 'operation'\n ? {width: OPERATION_SIZE, height: OPERATION_SIZE}\n : {width: RESOURCE_WIDTH, height: RESOURCE_HEIGHT};\n}\n\nexport function validateQueryGraph(nodes: QueryGraphNode[], edges: QueryGraphEdge[]) {\n const ids = new Set<string>();\n for (const node of nodes) {\n if (ids.has(node.id)) throw new Error(`Duplicate query graph node id: ${node.id}`);\n ids.add(node.id);\n }\n\n const edgeIds = new Set<string>();\n for (const edge of edges) {\n if (edgeIds.has(edge.id)) throw new Error(`Duplicate query graph edge id: ${edge.id}`);\n edgeIds.add(edge.id);\n if (!ids.has(edge.source)) throw new Error(`Unknown source node: ${edge.source}`);\n if (!ids.has(edge.target)) throw new Error(`Unknown target node: ${edge.target}`);\n }\n\n const incoming = new Map(nodes.map((node) => [node.id, 0]));\n const outgoing = new Map(nodes.map((node) => [node.id, [] as string[]]));\n edges.forEach((edge) => {\n incoming.set(edge.target, (incoming.get(edge.target) ?? 0) + 1);\n outgoing.get(edge.source)?.push(edge.target);\n });\n\n const queue = nodes.filter((node) => incoming.get(node.id) === 0).map((node) => node.id);\n let visited = 0;\n for (let index = 0; index < queue.length; index++) {\n const id = queue[index];\n visited++;\n for (const target of outgoing.get(id) ?? []) {\n const nextIncoming = (incoming.get(target) ?? 0) - 1;\n incoming.set(target, nextIncoming);\n if (nextIncoming === 0) queue.push(target);\n }\n }\n if (visited !== nodes.length) throw new Error('Query graph contains a cycle');\n}\n\nexport function createQueryGraphConnections(\n edges: QueryGraphEdge[],\n routes?: Record<string | number | symbol, Pick<TMultipointConnection, 'points' | 'labels'>>,\n): TMultipointConnection[] {\n return edges.map((edge) => ({\n id: edge.id,\n sourceBlockId: edge.source,\n targetBlockId: edge.target,\n ...routes?.[edge.id],\n }));\n}\n\nexport function getQueryGraphProgress(node: QueryGraphNode) {\n const fraction = node.progress?.fraction;\n if (typeof fraction === 'number') return Math.min(1, Math.max(0, fraction));\n const total = node.progress?.total ?? 0;\n if (total <= 0) return 0;\n return Math.min(1, Math.max(0, (node.progress?.completed ?? 0) / total));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,cAAc,GAAG,EAAE;AACzB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AC,IAAIO,KAAK,CAAC,CAAC;AAC5E","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { QueryGraphNode } from '../../../types/queryGraph';
|
|
2
|
+
export declare function getQueryGraphNodeContent(node: QueryGraphNode): {
|
|
3
|
+
readonly kind: "icon";
|
|
4
|
+
readonly value?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: "counter";
|
|
7
|
+
readonly value: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: "empty";
|
|
10
|
+
readonly value?: undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function getScaleAdjustedFontSize(fontSize: number, cameraScale: number): number;
|
|
13
|
+
export declare function fitCanvasFontSize(fontSize: number, measuredWidth: number, maxWidth: number): number;
|
|
14
|
+
export declare function fitCanvasText(context: {
|
|
15
|
+
measureText: (text: string) => {
|
|
16
|
+
width: number;
|
|
17
|
+
};
|
|
18
|
+
}, text: string, maxWidth: number, trimStart: boolean): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fitCanvasFontSize = fitCanvasFontSize;
|
|
7
|
+
exports.fitCanvasText = fitCanvasText;
|
|
8
|
+
exports.getQueryGraphNodeContent = getQueryGraphNodeContent;
|
|
9
|
+
exports.getScaleAdjustedFontSize = getScaleAdjustedFontSize;
|
|
10
|
+
require("core-js/modules/es.array.slice.js");
|
|
11
|
+
function getQueryGraphNodeContent(node) {
|
|
12
|
+
var _node$status, _node$progress;
|
|
13
|
+
var status = (_node$status = node.status) !== null && _node$status !== void 0 ? _node$status : 'not-started';
|
|
14
|
+
if (status === 'not-started') return {
|
|
15
|
+
kind: 'icon'
|
|
16
|
+
};
|
|
17
|
+
var total = (_node$progress = node.progress) === null || _node$progress === void 0 ? void 0 : _node$progress.total;
|
|
18
|
+
return typeof total === 'number' && total > 0 ? {
|
|
19
|
+
kind: 'counter',
|
|
20
|
+
value: String(total)
|
|
21
|
+
} : {
|
|
22
|
+
kind: 'empty'
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function getScaleAdjustedFontSize(fontSize, cameraScale) {
|
|
26
|
+
return cameraScale > 0 ? fontSize / cameraScale : fontSize;
|
|
27
|
+
}
|
|
28
|
+
function fitCanvasFontSize(fontSize, measuredWidth, maxWidth) {
|
|
29
|
+
if (measuredWidth <= 0 || measuredWidth <= maxWidth) return fontSize;
|
|
30
|
+
return fontSize * (maxWidth / measuredWidth);
|
|
31
|
+
}
|
|
32
|
+
function fitCanvasText(context, text, maxWidth, trimStart) {
|
|
33
|
+
if (context.measureText(text).width <= maxWidth) return text;
|
|
34
|
+
var ellipsis = '…';
|
|
35
|
+
var low = 0;
|
|
36
|
+
var high = text.length;
|
|
37
|
+
while (low < high) {
|
|
38
|
+
var length = Math.ceil((low + high) / 2);
|
|
39
|
+
var candidate = trimStart ? ellipsis + text.slice(text.length - length) : text.slice(0, length) + ellipsis;
|
|
40
|
+
if (context.measureText(candidate).width <= maxWidth) low = length;else high = length - 1;
|
|
41
|
+
}
|
|
42
|
+
return trimStart ? ellipsis + text.slice(text.length - low) : text.slice(0, low) + ellipsis;
|
|
43
|
+
}
|
|
44
|
+
// #sourceMappingURL=presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getQueryGraphNodeContent","node","_node$status","_node$progress","status","kind","total","progress","value","String","getScaleAdjustedFontSize","fontSize","cameraScale","fitCanvasFontSize","measuredWidth","maxWidth","fitCanvasText","context","text","trimStart","measureText","width","ellipsis","low","high","length","Math","ceil","candidate","slice"],"sources":["presentation.ts"],"sourcesContent":["import type {QueryGraphNode} from '../../../types/queryGraph';\n\nexport function getQueryGraphNodeContent(node: QueryGraphNode) {\n const status = node.status ?? 'not-started';\n if (status === 'not-started') return {kind: 'icon'} as const;\n const total = node.progress?.total;\n return typeof total === 'number' && total > 0\n ? ({kind: 'counter', value: String(total)} as const)\n : ({kind: 'empty'} as const);\n}\n\nexport function getScaleAdjustedFontSize(fontSize: number, cameraScale: number) {\n return cameraScale > 0 ? fontSize / cameraScale : fontSize;\n}\n\nexport function fitCanvasFontSize(fontSize: number, measuredWidth: number, maxWidth: number) {\n if (measuredWidth <= 0 || measuredWidth <= maxWidth) return fontSize;\n return fontSize * (maxWidth / measuredWidth);\n}\n\nexport function fitCanvasText(\n context: {measureText: (text: string) => {width: number}},\n text: string,\n maxWidth: number,\n trimStart: boolean,\n) {\n if (context.measureText(text).width <= maxWidth) return text;\n const ellipsis = '…';\n let low = 0;\n let high = text.length;\n while (low < high) {\n const length = Math.ceil((low + high) / 2);\n const candidate = trimStart\n ? ellipsis + text.slice(text.length - length)\n : text.slice(0, length) + ellipsis;\n if (context.measureText(candidate).width <= maxWidth) low = length;\n else high = length - 1;\n }\n return trimStart ? ellipsis + text.slice(text.length - low) : text.slice(0, low) + ellipsis;\n}\n"],"mappings":";;;;;;;;;;AAEO,SAASA,wBAAwBA,CAACC,IAAoB,EAAE;EAAA,IAAAC,YAAA,EAAAC,cAAA;EAC3D,IAAMC,MAAM,IAAAF,YAAA,GAAGD,IAAI,CAACG,MAAM,cAAAF,YAAA,cAAAA,YAAA,GAAI,aAAa;EAC3C,IAAIE,MAAM,KAAK,aAAa,EAAE,OAAO;IAACC,IAAI,EAAE;EAAM,CAAC;EACnD,IAAMC,KAAK,IAAAH,cAAA,GAAGF,IAAI,CAACM,QAAQ,cAAAJ,cAAA,uBAAbA,cAAA,CAAeG,KAAK;EAClC,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,GAAG,CAAC,GACtC;IAACD,IAAI,EAAE,SAAS;IAAEG,KAAK,EAAEC,MAAM,CAACH,KAAK;EAAC,CAAC,GACvC;IAACD,IAAI,EAAE;EAAO,CAAW;AACpC;AAEO,SAASK,wBAAwBA,CAACC,QAAgB,EAAEC,WAAmB,EAAE;EAC5E,OAA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}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
action_fit: string;
|
|
4
|
+
"action_zoom-in": string;
|
|
5
|
+
"action_zoom-out": string;
|
|
6
|
+
"action_show-graph": string;
|
|
7
|
+
"context_large-graph": string;
|
|
8
|
+
context_empty: string;
|
|
9
|
+
value_stages: string;
|
|
10
|
+
value_details: string;
|
|
11
|
+
value_jobs: string;
|
|
12
|
+
value_schemas: string;
|
|
13
|
+
field_stage: string;
|
|
14
|
+
field_duration: string;
|
|
15
|
+
field_status: string;
|
|
16
|
+
field_count: string;
|
|
17
|
+
field_name: string;
|
|
18
|
+
field_type: string;
|
|
19
|
+
value_total: string;
|
|
20
|
+
value_inputs: string;
|
|
21
|
+
value_outputs: string;
|
|
22
|
+
status_pending: string;
|
|
23
|
+
status_running: string;
|
|
24
|
+
status_completed: string;
|
|
25
|
+
status_failed: string;
|
|
26
|
+
status_aborted: string;
|
|
27
|
+
};
|
|
28
|
+
ru: {
|
|
29
|
+
action_fit: string;
|
|
30
|
+
"action_zoom-in": string;
|
|
31
|
+
"action_zoom-out": string;
|
|
32
|
+
"action_show-graph": string;
|
|
33
|
+
"context_large-graph": string;
|
|
34
|
+
context_empty: string;
|
|
35
|
+
value_stages: string;
|
|
36
|
+
value_details: string;
|
|
37
|
+
value_jobs: string;
|
|
38
|
+
value_schemas: string;
|
|
39
|
+
field_stage: string;
|
|
40
|
+
field_duration: string;
|
|
41
|
+
field_status: string;
|
|
42
|
+
field_count: string;
|
|
43
|
+
field_name: string;
|
|
44
|
+
field_type: string;
|
|
45
|
+
value_total: string;
|
|
46
|
+
value_inputs: string;
|
|
47
|
+
value_outputs: string;
|
|
48
|
+
status_pending: string;
|
|
49
|
+
status_running: string;
|
|
50
|
+
status_completed: string;
|
|
51
|
+
status_failed: string;
|
|
52
|
+
status_aborted: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _en = _interopRequireDefault(require("./en.json"));
|
|
8
|
+
var _ru = _interopRequireDefault(require("./ru.json"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = {
|
|
11
|
+
en: _en.default,
|
|
12
|
+
ru: _ru.default
|
|
13
|
+
};
|
|
14
|
+
// #sourceMappingURL=dicts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_en","_interopRequireDefault","require","_ru","e","__esModule","default","_default","exports","en","ru"],"sources":["dicts.ts"],"sourcesContent":["import en from './en.json';\nimport ru from './ru.json';\n\nexport default {en, ru};\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAS,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEM;EAACG,EAAE,EAAFA,WAAE;EAAEC,EAAE,EAAFA;AAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"action_fit": "Fit",
|
|
3
|
+
"action_zoom-in": "Zoom in",
|
|
4
|
+
"action_zoom-out": "Zoom out",
|
|
5
|
+
"action_show-graph": "Show graph",
|
|
6
|
+
"context_large-graph": "The graph contains {{count}} nodes and may take some time to render.",
|
|
7
|
+
"context_empty": "No graph data",
|
|
8
|
+
"value_stages": "Stages",
|
|
9
|
+
"value_details": "Details",
|
|
10
|
+
"value_jobs": "Jobs",
|
|
11
|
+
"value_schemas": "Schemas",
|
|
12
|
+
"field_stage": "Stage",
|
|
13
|
+
"field_duration": "Duration",
|
|
14
|
+
"field_status": "Status",
|
|
15
|
+
"field_count": "Count",
|
|
16
|
+
"field_name": "Name",
|
|
17
|
+
"field_type": "Type",
|
|
18
|
+
"value_total": "Total",
|
|
19
|
+
"value_inputs": "Inputs",
|
|
20
|
+
"value_outputs": "Outputs",
|
|
21
|
+
"status_pending": "Pending",
|
|
22
|
+
"status_running": "Running",
|
|
23
|
+
"status_completed": "Completed",
|
|
24
|
+
"status_failed": "Failed",
|
|
25
|
+
"status_aborted": "Aborted"
|
|
26
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const _default: ((key: "field_name" | "action_fit" | "action_zoom-in" | "action_zoom-out" | "action_show-graph" | "context_large-graph" | "context_empty" | "value_stages" | "value_details" | "value_jobs" | "value_schemas" | "field_stage" | "field_duration" | "field_status" | "field_count" | "field_type" | "value_total" | "value_inputs" | "value_outputs" | "status_pending" | "status_running" | "status_completed" | "status_failed" | "status_aborted", params?: import("@gravity-ui/i18n").Params) => string) & {
|
|
2
|
+
keysetData: {
|
|
3
|
+
"qp:query-graph": Record<"field_name" | "action_fit" | "action_zoom-in" | "action_zoom-out" | "action_show-graph" | "context_large-graph" | "context_empty" | "value_stages" | "value_details" | "value_jobs" | "value_schemas" | "field_stage" | "field_duration" | "field_status" | "field_count" | "field_type" | "value_total" | "value_inputs" | "value_outputs" | "status_pending" | "status_running" | "status_completed" | "status_failed" | "status_aborted", import("@gravity-ui/i18n").KeyData>;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _i18n = require("../../../i18n");
|
|
8
|
+
var _dicts = _interopRequireDefault(require("./dicts"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _i18n.addI18Keysets)('qp:query-graph', _dicts.default);
|
|
11
|
+
// #sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_dicts","_interopRequireDefault","e","__esModule","default","_default","exports","addI18Keysets","dicts"],"sources":["index.ts"],"sourcesContent":["import {addI18Keysets} from '../../../i18n';\nimport dicts from './dicts';\n\nexport default addI18Keysets('qp:query-graph', dicts);\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAY,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEG,IAAAG,mBAAa,EAAC,gBAAgB,EAAEC,cAAK,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"action_fit": "Вписать",
|
|
3
|
+
"action_zoom-in": "Приблизить",
|
|
4
|
+
"action_zoom-out": "Отдалить",
|
|
5
|
+
"action_show-graph": "Показать граф",
|
|
6
|
+
"context_large-graph": "Граф содержит {{count}} узлов, его построение может занять некоторое время.",
|
|
7
|
+
"context_empty": "Нет данных графа",
|
|
8
|
+
"value_stages": "Этапы",
|
|
9
|
+
"value_details": "Детали",
|
|
10
|
+
"value_jobs": "Задачи",
|
|
11
|
+
"value_schemas": "Схемы",
|
|
12
|
+
"field_stage": "Этап",
|
|
13
|
+
"field_duration": "Длительность",
|
|
14
|
+
"field_status": "Статус",
|
|
15
|
+
"field_count": "Количество",
|
|
16
|
+
"field_name": "Название",
|
|
17
|
+
"field_type": "Тип",
|
|
18
|
+
"value_total": "Всего",
|
|
19
|
+
"value_inputs": "Входы",
|
|
20
|
+
"value_outputs": "Выходы",
|
|
21
|
+
"status_pending": "Ожидает",
|
|
22
|
+
"status_running": "Выполняется",
|
|
23
|
+
"status_completed": "Завершено",
|
|
24
|
+
"status_failed": "Ошибка",
|
|
25
|
+
"status_aborted": "Прервано"
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "QueryGraph", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _QueryGraph.QueryGraph;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _QueryGraph = require("./QueryGraph");
|
|
13
|
+
// #sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_QueryGraph","require"],"sources":["index.ts"],"sourcesContent":["export {QueryGraph} from './QueryGraph';\nexport type {QueryGraphProps} from '../../types/queryGraph';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CanvasBlock, type TBlock } from '@gravity-ui/graph';
|
|
2
|
+
import type { QueryGraphNode } from '../../../types/queryGraph';
|
|
3
|
+
type QueryGraphBlockMeta = {
|
|
4
|
+
node: QueryGraphNode;
|
|
5
|
+
iconSvg: string;
|
|
6
|
+
fallbackIconSvg: string;
|
|
7
|
+
iconColorToken: string;
|
|
8
|
+
fallbackIconColorToken: string;
|
|
9
|
+
};
|
|
10
|
+
export type QueryGraphBlock = TBlock<QueryGraphBlockMeta>;
|
|
11
|
+
export declare class QueryGraphCanvasBlock extends CanvasBlock<QueryGraphBlock> {
|
|
12
|
+
renderMinimalisticBlock(ctx: CanvasRenderingContext2D): void;
|
|
13
|
+
renderSchematicView(ctx: CanvasRenderingContext2D): void;
|
|
14
|
+
renderDetailedView(ctx: CanvasRenderingContext2D): void;
|
|
15
|
+
private readonly redrawAfterImageLoad;
|
|
16
|
+
private renderQueryNode;
|
|
17
|
+
private drawNodeShape;
|
|
18
|
+
private drawRunningOperation;
|
|
19
|
+
private drawCounter;
|
|
20
|
+
private drawStatusIcon;
|
|
21
|
+
private drawIcon;
|
|
22
|
+
private drawLabel;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.QueryGraphCanvasBlock = void 0;
|
|
7
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
require("core-js/modules/es.array.concat.js");
|
|
13
|
+
require("core-js/modules/es.array.fill.js");
|
|
14
|
+
require("core-js/modules/es.array.for-each.js");
|
|
15
|
+
require("core-js/modules/es.array.iterator.js");
|
|
16
|
+
require("core-js/modules/es.array.join.js");
|
|
17
|
+
require("core-js/modules/es.function.name.js");
|
|
18
|
+
require("core-js/modules/es.iterator.constructor.js");
|
|
19
|
+
require("core-js/modules/es.iterator.for-each.js");
|
|
20
|
+
require("core-js/modules/es.map.js");
|
|
21
|
+
require("core-js/modules/es.object.to-string.js");
|
|
22
|
+
require("core-js/modules/es.set.js");
|
|
23
|
+
require("core-js/modules/es.set.difference.v2.js");
|
|
24
|
+
require("core-js/modules/es.set.intersection.v2.js");
|
|
25
|
+
require("core-js/modules/es.set.is-disjoint-from.v2.js");
|
|
26
|
+
require("core-js/modules/es.set.is-subset-of.v2.js");
|
|
27
|
+
require("core-js/modules/es.set.is-superset-of.v2.js");
|
|
28
|
+
require("core-js/modules/es.set.symmetric-difference.v2.js");
|
|
29
|
+
require("core-js/modules/es.set.union.v2.js");
|
|
30
|
+
require("core-js/modules/es.string.iterator.js");
|
|
31
|
+
require("core-js/modules/es.string.trim.js");
|
|
32
|
+
require("core-js/modules/esnext.map.get-or-insert.js");
|
|
33
|
+
require("core-js/modules/esnext.map.get-or-insert-computed.js");
|
|
34
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
35
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
36
|
+
var _graph = require("@gravity-ui/graph");
|
|
37
|
+
var _layout = require("../helpers/layout");
|
|
38
|
+
var _presentation = require("../helpers/presentation");
|
|
39
|
+
var _queryGraphIcons = require("./queryGraphIcons");
|
|
40
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
41
|
+
/* eslint-disable no-param-reassign -- CanvasRenderingContext2D exposes drawing state as mutable properties. */
|
|
42
|
+
|
|
43
|
+
var imageCache = new Map();
|
|
44
|
+
var statusTokens = {
|
|
45
|
+
'not-started': ['--g-color-line-generic', '--g-color-base-float'],
|
|
46
|
+
waiting: ['--g-color-text-misc-heavy', '--g-color-base-misc-light'],
|
|
47
|
+
running: ['--g-color-line-generic', '--g-color-line-generic'],
|
|
48
|
+
completed: ['--g-color-text-positive-heavy', '--g-color-base-positive-light'],
|
|
49
|
+
failed: ['--g-color-text-danger-heavy', '--g-color-base-danger-light'],
|
|
50
|
+
aborted: ['--g-color-text-complementary', '--g-color-base-generic']
|
|
51
|
+
};
|
|
52
|
+
var statusIconTokens = {
|
|
53
|
+
running: '--g-color-text-info',
|
|
54
|
+
completed: '--g-color-text-positive-heavy',
|
|
55
|
+
failed: '--g-color-text-danger-heavy',
|
|
56
|
+
aborted: '--g-color-text-complementary'
|
|
57
|
+
};
|
|
58
|
+
var resourceTokens = ['--g-color-line-generic', '--g-color-base-float'];
|
|
59
|
+
var START_ANGLE = -Math.PI / 2;
|
|
60
|
+
var STATUS_ICON_SIZE_RATIO = 1 / 4;
|
|
61
|
+
var STATUS_ICON_BACKGROUND_RADIUS_RATIO = 1 / 6;
|
|
62
|
+
var PROGRESS_WIDTH_RATIO = 1 / 9;
|
|
63
|
+
var INNER_BORDER_WIDTH_RATIO = 1 / 25;
|
|
64
|
+
var COUNTER_MAX_WIDTH_RATIO = 7 / 9;
|
|
65
|
+
var LABEL_MAX_WIDTH_RATIO = 2;
|
|
66
|
+
var COUNTER_FONT_SIZE = 11;
|
|
67
|
+
var LABEL_FONT_SIZE = 9;
|
|
68
|
+
var LABEL_GAP = 4;
|
|
69
|
+
var RESOURCE_ICON_SIZE = 16;
|
|
70
|
+
function cssValue(token, element) {
|
|
71
|
+
if (typeof document === 'undefined') return '';
|
|
72
|
+
return getComputedStyle(element !== null && element !== void 0 ? element : document.documentElement).getPropertyValue(token).trim();
|
|
73
|
+
}
|
|
74
|
+
function coloredSvgDataUrl(svg, color) {
|
|
75
|
+
var markup = svg.split('currentColor').join(color || '#000');
|
|
76
|
+
return "data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(markup));
|
|
77
|
+
}
|
|
78
|
+
function getCanvasImage(svg, color, onSettled) {
|
|
79
|
+
if (typeof Image === 'undefined') return undefined;
|
|
80
|
+
var key = "".concat(color, "\n").concat(svg);
|
|
81
|
+
var entry = imageCache.get(key);
|
|
82
|
+
if (!entry) {
|
|
83
|
+
var image = new Image();
|
|
84
|
+
entry = {
|
|
85
|
+
image: image,
|
|
86
|
+
state: 'loading',
|
|
87
|
+
listeners: new Set()
|
|
88
|
+
};
|
|
89
|
+
imageCache.set(key, entry);
|
|
90
|
+
image.onload = function () {
|
|
91
|
+
if (!entry) return;
|
|
92
|
+
entry.state = 'loaded';
|
|
93
|
+
entry.listeners.forEach(function (listener) {
|
|
94
|
+
return listener();
|
|
95
|
+
});
|
|
96
|
+
entry.listeners.clear();
|
|
97
|
+
};
|
|
98
|
+
image.onerror = function () {
|
|
99
|
+
if (!entry) return;
|
|
100
|
+
entry.state = 'failed';
|
|
101
|
+
entry.listeners.forEach(function (listener) {
|
|
102
|
+
return listener();
|
|
103
|
+
});
|
|
104
|
+
entry.listeners.clear();
|
|
105
|
+
};
|
|
106
|
+
image.src = coloredSvgDataUrl(svg, color);
|
|
107
|
+
}
|
|
108
|
+
if (entry.state === 'loading') entry.listeners.add(onSettled);
|
|
109
|
+
return entry;
|
|
110
|
+
}
|
|
111
|
+
var QueryGraphCanvasBlock = exports.QueryGraphCanvasBlock = /*#__PURE__*/function (_CanvasBlock) {
|
|
112
|
+
function QueryGraphCanvasBlock() {
|
|
113
|
+
var _this;
|
|
114
|
+
(0, _classCallCheck2.default)(this, QueryGraphCanvasBlock);
|
|
115
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
116
|
+
args[_key] = arguments[_key];
|
|
117
|
+
}
|
|
118
|
+
_this = (0, _callSuper2.default)(this, QueryGraphCanvasBlock, [].concat(args));
|
|
119
|
+
_this.redrawAfterImageLoad = function () {
|
|
120
|
+
return _this.performRender();
|
|
121
|
+
};
|
|
122
|
+
return _this;
|
|
123
|
+
}
|
|
124
|
+
(0, _inherits2.default)(QueryGraphCanvasBlock, _CanvasBlock);
|
|
125
|
+
return (0, _createClass2.default)(QueryGraphCanvasBlock, [{
|
|
126
|
+
key: "renderMinimalisticBlock",
|
|
127
|
+
value: function renderMinimalisticBlock(ctx) {
|
|
128
|
+
this.renderQueryNode(ctx);
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "renderSchematicView",
|
|
132
|
+
value: function renderSchematicView(ctx) {
|
|
133
|
+
this.renderQueryNode(ctx);
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
key: "renderDetailedView",
|
|
137
|
+
value: function renderDetailedView(ctx) {
|
|
138
|
+
this.renderQueryNode(ctx);
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "renderQueryNode",
|
|
142
|
+
value: function renderQueryNode(context) {
|
|
143
|
+
var _node$status, _node$label;
|
|
144
|
+
var meta = this.state.meta;
|
|
145
|
+
if (!(meta !== null && meta !== void 0 && meta.node)) return;
|
|
146
|
+
var node = meta.node;
|
|
147
|
+
var status = (_node$status = node.status) !== null && _node$status !== void 0 ? _node$status : 'not-started';
|
|
148
|
+
var _ref = node.kind === 'operation' ? statusTokens[status] : resourceTokens,
|
|
149
|
+
_ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
150
|
+
lineToken = _ref2[0],
|
|
151
|
+
baseToken = _ref2[1];
|
|
152
|
+
context.save();
|
|
153
|
+
if (node.kind === 'operation' && status === 'running') {
|
|
154
|
+
this.drawRunningOperation(context, (0, _layout.getQueryGraphProgress)(node));
|
|
155
|
+
} else {
|
|
156
|
+
this.drawNodeShape(context, lineToken, baseToken);
|
|
157
|
+
}
|
|
158
|
+
var content = (0, _presentation.getQueryGraphNodeContent)(node);
|
|
159
|
+
if (content.kind === 'icon') {
|
|
160
|
+
var _this$state = this.state,
|
|
161
|
+
x = _this$state.x,
|
|
162
|
+
y = _this$state.y,
|
|
163
|
+
width = _this$state.width,
|
|
164
|
+
height = _this$state.height;
|
|
165
|
+
var side = node.kind === 'operation' ? width / 2 : RESOURCE_ICON_SIZE;
|
|
166
|
+
this.drawIcon(context, meta.iconSvg, meta.fallbackIconSvg, x + (width - side) / 2, y + (height - side) / 2, side, cssValue(meta.iconColorToken, context.canvas), cssValue(meta.fallbackIconColorToken, context.canvas));
|
|
167
|
+
} else if (content.kind === 'counter') {
|
|
168
|
+
this.drawCounter(context, content.value);
|
|
169
|
+
}
|
|
170
|
+
if (node.kind === 'operation') this.drawStatusIcon(context, status);
|
|
171
|
+
this.drawLabel(context, (_node$label = node.label) !== null && _node$label !== void 0 ? _node$label : node.name, node.kind !== 'operation');
|
|
172
|
+
context.restore();
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
key: "drawNodeShape",
|
|
176
|
+
value: function drawNodeShape(context, lineToken, baseToken) {
|
|
177
|
+
var _this$state2 = this.state,
|
|
178
|
+
x = _this$state2.x,
|
|
179
|
+
y = _this$state2.y,
|
|
180
|
+
width = _this$state2.width,
|
|
181
|
+
height = _this$state2.height,
|
|
182
|
+
meta = _this$state2.meta;
|
|
183
|
+
context.beginPath();
|
|
184
|
+
if ((meta === null || meta === void 0 ? void 0 : meta.node.kind) === 'operation') {
|
|
185
|
+
context.arc(x + width / 2, y + height / 2, width / 2 - 1, 0, Math.PI * 2);
|
|
186
|
+
} else {
|
|
187
|
+
context.roundRect(x + 1, y + 1, width - 2, height - 2, 12);
|
|
188
|
+
}
|
|
189
|
+
context.fillStyle = cssValue(baseToken, context.canvas);
|
|
190
|
+
context.fill();
|
|
191
|
+
context.lineWidth = 2;
|
|
192
|
+
context.strokeStyle = cssValue(lineToken, context.canvas);
|
|
193
|
+
context.stroke();
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
key: "drawRunningOperation",
|
|
197
|
+
value: function drawRunningOperation(context, progress) {
|
|
198
|
+
var _this$state3 = this.state,
|
|
199
|
+
x = _this$state3.x,
|
|
200
|
+
y = _this$state3.y,
|
|
201
|
+
width = _this$state3.width,
|
|
202
|
+
height = _this$state3.height;
|
|
203
|
+
var centerX = x + width / 2;
|
|
204
|
+
var centerY = y + height / 2;
|
|
205
|
+
var radius = width / 2;
|
|
206
|
+
var progressWidth = width * PROGRESS_WIDTH_RATIO;
|
|
207
|
+
var endAngle = START_ANGLE + Math.PI * 2 * progress;
|
|
208
|
+
var runningBase = cssValue('--g-color-line-generic', context.canvas);
|
|
209
|
+
var runningLine = cssValue('--g-color-line-generic', context.canvas);
|
|
210
|
+
var progressBase = cssValue('--g-color-base-info-light', context.canvas);
|
|
211
|
+
var progressLine = cssValue('--g-color-text-info', context.canvas);
|
|
212
|
+
var background = cssValue('--g-color-base-background', context.canvas);
|
|
213
|
+
context.beginPath();
|
|
214
|
+
context.arc(centerX, centerY, radius - progressWidth / 2, 0, Math.PI * 2);
|
|
215
|
+
context.fillStyle = runningBase;
|
|
216
|
+
context.fill();
|
|
217
|
+
context.lineWidth = progressWidth;
|
|
218
|
+
context.strokeStyle = runningLine;
|
|
219
|
+
context.stroke();
|
|
220
|
+
if (progress > 0) {
|
|
221
|
+
context.beginPath();
|
|
222
|
+
context.moveTo(centerX, centerY);
|
|
223
|
+
context.arc(centerX, centerY, radius - progressWidth / 2, START_ANGLE, endAngle);
|
|
224
|
+
context.closePath();
|
|
225
|
+
context.fillStyle = progressBase;
|
|
226
|
+
context.fill();
|
|
227
|
+
context.beginPath();
|
|
228
|
+
context.arc(centerX, centerY, radius - progressWidth / 2, START_ANGLE, endAngle);
|
|
229
|
+
context.lineWidth = progressWidth;
|
|
230
|
+
context.strokeStyle = progressLine;
|
|
231
|
+
context.stroke();
|
|
232
|
+
}
|
|
233
|
+
context.beginPath();
|
|
234
|
+
context.arc(centerX, centerY, radius - progressWidth, 0, Math.PI * 2);
|
|
235
|
+
context.lineWidth = width * INNER_BORDER_WIDTH_RATIO;
|
|
236
|
+
context.strokeStyle = background;
|
|
237
|
+
context.stroke();
|
|
238
|
+
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "drawCounter",
|
|
241
|
+
value: function drawCounter(context, value) {
|
|
242
|
+
var _this$state4 = this.state,
|
|
243
|
+
x = _this$state4.x,
|
|
244
|
+
y = _this$state4.y,
|
|
245
|
+
width = _this$state4.width,
|
|
246
|
+
height = _this$state4.height;
|
|
247
|
+
var maxFontSize = (0, _presentation.getScaleAdjustedFontSize)(COUNTER_FONT_SIZE, this.context.graph.cameraService.getCameraScale());
|
|
248
|
+
var fontFamily = cssValue('--g-font-family-sans', context.canvas);
|
|
249
|
+
context.fillStyle = cssValue('--g-color-text-primary', context.canvas);
|
|
250
|
+
context.textAlign = 'center';
|
|
251
|
+
context.textBaseline = 'middle';
|
|
252
|
+
context.font = "500 ".concat(maxFontSize, "px ").concat(fontFamily);
|
|
253
|
+
var fontSize = (0, _presentation.fitCanvasFontSize)(maxFontSize, context.measureText(value).width, width * COUNTER_MAX_WIDTH_RATIO);
|
|
254
|
+
context.font = "500 ".concat(fontSize, "px ").concat(fontFamily);
|
|
255
|
+
context.fillText(value, x + width / 2, y + height / 2);
|
|
256
|
+
}
|
|
257
|
+
}, {
|
|
258
|
+
key: "drawStatusIcon",
|
|
259
|
+
value: function drawStatusIcon(context, status) {
|
|
260
|
+
var iconSvg = (0, _queryGraphIcons.getQueryGraphStatusIconSvg)(status);
|
|
261
|
+
var colorToken = statusIconTokens[status];
|
|
262
|
+
if (!iconSvg || !colorToken) return;
|
|
263
|
+
var _this$state5 = this.state,
|
|
264
|
+
x = _this$state5.x,
|
|
265
|
+
y = _this$state5.y,
|
|
266
|
+
width = _this$state5.width;
|
|
267
|
+
var side = width * STATUS_ICON_SIZE_RATIO;
|
|
268
|
+
var backgroundRadius = width * STATUS_ICON_BACKGROUND_RADIUS_RATIO;
|
|
269
|
+
var iconX = x + width - side;
|
|
270
|
+
var iconY = y;
|
|
271
|
+
context.beginPath();
|
|
272
|
+
context.arc(iconX + side / 2, iconY + side / 2, backgroundRadius, 0, Math.PI * 2);
|
|
273
|
+
context.fillStyle = cssValue('--g-color-base-background', context.canvas);
|
|
274
|
+
context.fill();
|
|
275
|
+
this.drawIcon(context, iconSvg, iconSvg, iconX, iconY, side, cssValue(colorToken, context.canvas), cssValue(colorToken, context.canvas));
|
|
276
|
+
}
|
|
277
|
+
}, {
|
|
278
|
+
key: "drawIcon",
|
|
279
|
+
value: function drawIcon(context, svg, fallbackSvg, x, y, side, color, fallbackColor) {
|
|
280
|
+
var _entry, _entry2;
|
|
281
|
+
var entry = getCanvasImage(svg, color, this.redrawAfterImageLoad);
|
|
282
|
+
if (((_entry = entry) === null || _entry === void 0 ? void 0 : _entry.state) === 'failed' && fallbackSvg !== svg) {
|
|
283
|
+
entry = getCanvasImage(fallbackSvg, fallbackColor, this.redrawAfterImageLoad);
|
|
284
|
+
}
|
|
285
|
+
if (((_entry2 = entry) === null || _entry2 === void 0 ? void 0 : _entry2.state) === 'loaded') context.drawImage(entry.image, x, y, side, side);
|
|
286
|
+
}
|
|
287
|
+
}, {
|
|
288
|
+
key: "drawLabel",
|
|
289
|
+
value: function drawLabel(context, label, trimStart) {
|
|
290
|
+
var _this$state6 = this.state,
|
|
291
|
+
x = _this$state6.x,
|
|
292
|
+
y = _this$state6.y,
|
|
293
|
+
width = _this$state6.width,
|
|
294
|
+
height = _this$state6.height;
|
|
295
|
+
var cameraScale = this.context.graph.cameraService.getCameraScale();
|
|
296
|
+
var fontSize = (0, _presentation.getScaleAdjustedFontSize)(LABEL_FONT_SIZE, cameraScale);
|
|
297
|
+
var labelGap = (0, _presentation.getScaleAdjustedFontSize)(LABEL_GAP, cameraScale);
|
|
298
|
+
context.fillStyle = cssValue('--g-color-text-primary', context.canvas);
|
|
299
|
+
context.textAlign = 'center';
|
|
300
|
+
context.textBaseline = 'top';
|
|
301
|
+
context.font = "400 ".concat(fontSize, "px ").concat(cssValue('--g-font-family-sans', context.canvas));
|
|
302
|
+
var fitted = (0, _presentation.fitCanvasText)(context, label, width * LABEL_MAX_WIDTH_RATIO, trimStart);
|
|
303
|
+
context.fillText(fitted, x + width / 2, y + height + labelGap);
|
|
304
|
+
}
|
|
305
|
+
}]);
|
|
306
|
+
}(_graph.CanvasBlock);
|
|
307
|
+
// #sourceMappingURL=QueryGraphCanvasBlock.js.map
|