@databiosphere/findable-ui 23.0.0 → 25.0.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/.release-please-manifest.json +1 -1
- package/.storybook/preview.js +4 -37
- package/CHANGELOG.md +64 -0
- package/jest.config.js +1 -0
- package/lib/common/entities.d.ts +1 -0
- package/lib/components/DataDictionary/components/Entities/constants.d.ts +2 -2
- package/lib/components/DataDictionary/components/Entities/constants.js +1 -1
- package/lib/components/DataDictionary/components/Entities/entities.js +3 -3
- package/lib/components/DataDictionary/components/Entity/constants.d.ts +2 -2
- package/lib/components/DataDictionary/components/Entity/constants.js +1 -1
- package/lib/components/DataDictionary/components/Entity/entity.js +4 -4
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +8 -0
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +36 -0
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.js +1 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.js +2 -2
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
- package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.js +2 -2
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +17 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.d.ts +13 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.js +12 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.d.ts +9 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +9 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.js +86 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +105 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +196 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.js +7 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.js +29 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.d.ts +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.d.ts +4 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.js +70 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.d.ts +7 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.js +19 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.d.ts +6 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/constants.d.ts +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/constants.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.d.ts +7 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.js +11 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.js +96 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.d.ts +6 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.js +16 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +6 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/utils.d.ts +14 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/utils.js +21 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.js +16 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/types.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/components/EntityList/types.js +1 -0
- package/lib/components/Index/components/EntitiesView/constants.d.ts +1 -0
- package/lib/components/Index/components/EntitiesView/constants.js +1 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.js +14 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.styles.d.ts +3 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.styles.js +20 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.js +14 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.d.ts +13 -0
- package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.js +5 -0
- package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.d.ts +8 -0
- package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.js +50 -0
- package/lib/components/Index/components/EntitiesView/types.d.ts +8 -0
- package/lib/components/Index/components/EntitiesView/types.js +1 -0
- package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +5 -16
- package/lib/components/Index/components/NTagCell/nTagCell.stories.js +8 -8
- package/lib/components/Index/components/TitleCell/titleCell.d.ts +6 -0
- package/lib/components/Index/components/TitleCell/titleCell.js +10 -0
- package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +3 -0
- package/lib/components/Index/components/TitleCell/titleCell.styles.js +6 -0
- package/lib/components/Index/index.d.ts +2 -13
- package/lib/components/Index/index.js +6 -2
- package/lib/components/Index/index.stories.js +3 -2
- package/lib/components/Index/types.d.ts +12 -0
- package/lib/components/Index/types.js +1 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.d.ts +1 -1
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.js +5 -4
- package/lib/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.d.ts +6 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.js +18 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.js +3 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +29 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +6 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +13 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +36 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +9 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Menu/components/Toolbar/toolbar.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Menu/menu.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.js +5 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.d.ts +5 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.js +4 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +10 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +36 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +9 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +2 -2
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +5 -0
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +19 -0
- package/lib/components/Layout/components/Outline/common/constants.d.ts +2 -0
- package/lib/components/Layout/components/Outline/common/constants.js +1 -0
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Layout/components/Sidebar/components/SidebarButton/sidebarButton.js +2 -2
- package/lib/components/Loading/loading.d.ts +2 -1
- package/lib/components/Loading/loading.js +2 -2
- package/lib/components/Loading/loading.stories.d.ts +3 -31
- package/lib/components/Login/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Login/components/Section/components/Consent/consent.js +3 -3
- package/lib/components/Login/components/Section/components/Consent/consent.styles.d.ts +1 -1
- package/lib/components/Login/components/Section/components/Consent/consent.styles.js +2 -2
- package/lib/components/Login/components/Section/components/Consent/types.d.ts +2 -2
- package/lib/components/Login/login.stories.d.ts +6 -0
- package/lib/components/Login/login.stories.js +31 -0
- package/lib/components/NoResults/noResults.d.ts +1 -8
- package/lib/components/NoResults/noResults.js +9 -8
- package/lib/components/NoResults/noResults.styles.d.ts +2 -2
- package/lib/components/NoResults/noResults.styles.js +4 -2
- package/lib/components/NoResults/types.d.ts +8 -0
- package/lib/components/NoResults/types.js +1 -0
- package/lib/components/Plot/components/BarX/barX.d.ts +2 -0
- package/lib/components/Plot/components/BarX/barX.js +13 -0
- package/lib/components/Plot/components/BarX/types.d.ts +5 -0
- package/lib/components/Plot/components/BarX/types.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.js +7 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.js +17 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.js +8 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.js +15 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.js +4 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/constants.d.ts +1 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/constants.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.js +27 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.d.ts +9 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.js +38 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.js +11 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.js +9 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.js +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.d.ts +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.js +20 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.d.ts +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.js +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.d.ts +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.js +21 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.js +5 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/constants.js +8 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.js +12 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.d.ts +4 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.js +15 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.d.ts +8 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.js +37 -0
- package/lib/components/Stepper/components/Step/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/constants.js +4 -0
- package/lib/components/Stepper/components/Step/step.d.ts +3 -0
- package/lib/components/Stepper/components/Step/step.js +6 -0
- package/lib/components/Stepper/components/Step/step.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/step.styles.js +31 -0
- package/lib/components/Stepper/components/Step/stories/contants.d.ts +4 -0
- package/lib/components/Stepper/components/Step/stories/contants.js +14 -0
- package/lib/components/Stepper/components/Step/stories/step.stories.d.ts +8 -0
- package/lib/components/Stepper/components/Step/stories/step.stories.js +62 -0
- package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.js +2 -2
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +16 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +28 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +5 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +46 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +3 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +21 -0
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +2 -0
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +37 -0
- package/lib/components/Table/components/Pagination/pagination.js +3 -4
- package/lib/components/Table/components/TableHead/tableHead.js +2 -2
- package/lib/components/Table/table.js +11 -11
- package/lib/components/TableCreator/common/constants.d.ts +6 -0
- package/lib/components/TableCreator/common/constants.js +19 -0
- package/lib/components/TableCreator/common/entities.d.ts +5 -0
- package/lib/components/TableCreator/common/entities.js +1 -0
- package/lib/components/TableCreator/tableCreator.js +1 -6
- package/lib/components/common/Alert/alert.stories.d.ts +6 -0
- package/lib/components/common/Alert/alert.stories.js +36 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +4 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +19 -0
- package/lib/components/common/AnchorLink/anchorLink.js +2 -2
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +7 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +5 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +3 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +19 -0
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +10 -0
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +16 -0
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +3 -0
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +21 -0
- package/lib/components/common/Breadcrumbs/breadcrumbs.js +2 -2
- package/lib/components/common/Breadcrumbs/typeGuard.d.ts +13 -0
- package/lib/components/common/Breadcrumbs/typeGuard.js +23 -0
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.js +2 -2
- package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +3 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.js +6 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +7 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +11 -0
- package/lib/components/common/Button/components/NavigationButton/navigationButton.js +2 -2
- package/lib/components/common/CopyToClipboard/copyToClipboard.js +2 -2
- package/lib/components/common/Dialog/components/DialogTitle/dialogTitle.js +2 -2
- package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.js +2 -2
- package/lib/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.d.ts +2 -3
- package/lib/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.js +3 -3
- package/lib/components/common/Form/components/UploadFile/uploadFile.js +2 -2
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +5 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +10 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +3 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +9 -0
- package/lib/components/common/IconButton/iconButton.styles.d.ts +1 -1
- package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.d.ts +2 -5
- package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.js +6 -2
- package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.d.ts +2 -5
- package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.js +6 -2
- package/lib/components/common/LoginDialog/loginDialog.styles.js +1 -1
- package/lib/components/common/Paper/paper.d.ts +2 -1
- package/lib/components/common/Paper/paper.js +2 -2
- package/lib/components/common/Section/components/CollapsableSection/collapsableSection.js +2 -3
- package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.d.ts +2 -0
- package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.js +10 -0
- package/lib/components/types.d.ts +3 -0
- package/lib/config/entities.d.ts +2 -0
- package/lib/hooks/useAuthentication/common/constants.d.ts +4 -0
- package/lib/hooks/useAuthentication/common/constants.js +19 -0
- package/lib/hooks/useAuthentication/common/entities.d.ts +25 -0
- package/lib/hooks/useAuthentication/common/entities.js +11 -0
- package/lib/hooks/useAuthentication/common/utils.d.ts +15 -0
- package/lib/hooks/useAuthentication/common/utils.js +25 -0
- package/lib/hooks/useAuthentication/useAuthentication.d.ts +6 -0
- package/lib/hooks/useAuthentication/useAuthentication.js +9 -0
- package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +6 -0
- package/lib/hooks/useAuthentication/useAuthenticationComplete.js +55 -0
- package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +20 -0
- package/lib/hooks/useAuthentication/useAuthenticationForm.js +88 -0
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +18 -0
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +50 -0
- package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +20 -0
- package/lib/hooks/useAuthentication/useAuthenticationStatus.js +32 -0
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +21 -0
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +41 -0
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +18 -0
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +62 -0
- package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +24 -0
- package/lib/hooks/useAuthentication/useFetchTerraProfile.js +62 -0
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +15 -0
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +62 -0
- package/lib/hooks/useAuthentication/useTokenClient.d.ts +11 -0
- package/lib/hooks/useAuthentication/useTokenClient.js +29 -0
- package/lib/hooks/useAuthenticationConfig.d.ts +6 -0
- package/lib/hooks/useAuthenticationConfig.js +14 -0
- package/lib/hooks/useCategoryConfigs.d.ts +6 -0
- package/lib/hooks/useCategoryConfigs.js +17 -0
- package/lib/hooks/useCategoryFilter.js +1 -0
- package/lib/hooks/useEntityListRelatedView.d.ts +15 -0
- package/lib/hooks/useEntityListRelatedView.js +62 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +15 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +27 -0
- package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +5 -0
- package/lib/hooks/useFileManifest/useFileManifestURL.js +11 -0
- package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +9 -0
- package/lib/hooks/useFileManifest/useRequestFileManifest.js +37 -0
- package/lib/hooks/useLayoutState.d.ts +6 -0
- package/lib/hooks/useLayoutState.js +9 -0
- package/lib/hooks/useMenu.d.ts +10 -0
- package/lib/hooks/useMenu.js +17 -0
- package/lib/hooks/useMenuWithPosition.d.ts +14 -0
- package/lib/hooks/useMenuWithPosition.js +33 -0
- package/lib/hooks/useResizeObserver.d.ts +2 -1
- package/lib/hooks/useResizeObserver.js +5 -2
- package/lib/hooks/useSessionTimeout.d.ts +11 -0
- package/lib/hooks/useSessionTimeout.js +28 -0
- package/lib/providers/authentication.d.ts +51 -0
- package/lib/providers/authentication.js +110 -0
- package/lib/providers/layoutState.d.ts +40 -0
- package/lib/providers/layoutState.js +47 -0
- package/lib/storybook/controls/constants.d.ts +4 -0
- package/lib/storybook/controls/constants.js +6 -0
- package/lib/storybook/controls/types.d.ts +4 -0
- package/lib/storybook/controls/types.js +5 -0
- package/lib/storybook/controls/utils.d.ts +9 -0
- package/lib/storybook/controls/utils.js +10 -0
- package/lib/storybook/decorators.d.ts +2 -0
- package/lib/storybook/decorators.js +11 -0
- package/lib/storybook/loremIpsum.d.ts +4 -0
- package/lib/storybook/loremIpsum.js +4 -0
- package/lib/storybook/parameters.d.ts +2 -0
- package/lib/storybook/parameters.js +12 -0
- package/lib/styles/common/mui/palette.d.ts +47 -0
- package/lib/styles/common/mui/palette.js +47 -0
- package/lib/styles/common/mui/stepper.d.ts +7 -0
- package/lib/styles/common/mui/stepper.js +7 -0
- package/lib/styles/common/mui/svgIcon.d.ts +9 -0
- package/lib/styles/common/mui/svgIcon.js +26 -0
- package/lib/styles/common/mui/typography.js +1 -0
- package/lib/tests/mui/constants.d.ts +4 -0
- package/lib/tests/mui/constants.js +4 -0
- package/lib/theme/common/typography.d.ts +6 -2
- package/lib/theme/common/typography.js +10 -1
- package/lib/theme/theme.js +2 -0
- package/lib/utils/tests.d.ts +12 -0
- package/lib/utils/tests.js +20 -0
- package/lib/views/ExploreView/exploreView.js +4 -24
- package/package.json +6 -4
- package/src/common/entities.ts +1 -0
- package/src/components/DataDictionary/components/Entities/constants.ts +2 -2
- package/src/components/DataDictionary/components/Entities/entities.tsx +4 -4
- package/src/components/DataDictionary/components/Entity/constants.ts +2 -2
- package/src/components/DataDictionary/components/Entity/entity.tsx +6 -6
- package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.tsx +1 -1
- package/src/components/Filter/components/FilterLabel/filterLabel.tsx +2 -2
- package/src/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.tsx +2 -2
- package/src/components/Index/components/EntitiesView/components/ChartView/chartView.styles.ts +14 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/chartView.tsx +38 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.ts +13 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.ts +104 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.ts +229 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.ts +30 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.tsx +16 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.ts +1 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.ts +74 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.tsx +29 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.ts +9 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/constants.ts +1 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.ts +8 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.ts +29 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/stories/args.ts +99 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.tsx +25 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/types.ts +7 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/utils.ts +26 -0
- package/src/components/Index/components/EntitiesView/components/EntityList/entityList.tsx +29 -0
- package/src/components/Index/components/EntitiesView/components/EntityList/types.ts +3 -0
- package/src/components/Index/components/EntitiesView/constants.ts +1 -0
- package/src/components/Index/components/EntitiesView/entitiesView.styles.ts +21 -0
- package/src/components/Index/components/EntitiesView/entitiesView.tsx +30 -0
- package/src/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.ts +15 -0
- package/src/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.ts +16 -0
- package/src/components/Index/components/EntitiesView/stories/entitiesView.stories.tsx +76 -0
- package/src/components/Index/components/EntitiesView/types.ts +9 -0
- package/src/components/Index/index.stories.tsx +3 -2
- package/src/components/Index/index.tsx +15 -15
- package/src/components/Index/types.ts +13 -0
- package/src/components/Layout/components/BackPage/components/BackPageHero/backPageHero.tsx +19 -14
- package/src/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.tsx +24 -0
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.tsx +3 -3
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Menu/components/Toolbar/toolbar.tsx +2 -2
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Menu/menu.tsx +2 -2
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.ts +8 -3
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.tsx +5 -2
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.tsx +2 -2
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +2 -2
- package/src/components/Layout/components/Sidebar/components/SidebarButton/sidebarButton.tsx +2 -2
- package/src/components/Loading/loading.stories.tsx +2 -2
- package/src/components/Loading/loading.tsx +11 -3
- package/src/components/Login/components/Section/components/Consent/consent.styles.ts +2 -2
- package/src/components/Login/components/Section/components/Consent/consent.tsx +4 -4
- package/src/components/Login/components/Section/components/Consent/types.ts +2 -2
- package/src/components/NoResults/noResults.styles.ts +4 -2
- package/src/components/NoResults/noResults.tsx +16 -22
- package/src/components/NoResults/types.ts +13 -0
- package/src/components/Plot/components/BarX/barX.tsx +20 -0
- package/src/components/Plot/components/BarX/types.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepContent/stepContent.styles.ts +18 -0
- package/src/components/Stepper/components/Step/components/StepContent/stepContent.tsx +16 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.ts +19 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.tsx +20 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepIcon/constants.ts +1 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.ts +32 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.tsx +21 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.tsx +52 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.ts +14 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.tsx +13 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.tsx +30 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/constants.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.tsx +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.tsx +31 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.ts +7 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.tsx +9 -0
- package/src/components/Stepper/components/Step/components/StepLabel/constants.ts +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.ts +13 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.tsx +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stories/contants.ts +19 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.tsx +48 -0
- package/src/components/Stepper/components/Step/constants.ts +6 -0
- package/src/components/Stepper/components/Step/step.styles.ts +33 -0
- package/src/components/Stepper/components/Step/step.tsx +12 -0
- package/src/components/Stepper/components/Step/stories/contants.ts +18 -0
- package/src/components/Stepper/components/Step/stories/step.stories.tsx +87 -0
- package/src/components/Support/components/SupportRequest/components/Dialog/dialog.tsx +2 -2
- package/src/components/Table/components/Pagination/pagination.tsx +3 -4
- package/src/components/Table/components/TableHead/tableHead.tsx +2 -2
- package/src/components/Table/table.tsx +42 -38
- package/src/components/TableCreator/tableCreator.tsx +8 -18
- package/src/components/common/AnchorLink/anchorLink.tsx +2 -2
- package/src/components/common/Breadcrumbs/breadcrumbs.tsx +2 -2
- package/src/components/common/Breadcrumbs/typeGuard.ts +24 -0
- package/src/components/common/Button/components/DropdownButton/dropdownButton.tsx +2 -2
- package/src/components/common/Button/components/NavigationButton/navigationButton.tsx +2 -2
- package/src/components/common/CopyToClipboard/copyToClipboard.tsx +2 -2
- package/src/components/common/Dialog/components/DialogTitle/dialogTitle.tsx +2 -2
- package/src/components/common/Drawer/components/DrawerTitle/drawerTitle.tsx +2 -2
- package/src/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.tsx +5 -6
- package/src/components/common/Form/components/UploadFile/uploadFile.tsx +2 -2
- package/src/components/common/KeyValuePairs/components/KeyElType/keyElType.tsx +14 -9
- package/src/components/common/KeyValuePairs/components/ValueElType/valueElType.tsx +8 -9
- package/src/components/common/LoginDialog/loginDialog.styles.ts +1 -1
- package/src/components/common/Paper/paper.tsx +9 -3
- package/src/components/common/Section/components/CollapsableSection/collapsableSection.tsx +2 -3
- package/src/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.ts +17 -0
- package/src/components/types.ts +4 -0
- package/src/config/entities.ts +2 -0
- package/src/hooks/useCategoryFilter.ts +1 -0
- package/src/hooks/useResizeObserver.ts +5 -2
- package/src/storybook/controls/constants.ts +12 -0
- package/src/storybook/controls/types.ts +4 -0
- package/src/storybook/controls/utils.ts +18 -0
- package/src/storybook/decorators.tsx +17 -0
- package/src/storybook/loremIpsum.ts +5 -0
- package/src/storybook/parameters.ts +14 -0
- package/src/styles/common/mui/palette.ts +47 -0
- package/src/styles/common/mui/stepper.ts +14 -0
- package/src/styles/common/mui/svgIcon.ts +35 -0
- package/src/styles/common/mui/typography.ts +1 -0
- package/src/tests/mui/constants.ts +4 -0
- package/src/theme/common/typography.ts +12 -1
- package/src/theme/theme.ts +2 -0
- package/src/utils/tests.ts +20 -0
- package/src/views/ExploreView/exploreView.tsx +8 -42
- package/tests/chart.test.tsx +170 -0
- package/tests/chartView.test.tsx +36 -0
- package/tests/entitiesView.test.tsx +36 -0
- package/tests/setup.ts +19 -0
- package/tests/stepIcon.test.tsx +42 -0
- package/types/data-explorer-ui.d.ts +39 -80
- package/src/components/Index/components/Cell/cell.tsx +0 -22
- package/src/components/Index/components/NTag/components/Tooltip/tooltip.styles.ts +0 -11
- package/src/components/Index/components/NTag/components/Tooltip/tooltip.tsx +0 -90
- package/src/components/Index/components/NTag/nTag.tsx +0 -25
- package/src/components/Index/components/NTagCell/nTagCell.stories.tsx +0 -22
- package/src/components/Index/components/NTagCell/nTagCell.tsx +0 -74
- package/src/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.tsx +0 -16
- package/src/components/TableCreator/tableCreator.styles.ts +0 -5
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { PALETTE } from "../../../../../../../../../styles/common/mui/palette";
|
|
2
|
+
import { BAR_GAP, BAR_HEIGHT, TEXT_PADDING, TICKS } from "./constants";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the text for the category value point.
|
|
5
|
+
* @param d - Data point.
|
|
6
|
+
* @returns Formatted text string.
|
|
7
|
+
*/
|
|
8
|
+
export function getCategoryValueText(d) {
|
|
9
|
+
if (d.selected)
|
|
10
|
+
return `${d.label} (selected)`;
|
|
11
|
+
return d.label;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns the fill color for the category value point.
|
|
15
|
+
* @param d - Data point.
|
|
16
|
+
* @param isCategorySelected - Flag indicating if any value is selected.
|
|
17
|
+
* @returns Fill color string.
|
|
18
|
+
*/
|
|
19
|
+
export function getCategoryValueTextFill(d, isCategorySelected) {
|
|
20
|
+
if (d.selected)
|
|
21
|
+
return PALETTE.INK_MAIN;
|
|
22
|
+
if (isCategorySelected)
|
|
23
|
+
return PALETTE.INK_LIGHT;
|
|
24
|
+
return PALETTE.INK_MAIN;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns the color range value for "false" (unselected).
|
|
28
|
+
* @param isCategorySelected - Flag indicating if any value is selected.
|
|
29
|
+
* @returns Color range value.
|
|
30
|
+
*/
|
|
31
|
+
export function getColorRangeValue(isCategorySelected) {
|
|
32
|
+
return isCategorySelected ? PALETTE.SMOKE_LIGHT : "#C5E3FC";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns the fill color for the count point.
|
|
36
|
+
* @param d - Data point.
|
|
37
|
+
* @param isCategorySelected - Flag indicating if any value is selected.
|
|
38
|
+
* @returns Fill color string.
|
|
39
|
+
*/
|
|
40
|
+
export function getCountTextFill(d, isCategorySelected) {
|
|
41
|
+
if (d.selected)
|
|
42
|
+
return PALETTE.COMMON_WHITE;
|
|
43
|
+
if (isCategorySelected)
|
|
44
|
+
return PALETTE.SMOKE_DARK;
|
|
45
|
+
return PALETTE.INK_MAIN;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Calculates the total SVG height required to render a horizontal bar chart (barX).
|
|
49
|
+
* The computed height includes:
|
|
50
|
+
* - Padding space equivalent to one bar above the first and below the last bar,
|
|
51
|
+
* - Vertical gaps between bars,
|
|
52
|
+
* - A fixed bottom margin.
|
|
53
|
+
* @param numberOfBars - Number of bars to display.
|
|
54
|
+
* @returns Height.
|
|
55
|
+
*/
|
|
56
|
+
export function getPlotHeight(numberOfBars) {
|
|
57
|
+
return (numberOfBars + 2) * BAR_HEIGHT + (numberOfBars - 1) * BAR_GAP + 32;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Rounds up a number to the next "nice" stop value for axis scaling.
|
|
61
|
+
* This function returns an upper bound based on the input value's
|
|
62
|
+
* order of magnitude. It calculates axis limits or tick maximums
|
|
63
|
+
* for consistent and readable chart scales.
|
|
64
|
+
* The function applies standard magnitude-based steps:
|
|
65
|
+
* - Rounds up to 2.5×, 5×, 7.5×, or 10× the base magnitude
|
|
66
|
+
* - Ensures minimum stop of 10
|
|
67
|
+
* @param n - Number.
|
|
68
|
+
* @returns A rounded "nice" stop value suitable for axis ticks.
|
|
69
|
+
*/
|
|
70
|
+
export function getStop(n) {
|
|
71
|
+
if (n <= 10)
|
|
72
|
+
return 10;
|
|
73
|
+
// Calculate the magnitude e.g. 10, 100, 1000
|
|
74
|
+
const magnitude = Math.pow(10, Math.floor(Math.log10(n)));
|
|
75
|
+
for (const multiplier of [1, 2.5, 5, 7.5, 10]) {
|
|
76
|
+
if (n <= magnitude * multiplier) {
|
|
77
|
+
return magnitude * multiplier;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return magnitude * 10;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns the ticks for the x-axis.
|
|
84
|
+
* @param data - Data.
|
|
85
|
+
* @returns Ticks.
|
|
86
|
+
*/
|
|
87
|
+
export function getTicks(data) {
|
|
88
|
+
const domain = getXDomain(data);
|
|
89
|
+
return getXRange(domain[0], domain[1]);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns the `x` domain.
|
|
93
|
+
* @param data - Data.
|
|
94
|
+
* @returns Domain.
|
|
95
|
+
*/
|
|
96
|
+
export function getXDomain(data) {
|
|
97
|
+
const max = Math.max(...data.map((d) => d.count));
|
|
98
|
+
return [0, getStop(max)];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Generates an evenly spaced numeric range between a start and stop value.
|
|
102
|
+
* The range includes a fixed number of steps (6), where each value is spaced
|
|
103
|
+
* by a step size derived from the adjusted stop value via `getStop`.
|
|
104
|
+
* Used for grid lines along the x-axis.
|
|
105
|
+
* @param start - Start value.
|
|
106
|
+
* @param stop - Stop value.
|
|
107
|
+
* @returns Range.
|
|
108
|
+
*/
|
|
109
|
+
export function getXRange(start, stop) {
|
|
110
|
+
const ticks = [];
|
|
111
|
+
const steps = TICKS;
|
|
112
|
+
const step = getStop(stop) / (steps - 1);
|
|
113
|
+
for (let i = 0; i < steps; i++) {
|
|
114
|
+
ticks.push(start + i * step);
|
|
115
|
+
}
|
|
116
|
+
return ticks;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Calculates the inner padding ratio for a band scale's y-axis.
|
|
120
|
+
* This determines the proportional spacing between adjacent bars in a bar chart.
|
|
121
|
+
* @returns The inner padding value as a fraction (between 0 and 1).
|
|
122
|
+
*/
|
|
123
|
+
export function getYPaddingInner() {
|
|
124
|
+
return BAR_GAP / (BAR_HEIGHT + BAR_GAP);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Calculates the outer padding ratio for a band scale's y-axis.
|
|
128
|
+
* This represents the proportional space above the first bar and below the last bar
|
|
129
|
+
* in a vertical layout. It ensures that the outer margins are visually balanced and
|
|
130
|
+
* match the bar height, so the chart breathes evenly at the top and bottom.
|
|
131
|
+
* @returns The outer padding value as a fraction (between 0 and 1).
|
|
132
|
+
*/
|
|
133
|
+
export function getYPaddingOuter() {
|
|
134
|
+
return BAR_HEIGHT / (BAR_HEIGHT + BAR_GAP);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Checks if any value in the data array is selected.
|
|
138
|
+
* @param data - Data.
|
|
139
|
+
* @returns True if any value is selected, false otherwise.
|
|
140
|
+
*/
|
|
141
|
+
export function isAnyValueSelected(data) {
|
|
142
|
+
return data.some(({ selected }) => selected);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Parses a transform `translate` string and returns the x and y coordinates.
|
|
146
|
+
* @param translate - The transform `translate` string.
|
|
147
|
+
* @returns A tuple of the x and y coordinates.
|
|
148
|
+
*/
|
|
149
|
+
function parseTranslate(translate) {
|
|
150
|
+
const match = translate?.match(/translate\(\s*([-\d.]+)[,\s]+([-\d.]+)\s*\)/);
|
|
151
|
+
let tx = 0;
|
|
152
|
+
let ty = 0;
|
|
153
|
+
if (match) {
|
|
154
|
+
tx = parseFloat(match[1]);
|
|
155
|
+
ty = parseFloat(match[2]);
|
|
156
|
+
}
|
|
157
|
+
return [tx, ty];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Renders text elements for count values, positioning them either inside or outside bars
|
|
161
|
+
* based on available space. If text doesn't fit inside a bar, it's repositioned outside
|
|
162
|
+
* with adjusted styling.
|
|
163
|
+
* @param index - The mark's (filtered and transformed) index.
|
|
164
|
+
* @param scales - The plot's scale functions.
|
|
165
|
+
* @param values - The mark's (possibly scaled and transformed) channel values.
|
|
166
|
+
* @param dimensions - The plot's dimensions.
|
|
167
|
+
* @param context - The plot's context.
|
|
168
|
+
* @param next - The next render function in the chain.
|
|
169
|
+
* @returns SVG element or null
|
|
170
|
+
*/
|
|
171
|
+
export function renderText(index, scales, values, dimensions, context, next) {
|
|
172
|
+
const g = next?.(index, scales, values, dimensions, context);
|
|
173
|
+
if (!g)
|
|
174
|
+
return null;
|
|
175
|
+
requestAnimationFrame(() => {
|
|
176
|
+
const textEls = g.querySelectorAll("text");
|
|
177
|
+
for (const textEl of textEls) {
|
|
178
|
+
const ctm = textEl.getCTM();
|
|
179
|
+
const bBox = textEl.getBBox();
|
|
180
|
+
if (!ctm || !bBox)
|
|
181
|
+
continue;
|
|
182
|
+
// If the text doesn't fit inside the bar, reposition it outside.
|
|
183
|
+
if (ctm.e - bBox.width - TEXT_PADDING < 0) {
|
|
184
|
+
const [tx, ty] = parseTranslate(textEl.getAttribute("transform"));
|
|
185
|
+
// Translate by the width of the bar plus padding on each side.
|
|
186
|
+
textEl.setAttribute("transform", `translate(${tx + bBox.width + TEXT_PADDING * 2}, ${ty})`);
|
|
187
|
+
// If the text fill is white, change it to ink.
|
|
188
|
+
const fill = textEl.getAttribute("fill");
|
|
189
|
+
if (fill === PALETTE.COMMON_WHITE) {
|
|
190
|
+
textEl.setAttribute("fill", PALETTE.INK_MAIN);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
return g;
|
|
196
|
+
}
|
package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { getPlotOptions } from "./barX/plot";
|
|
3
|
+
import { StyledBarX } from "./chart.styles";
|
|
4
|
+
export const Chart = ({ selectCategoryValueViews, testId, width, }) => {
|
|
5
|
+
const options = useMemo(() => getPlotOptions(selectCategoryValueViews, width), [selectCategoryValueViews, width]);
|
|
6
|
+
return React.createElement(StyledBarX, { options: options, testId: testId });
|
|
7
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { mediaTabletDown } from "../../../../../../../../styles/common/mixins/breakpoints";
|
|
3
|
+
import { textBodySmall400 } from "../../../../../../../../styles/common/mixins/fonts";
|
|
4
|
+
import { BarX } from "../../../../../../../Plot/components/BarX/barX";
|
|
5
|
+
export const StyledBarX = styled(BarX) `
|
|
6
|
+
${textBodySmall400};
|
|
7
|
+
|
|
8
|
+
svg {
|
|
9
|
+
g.x-axis {
|
|
10
|
+
text {
|
|
11
|
+
&:nth-of-type(1) {
|
|
12
|
+
text-anchor: start;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:nth-last-of-type(1) {
|
|
16
|
+
text-anchor: end;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
${mediaTabletDown} {
|
|
20
|
+
display: none;
|
|
21
|
+
&:nth-of-type(1),
|
|
22
|
+
&:nth-last-of-type(1) {
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHART_TEST_ID = "chart";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CHART_TEST_ID = "chart";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const CHART_ARGS = {
|
|
2
|
+
selectCategoryValueViews: [
|
|
3
|
+
{
|
|
4
|
+
count: 248890,
|
|
5
|
+
key: "female",
|
|
6
|
+
label: "female",
|
|
7
|
+
selected: false,
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
count: 204935,
|
|
11
|
+
key: "male",
|
|
12
|
+
label: "male",
|
|
13
|
+
selected: false,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
count: 240,
|
|
17
|
+
key: "mixed",
|
|
18
|
+
label: "mixed",
|
|
19
|
+
selected: false,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
count: 78715,
|
|
23
|
+
key: "unknown",
|
|
24
|
+
label: "unknown",
|
|
25
|
+
selected: false,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
count: 1561,
|
|
29
|
+
key: null,
|
|
30
|
+
label: "Unspecified",
|
|
31
|
+
selected: false,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
width: 800,
|
|
35
|
+
};
|
|
36
|
+
export const SELECT_CHART_ARGS = {
|
|
37
|
+
selectCategoryValueViews: [
|
|
38
|
+
{
|
|
39
|
+
count: 248890,
|
|
40
|
+
key: "female",
|
|
41
|
+
label: "female",
|
|
42
|
+
selected: false,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
count: 204935,
|
|
46
|
+
key: "male",
|
|
47
|
+
label: "male",
|
|
48
|
+
selected: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
count: 240,
|
|
52
|
+
key: "mixed",
|
|
53
|
+
label: "mixed",
|
|
54
|
+
selected: false,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
count: 78715,
|
|
58
|
+
key: "unknown",
|
|
59
|
+
label: "unknown",
|
|
60
|
+
selected: false,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
count: 1561,
|
|
64
|
+
key: null,
|
|
65
|
+
label: "Unspecified",
|
|
66
|
+
selected: true,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
width: 800,
|
|
70
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Chart } from "../chart";
|
|
3
|
+
declare const meta: Meta<typeof Chart>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Selected: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Box } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PALETTE } from "../../../../../../../../../styles/common/mui/palette";
|
|
4
|
+
import { Chart } from "../chart";
|
|
5
|
+
import { CHART_ARGS, SELECT_CHART_ARGS } from "./args";
|
|
6
|
+
const meta = {
|
|
7
|
+
args: CHART_ARGS,
|
|
8
|
+
component: Chart,
|
|
9
|
+
decorators: [
|
|
10
|
+
(Story, context) => (React.createElement(Box, { sx: { backgroundColor: PALETTE.COMMON_WHITE, padding: 5 } },
|
|
11
|
+
React.createElement(Story, { ...context }))),
|
|
12
|
+
],
|
|
13
|
+
title: "Components/Entities/EntitiesView/ChartView/Chart",
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
export const Default = {};
|
|
17
|
+
export const Selected = {
|
|
18
|
+
args: SELECT_CHART_ARGS,
|
|
19
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PlotOptions } from "@observablehq/plot";
|
|
2
|
+
import { SelectCategoryValueView } from "../../../../../../../../common/entities";
|
|
3
|
+
import { TestIdProps } from "../../../../../../../types";
|
|
4
|
+
export interface ChartProps extends Required<Pick<PlotOptions, "width">>, TestIdProps {
|
|
5
|
+
selectCategoryValueViews: SelectCategoryValueView[];
|
|
6
|
+
}
|
package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHART_VIEW_TEST_ID = "chart-view";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CHART_VIEW_TEST_ID = "chart-view";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useMemo, useRef } from "react";
|
|
2
|
+
import { getBorderBoxSize, useResizeObserver, } from "../../../../../../../../hooks/useResizeObserver";
|
|
3
|
+
import { getSelectCategoryViews, getSVGWidth } from "../../utils";
|
|
4
|
+
export const useChartView = (categoryFilters) => {
|
|
5
|
+
const chartViewRef = useRef(null);
|
|
6
|
+
const selectCategoryViews = useMemo(() => getSelectCategoryViews(categoryFilters), [categoryFilters]);
|
|
7
|
+
const shouldObserve = useMemo(() => selectCategoryViews.length > 0, [selectCategoryViews]);
|
|
8
|
+
const chartViewRect = useResizeObserver(chartViewRef, getBorderBoxSize, shouldObserve);
|
|
9
|
+
const width = getSVGWidth(chartViewRect?.width);
|
|
10
|
+
return { chartViewRef, selectCategoryViews, width };
|
|
11
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export const CHART_VIEW_ARGS = {
|
|
2
|
+
categoryFilters: [
|
|
3
|
+
{
|
|
4
|
+
categoryViews: [
|
|
5
|
+
{
|
|
6
|
+
enableChartView: true,
|
|
7
|
+
key: "biological-sex",
|
|
8
|
+
label: "Biological Sex",
|
|
9
|
+
values: [
|
|
10
|
+
{
|
|
11
|
+
count: 248890,
|
|
12
|
+
key: "female",
|
|
13
|
+
label: "female",
|
|
14
|
+
selected: false,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
count: 204935,
|
|
18
|
+
key: "male",
|
|
19
|
+
label: "male",
|
|
20
|
+
selected: false,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
count: 240,
|
|
24
|
+
key: "mixed",
|
|
25
|
+
label: "mixed",
|
|
26
|
+
selected: false,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
count: 78715,
|
|
30
|
+
key: "unknown",
|
|
31
|
+
label: "unknown",
|
|
32
|
+
selected: false,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
count: 1561,
|
|
36
|
+
key: null,
|
|
37
|
+
label: "Unspecified",
|
|
38
|
+
selected: false,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
enableChartView: true,
|
|
44
|
+
key: "genusSpecies",
|
|
45
|
+
label: "Genus Species",
|
|
46
|
+
values: [
|
|
47
|
+
{
|
|
48
|
+
count: 824,
|
|
49
|
+
key: "canis lupus familiaris",
|
|
50
|
+
label: "canis lupus familiaris",
|
|
51
|
+
selected: false,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
count: 243550,
|
|
55
|
+
key: "Homo sapiens",
|
|
56
|
+
label: "Homo sapiens",
|
|
57
|
+
selected: false,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
count: 277513,
|
|
61
|
+
key: "Mus musculus",
|
|
62
|
+
label: "Mus musculus",
|
|
63
|
+
selected: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
count: 1292,
|
|
67
|
+
key: null,
|
|
68
|
+
label: "Unspecified",
|
|
69
|
+
selected: false,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
enableChartView: false,
|
|
75
|
+
key: "pairedEnd",
|
|
76
|
+
label: "Paired End",
|
|
77
|
+
values: [
|
|
78
|
+
{
|
|
79
|
+
count: 148558,
|
|
80
|
+
key: "false",
|
|
81
|
+
label: "false",
|
|
82
|
+
selected: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
count: 366376,
|
|
86
|
+
key: "true",
|
|
87
|
+
label: "true",
|
|
88
|
+
selected: false,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
loading: false,
|
|
96
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GridPaper } from "../../../../../../common/Paper/paper.styles";
|
|
3
|
+
import { ChartView } from "../chartView";
|
|
4
|
+
import { CHART_VIEW_ARGS } from "./args";
|
|
5
|
+
const meta = {
|
|
6
|
+
args: CHART_VIEW_ARGS,
|
|
7
|
+
component: ChartView,
|
|
8
|
+
decorators: [
|
|
9
|
+
(Story, context) => (React.createElement(GridPaper, null,
|
|
10
|
+
React.createElement(Story, { ...context }))),
|
|
11
|
+
],
|
|
12
|
+
parameters: { layout: "fullscreen" },
|
|
13
|
+
title: "Components/Entities/EntitiesView/ChartView",
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
export const Default = {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SelectCategoryView } from "../../../../../../common/entities";
|
|
2
|
+
import { CategoryFilter } from "../../../../../Filter/components/Filters/filters";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the set of select category views that have chart view enabled.
|
|
5
|
+
* @param categoryFilters - Category filters.
|
|
6
|
+
* @returns Set of category views with chart view enabled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSelectCategoryViews(categoryFilters: CategoryFilter[]): SelectCategoryView[];
|
|
9
|
+
/**
|
|
10
|
+
* Returns the available SVG `width` from the container width.
|
|
11
|
+
* @param width - View width.
|
|
12
|
+
* @returns width.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSVGWidth(width?: number): number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the set of select category views that have chart view enabled.
|
|
3
|
+
* @param categoryFilters - Category filters.
|
|
4
|
+
* @returns Set of category views with chart view enabled.
|
|
5
|
+
*/
|
|
6
|
+
export function getSelectCategoryViews(categoryFilters) {
|
|
7
|
+
return categoryFilters
|
|
8
|
+
.flatMap(({ categoryViews }) => categoryViews)
|
|
9
|
+
.filter(({ enableChartView = true }) => enableChartView)
|
|
10
|
+
.filter(({ values }) => values.length > 0);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns the available SVG `width` from the container width.
|
|
14
|
+
* @param width - View width.
|
|
15
|
+
* @returns width.
|
|
16
|
+
*/
|
|
17
|
+
export function getSVGWidth(width) {
|
|
18
|
+
if (!width)
|
|
19
|
+
return 0;
|
|
20
|
+
return width - 40; // 20px padding on each side.
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useConfig } from "../../../../../../hooks/useConfig";
|
|
3
|
+
import { useExploreState } from "../../../../../../hooks/useExploreState";
|
|
4
|
+
import { TableCreator } from "../../../../../TableCreator/tableCreator";
|
|
5
|
+
export const EntityList = ({ entityListType, }) => {
|
|
6
|
+
const { entityConfig } = useConfig();
|
|
7
|
+
const { exploreState } = useExploreState();
|
|
8
|
+
const { listItems, loading } = exploreState;
|
|
9
|
+
const { getId: getRowId, list, listView } = entityConfig;
|
|
10
|
+
const { columns: columnsConfig } = list;
|
|
11
|
+
// required currently for client-side fetching as the pre-rendered page
|
|
12
|
+
// loads with the previous tabs data on the first render after switching tabs. (or similar)
|
|
13
|
+
if (entityListType !== exploreState.tabValue)
|
|
14
|
+
return null;
|
|
15
|
+
return (React.createElement(TableCreator, { columns: columnsConfig, getRowId: getRowId, items: listItems ?? [], listView: listView, loading: loading }));
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ENTITIES_VIEW_TEST_ID = "entities-view";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ENTITIES_VIEW_TEST_ID = "entities-view";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ToggleButton, ToggleButtonGroup, Toolbar } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { GridPaper } from "../../../common/Paper/paper.styles";
|
|
4
|
+
import { StyledFluidPaper } from "./entitiesView.styles";
|
|
5
|
+
import { VIEW_MODE } from "./hooks/UseEntitiesView/types";
|
|
6
|
+
export const EntitiesView = ({ children, onChange, testId, viewMode, viewStatus, }) => {
|
|
7
|
+
return (React.createElement(StyledFluidPaper, { testId: testId },
|
|
8
|
+
React.createElement(GridPaper, null,
|
|
9
|
+
viewStatus.disabled ? null : (React.createElement(Toolbar, null,
|
|
10
|
+
React.createElement(ToggleButtonGroup, { exclusive: true, value: viewMode, onChange: onChange },
|
|
11
|
+
React.createElement(ToggleButton, { value: VIEW_MODE.TABLE }, "Table View"),
|
|
12
|
+
React.createElement(ToggleButton, { value: VIEW_MODE.CHART }, "Chart View")))),
|
|
13
|
+
children)));
|
|
14
|
+
};
|