@databiosphere/findable-ui 46.1.3 → 47.0.2

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.
Files changed (288) hide show
  1. package/.eslintrc.json +2 -1
  2. package/.github/copilot-instructions.md +176 -0
  3. package/.github/workflows/release-please.yml +8 -4
  4. package/.github/workflows/run-checks.yml +2 -2
  5. package/.release-please-manifest.json +1 -1
  6. package/CHANGELOG.md +26 -0
  7. package/README.md +4 -10
  8. package/docs/TRUSTED_PUBLISHING.md +133 -0
  9. package/lib/common/utils.js +1 -1
  10. package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +6 -0
  11. package/lib/components/DataDictionary/components/Table/columns/columnDef.js +33 -0
  12. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +5 -0
  13. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +5 -0
  14. package/lib/components/DataDictionary/components/Table/columns/types.d.ts +2 -0
  15. package/lib/components/DataDictionary/components/Table/columns/types.js +1 -0
  16. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +4 -0
  17. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +1 -0
  18. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +4 -0
  19. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +23 -0
  20. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +8 -0
  21. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.js +1 -0
  22. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.d.ts +2 -0
  23. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.js +10 -0
  24. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.d.ts +7 -0
  25. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.js +1 -0
  26. package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +8 -0
  27. package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +36 -0
  28. package/lib/components/Filter/components/Filter/filter.stories.d.ts +25 -0
  29. package/lib/components/Filter/components/Filter/filter.stories.js +42 -0
  30. package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +16 -0
  31. package/lib/components/Filter/components/FilterTag/filterTag.stories.js +17 -0
  32. package/lib/components/Filter/components/Filters/filters.stories.d.ts +6 -0
  33. package/lib/components/Filter/components/Filters/filters.stories.js +91 -0
  34. package/lib/components/Filter/components/SearchAllFilters/components/AutocompletePopper/autocompletePopper.styles.d.ts +3 -0
  35. package/lib/components/Filter/components/SearchAllFilters/components/AutocompletePopper/autocompletePopper.styles.js +15 -0
  36. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.stories.d.ts +6 -0
  37. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.stories.js +82 -0
  38. package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.d.ts +1 -0
  39. package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.js +14 -0
  40. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.d.ts +2 -0
  41. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.js +12 -0
  42. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.d.ts +5 -0
  43. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.js +34 -0
  44. package/lib/components/Index/components/Cell/cell.d.ts +7 -0
  45. package/lib/components/Index/components/Cell/cell.js +10 -0
  46. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +2 -0
  47. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +20 -0
  48. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.d.ts +13 -0
  49. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.js +12 -0
  50. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.d.ts +10 -0
  51. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +10 -0
  52. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.d.ts +3 -0
  53. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.js +91 -0
  54. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +132 -0
  55. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +230 -0
  56. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.d.ts +2 -0
  57. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.js +7 -0
  58. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.d.ts +3 -0
  59. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.js +29 -0
  60. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.d.ts +1 -0
  61. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.js +1 -0
  62. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.d.ts +4 -0
  63. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.js +70 -0
  64. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.d.ts +7 -0
  65. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.js +18 -0
  66. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.d.ts +6 -0
  67. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.js +1 -0
  68. package/lib/components/Index/components/EntitiesView/components/ChartView/constants.d.ts +1 -0
  69. package/lib/components/Index/components/EntitiesView/components/ChartView/constants.js +1 -0
  70. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.d.ts +7 -0
  71. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.js +1 -0
  72. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.d.ts +3 -0
  73. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.js +11 -0
  74. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.d.ts +3 -0
  75. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.js +97 -0
  76. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.d.ts +6 -0
  77. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.js +15 -0
  78. package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +8 -0
  79. package/lib/components/Index/components/EntitiesView/components/ChartView/types.js +1 -0
  80. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.d.ts +14 -0
  81. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.js +23 -0
  82. package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.d.ts +3 -0
  83. package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.js +14 -0
  84. package/lib/components/Index/components/EntitiesView/components/EntityList/types.d.ts +6 -0
  85. package/lib/components/Index/components/EntitiesView/components/EntityList/types.js +1 -0
  86. package/lib/components/Index/components/EntitiesView/constants.d.ts +1 -0
  87. package/lib/components/Index/components/EntitiesView/constants.js +1 -0
  88. package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +2 -0
  89. package/lib/components/Index/components/EntitiesView/entitiesView.js +15 -0
  90. package/lib/components/Index/components/EntitiesView/entitiesView.styles.d.ts +3 -0
  91. package/lib/components/Index/components/EntitiesView/entitiesView.styles.js +20 -0
  92. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.d.ts +2 -0
  93. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.js +14 -0
  94. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.d.ts +13 -0
  95. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.js +5 -0
  96. package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.d.ts +8 -0
  97. package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.js +50 -0
  98. package/lib/components/Index/components/EntitiesView/types.d.ts +8 -0
  99. package/lib/components/Index/components/EntitiesView/types.js +1 -0
  100. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.d.ts +1 -0
  101. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.js +13 -0
  102. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.styles.d.ts +3 -0
  103. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.styles.js +13 -0
  104. package/lib/components/Index/components/Hero/components/Summaries/stories/summaries.stories.d.ts +6 -0
  105. package/lib/components/Index/components/Hero/components/Summaries/stories/summaries.stories.js +14 -0
  106. package/lib/components/Index/components/Hero/components/Summaries/summaries.d.ts +9 -0
  107. package/lib/components/Index/components/Hero/components/Summaries/summaries.js +12 -0
  108. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +13 -0
  109. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +18 -0
  110. package/lib/components/Index/components/Hero/components/Summaries/summaries.styles.d.ts +7 -0
  111. package/lib/components/Index/components/Hero/components/Summaries/summaries.styles.js +26 -0
  112. package/lib/components/Index/components/Hero/hero.d.ts +11 -0
  113. package/lib/components/Index/components/Hero/hero.js +12 -0
  114. package/lib/components/Index/components/Hero/hero.stories.d.ts +23 -0
  115. package/lib/components/Index/components/Hero/hero.stories.js +22 -0
  116. package/lib/components/Index/components/Hero/hero.styles.d.ts +16 -0
  117. package/lib/components/Index/components/Hero/hero.styles.js +44 -0
  118. package/lib/components/Index/components/Hero/stories/hero.stories.d.ts +6 -0
  119. package/lib/components/Index/components/Hero/stories/hero.stories.js +16 -0
  120. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +8 -0
  121. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +57 -0
  122. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +4 -0
  123. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +10 -0
  124. package/lib/components/Index/components/NTag/nTag.d.ts +10 -0
  125. package/lib/components/Index/components/NTag/nTag.js +8 -0
  126. package/lib/components/Index/components/NTagCell/nTagCell.d.ts +11 -0
  127. package/lib/components/Index/components/NTagCell/nTagCell.js +29 -0
  128. package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +5 -0
  129. package/lib/components/Index/components/NTagCell/nTagCell.stories.js +16 -0
  130. package/lib/components/Index/components/Tabs/common/utils.d.ts +8 -0
  131. package/lib/components/Index/components/Tabs/common/utils.js +19 -0
  132. package/lib/components/Index/components/Tabs/tabs.d.ts +1 -0
  133. package/lib/components/Index/components/Tabs/tabs.js +20 -0
  134. package/lib/components/Index/components/TitleCell/titleCell.d.ts +6 -0
  135. package/lib/components/Index/components/TitleCell/titleCell.js +10 -0
  136. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +3 -0
  137. package/lib/components/Index/components/TitleCell/titleCell.styles.js +6 -0
  138. package/lib/components/Index/index.stories.d.ts +6 -0
  139. package/lib/components/Index/index.stories.js +26 -0
  140. package/lib/components/Index/stories/index.stories.d.ts +6 -0
  141. package/lib/components/Index/stories/index.stories.js +17 -0
  142. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +6 -0
  143. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +10 -0
  144. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +5 -0
  145. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +29 -0
  146. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +6 -0
  147. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +13 -0
  148. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +36 -0
  149. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +9 -0
  150. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +5 -0
  151. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +10 -0
  152. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +36 -0
  153. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +9 -0
  154. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +5 -0
  155. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +19 -0
  156. package/lib/components/Layout/components/Outline/common/constants.d.ts +2 -0
  157. package/lib/components/Layout/components/Outline/common/constants.js +1 -0
  158. package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +1 -1
  159. package/lib/components/Login/login.stories.d.ts +6 -0
  160. package/lib/components/Login/login.stories.js +31 -0
  161. package/lib/components/Redirect/redirect.js +6 -1
  162. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +16 -0
  163. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +28 -0
  164. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +5 -0
  165. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +46 -0
  166. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +3 -0
  167. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +21 -0
  168. package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.d.ts +6 -0
  169. package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.js +17 -0
  170. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +2 -0
  171. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +37 -0
  172. package/lib/components/Table/components/Pagination/pagination.d.ts +9 -0
  173. package/lib/components/Table/components/Pagination/pagination.js +19 -0
  174. package/lib/components/Table/components/Pagination/pagination.stories.d.ts +28 -0
  175. package/lib/components/Table/components/Pagination/pagination.stories.js +24 -0
  176. package/lib/components/Table/components/Pagination/pagination.styles.d.ts +4 -0
  177. package/lib/components/Table/components/Pagination/pagination.styles.js +15 -0
  178. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.d.ts +3 -0
  179. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.js +3 -0
  180. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.d.ts +8 -0
  181. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.js +18 -0
  182. package/lib/components/Table/components/TableBody/hooks/virtualizer/types.d.ts +4 -0
  183. package/lib/components/Table/components/TableBody/hooks/virtualizer/types.js +1 -0
  184. package/lib/components/Table/components/TableBody/utils.d.ts +12 -0
  185. package/lib/components/Table/components/TableBody/utils.js +17 -0
  186. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.d.ts +3 -0
  187. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.js +1 -0
  188. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.d.ts +3 -0
  189. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.js +1 -0
  190. package/lib/components/TableCreator/common/constants.d.ts +6 -0
  191. package/lib/components/TableCreator/common/constants.js +19 -0
  192. package/lib/components/TableCreator/common/entities.d.ts +5 -0
  193. package/lib/components/TableCreator/common/entities.js +1 -0
  194. package/lib/components/TableCreator/tableCreator.styles.d.ts +4 -0
  195. package/lib/components/TableCreator/tableCreator.styles.js +4 -0
  196. package/lib/components/common/Alert/alert.stories.d.ts +6 -0
  197. package/lib/components/common/Alert/alert.stories.js +36 -0
  198. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +4 -0
  199. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +19 -0
  200. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +7 -0
  201. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +5 -0
  202. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +3 -0
  203. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +19 -0
  204. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +10 -0
  205. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +16 -0
  206. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +3 -0
  207. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +21 -0
  208. package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +3 -0
  209. package/lib/components/common/Button/components/LoginButton/loginButton.js +6 -0
  210. package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +7 -0
  211. package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +11 -0
  212. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +5 -0
  213. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +10 -0
  214. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +3 -0
  215. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +9 -0
  216. package/lib/components/common/ToggleButtonGroup/toggleButtonGroup.js +2 -1
  217. package/lib/hooks/useAuthentication/common/constants.d.ts +4 -0
  218. package/lib/hooks/useAuthentication/common/constants.js +19 -0
  219. package/lib/hooks/useAuthentication/common/entities.d.ts +25 -0
  220. package/lib/hooks/useAuthentication/common/entities.js +11 -0
  221. package/lib/hooks/useAuthentication/common/utils.d.ts +15 -0
  222. package/lib/hooks/useAuthentication/common/utils.js +25 -0
  223. package/lib/hooks/useAuthentication/useAuthentication.d.ts +6 -0
  224. package/lib/hooks/useAuthentication/useAuthentication.js +9 -0
  225. package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +6 -0
  226. package/lib/hooks/useAuthentication/useAuthenticationComplete.js +55 -0
  227. package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +20 -0
  228. package/lib/hooks/useAuthentication/useAuthenticationForm.js +88 -0
  229. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +18 -0
  230. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +50 -0
  231. package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +20 -0
  232. package/lib/hooks/useAuthentication/useAuthenticationStatus.js +32 -0
  233. package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +21 -0
  234. package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +41 -0
  235. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +18 -0
  236. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +62 -0
  237. package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +24 -0
  238. package/lib/hooks/useAuthentication/useFetchTerraProfile.js +62 -0
  239. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +15 -0
  240. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +62 -0
  241. package/lib/hooks/useAuthentication/useTokenClient.d.ts +11 -0
  242. package/lib/hooks/useAuthentication/useTokenClient.js +29 -0
  243. package/lib/hooks/useAuthenticationConfig.d.ts +6 -0
  244. package/lib/hooks/useAuthenticationConfig.js +14 -0
  245. package/lib/hooks/useCategoryConfigs.d.ts +6 -0
  246. package/lib/hooks/useCategoryConfigs.js +17 -0
  247. package/lib/hooks/useEntityListRelatedView.d.ts +15 -0
  248. package/lib/hooks/useEntityListRelatedView.js +62 -0
  249. package/lib/hooks/useExploreMode.d.ts +14 -0
  250. package/lib/hooks/useExploreMode.js +20 -0
  251. package/lib/hooks/useFileLocation.js +1 -1
  252. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +15 -0
  253. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +27 -0
  254. package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +5 -0
  255. package/lib/hooks/useFileManifest/useFileManifestURL.js +11 -0
  256. package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +9 -0
  257. package/lib/hooks/useFileManifest/useRequestFileManifest.js +37 -0
  258. package/lib/hooks/useLayoutState.d.ts +6 -0
  259. package/lib/hooks/useLayoutState.js +9 -0
  260. package/lib/hooks/useMenu.d.ts +10 -0
  261. package/lib/hooks/useMenu.js +17 -0
  262. package/lib/hooks/useMenuWithPosition.d.ts +14 -0
  263. package/lib/hooks/useMenuWithPosition.js +33 -0
  264. package/lib/hooks/useScroll.d.ts +10 -0
  265. package/lib/hooks/useScroll.js +12 -0
  266. package/lib/hooks/useSessionTimeout.d.ts +11 -0
  267. package/lib/hooks/useSessionTimeout.js +28 -0
  268. package/lib/providers/authentication.d.ts +51 -0
  269. package/lib/providers/authentication.js +110 -0
  270. package/lib/providers/layoutState.d.ts +40 -0
  271. package/lib/providers/layoutState.js +47 -0
  272. package/lib/styles/common/mixins/colors.d.ts +25 -0
  273. package/lib/styles/common/mixins/colors.js +32 -0
  274. package/lib/styles/common/mixins/fonts.d.ts +16 -0
  275. package/lib/styles/common/mixins/fonts.js +30 -0
  276. package/lib/styles/common/mixins/shadows.d.ts +3 -0
  277. package/lib/styles/common/mixins/shadows.js +4 -0
  278. package/lib/styles/common/mui/palette.d.ts +47 -0
  279. package/lib/styles/common/mui/palette.js +47 -0
  280. package/lib/theme/common/entities.d.ts +6 -0
  281. package/lib/theme/common/entities.js +1 -0
  282. package/package.json +8 -9
  283. package/src/common/utils.ts +1 -1
  284. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +1 -1
  285. package/src/components/Redirect/redirect.tsx +5 -1
  286. package/src/components/common/ToggleButtonGroup/toggleButtonGroup.tsx +1 -1
  287. package/src/hooks/useFileLocation.ts +1 -1
  288. package/types/data-explorer-ui.d.ts +7 -6
@@ -0,0 +1,25 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ import React from "react";
3
+ declare const meta: {
4
+ argTypes: {
5
+ tags: {
6
+ control: {
7
+ disable: true;
8
+ };
9
+ };
10
+ };
11
+ component: ({ categorySection, categoryView, closeAncestor, isFilterDrawer, onFilter, tags, trackFilterOpened, }: import("./filter").FilterProps) => JSX.Element;
12
+ decorators: ((Story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
13
+ categorySection?: string | undefined;
14
+ categoryView: import("../../../../common/entities").SelectCategoryView;
15
+ closeAncestor?: (() => void) | undefined;
16
+ isFilterDrawer: boolean;
17
+ onFilter: import("../../../../hooks/useCategoryFilter").OnFilterFn;
18
+ tags?: React.ReactNode;
19
+ trackFilterOpened?: import("../../../../config/entities").TrackFilterOpenedFunction | undefined;
20
+ }>) => JSX.Element)[];
21
+ title: string;
22
+ };
23
+ export default meta;
24
+ type Story = StoryObj<typeof meta>;
25
+ export declare const FilterStory: Story;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { Filter } from "./filter";
3
+ const meta = {
4
+ argTypes: {
5
+ tags: { control: { disable: true } },
6
+ },
7
+ component: Filter,
8
+ decorators: [
9
+ (Story) => (React.createElement("div", { style: { padding: "8px 12px 8px 16px", width: 264 } },
10
+ React.createElement(Story, null))),
11
+ ],
12
+ title: "Components/Filter/Filter",
13
+ };
14
+ export default meta;
15
+ const onFilter = () => {
16
+ // onFilter function
17
+ };
18
+ export const FilterStory = {
19
+ args: {
20
+ categoryView: {
21
+ isDisabled: false,
22
+ key: "genusSpecies",
23
+ label: "Genus Species",
24
+ values: [
25
+ {
26
+ count: 12,
27
+ key: "homoSapiens",
28
+ label: "Homo sapiens",
29
+ selected: false,
30
+ },
31
+ {
32
+ count: 6,
33
+ key: "musMusculus",
34
+ label: "Mus musculus",
35
+ selected: false,
36
+ },
37
+ ],
38
+ },
39
+ isFilterDrawer: false,
40
+ onFilter,
41
+ },
42
+ };
@@ -0,0 +1,16 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const meta: {
3
+ argTypes: {
4
+ label: {
5
+ control: "text";
6
+ };
7
+ superseded: {
8
+ control: "boolean";
9
+ };
10
+ };
11
+ component: ({ label, onRemove, superseded, }: import("./filterTag").FilterTagProps) => JSX.Element;
12
+ title: string;
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof meta>;
16
+ export declare const FilterTagStory: Story;
@@ -0,0 +1,17 @@
1
+ import { FilterTag } from "./filterTag";
2
+ const meta = {
3
+ argTypes: {
4
+ label: { control: "text" },
5
+ superseded: { control: "boolean" },
6
+ },
7
+ component: FilterTag,
8
+ title: "Components/Filter/FilterTag",
9
+ };
10
+ export default meta;
11
+ export const FilterTagStory = {
12
+ args: {
13
+ label: "Male",
14
+ onRemove: () => { },
15
+ superseded: false,
16
+ },
17
+ };
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Filters } from "./filters";
3
+ declare const _default: Meta<typeof Filters>;
4
+ export default _default;
5
+ type Story = StoryObj<typeof Filters>;
6
+ export declare const FiltersStory: Story;
@@ -0,0 +1,91 @@
1
+ import React from "react";
2
+ import { FilterMenuStory } from "../FilterMenu/filterMenu.stories";
3
+ import { Filters } from "./filters";
4
+ export default {
5
+ argTypes: {
6
+ categories: { control: { disable: true } },
7
+ onFilter: { control: { disable: true } },
8
+ },
9
+ component: Filters,
10
+ decorators: [
11
+ (Story) => (React.createElement("div", { style: { width: 264 } },
12
+ React.createElement(Story, null))),
13
+ ],
14
+ title: "Components/Filter/Filters",
15
+ };
16
+ const onFilter = () => {
17
+ // onFilter function
18
+ };
19
+ const defaultValues = [
20
+ {
21
+ count: 1,
22
+ key: "item1",
23
+ label: "Item 1",
24
+ selected: false,
25
+ },
26
+ {
27
+ count: 10,
28
+ key: "item2",
29
+ label: "Item 2",
30
+ selected: false,
31
+ },
32
+ ];
33
+ export const FiltersStory = {
34
+ args: {
35
+ categoryFilters: [
36
+ {
37
+ categoryViews: [
38
+ {
39
+ isDisabled: false,
40
+ key: "genusSpecies",
41
+ label: "Genus Species",
42
+ values: [
43
+ {
44
+ count: 12,
45
+ key: "homoSapiens",
46
+ label: "Homo sapiens",
47
+ selected: false,
48
+ },
49
+ {
50
+ count: 6,
51
+ key: "musMusculus",
52
+ label: "Mus musculus",
53
+ selected: false,
54
+ },
55
+ ],
56
+ },
57
+ ],
58
+ },
59
+ {
60
+ categoryViews: [
61
+ {
62
+ isDisabled: false,
63
+ key: "donorDisease",
64
+ label: "Donor Disease",
65
+ values: FilterMenuStory.args?.values || defaultValues,
66
+ },
67
+ {
68
+ isDisabled: true,
69
+ key: "anatomicalEntity",
70
+ label: "Anatomical Entity",
71
+ values: [
72
+ {
73
+ count: 12,
74
+ key: "oralCavity",
75
+ label: "oral cavity",
76
+ selected: true,
77
+ },
78
+ {
79
+ count: 6,
80
+ key: "pancreas",
81
+ label: "pancreas",
82
+ selected: false,
83
+ },
84
+ ],
85
+ },
86
+ ],
87
+ },
88
+ ],
89
+ onFilter: onFilter,
90
+ },
91
+ };
@@ -0,0 +1,3 @@
1
+ export declare const AutocompletePopper: import("@emotion/styled").StyledComponent<import("@mui/material").PopperProps & import("react").RefAttributes<HTMLDivElement> & {
2
+ theme?: import("@emotion/react").Theme;
3
+ }, {}, {}>;
@@ -0,0 +1,15 @@
1
+ import styled from "@emotion/styled";
2
+ import { Popper as MPopper } from "@mui/material";
3
+ import { mediaDesktopSmallDown } from "../../../../../../styles/common/mixins/breakpoints";
4
+ import { smokeLight } from "../../../../../../styles/common/mixins/colors";
5
+ export const AutocompletePopper = styled(MPopper) `
6
+ ${mediaDesktopSmallDown} {
7
+ .MuiPaper-root {
8
+ background-color: ${smokeLight};
9
+
10
+ .MuiList-root {
11
+ margin: 0;
12
+ }
13
+ }
14
+ }
15
+ `;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { SearchAllFilters } from "./searchAllFilters";
3
+ declare const _default: Meta<typeof SearchAllFilters>;
4
+ export default _default;
5
+ type Story = StoryObj<typeof SearchAllFilters>;
6
+ export declare const SearchAllFiltersStory: Story;
@@ -0,0 +1,82 @@
1
+ import React from "react";
2
+ import { FilterMenuStory } from "../FilterMenu/filterMenu.stories";
3
+ import { SearchAllFilters } from "./searchAllFilters";
4
+ export default {
5
+ argTypes: {
6
+ onFilter: { control: { disable: true } },
7
+ },
8
+ component: SearchAllFilters,
9
+ decorators: [
10
+ (Story) => (React.createElement("div", { style: { width: 264 } },
11
+ React.createElement(Story, null))),
12
+ ],
13
+ title: "Components/Filter/SearchAllFilters",
14
+ };
15
+ const onFilter = () => {
16
+ // onFilter function
17
+ };
18
+ const defaultValues = [
19
+ {
20
+ count: 1,
21
+ key: "item1",
22
+ label: "Item 1",
23
+ selected: false,
24
+ },
25
+ {
26
+ count: 10,
27
+ key: "item2",
28
+ label: "Item 2",
29
+ selected: false,
30
+ },
31
+ ];
32
+ export const SearchAllFiltersStory = {
33
+ args: {
34
+ categoryViews: [
35
+ {
36
+ isDisabled: false,
37
+ key: "genusSpecies",
38
+ label: "Genus Species",
39
+ values: [
40
+ {
41
+ count: 12,
42
+ key: "homoSapiens",
43
+ label: "Homo sapiens",
44
+ selected: false,
45
+ },
46
+ {
47
+ count: 6,
48
+ key: "musMusculus",
49
+ label: "Mus musculus",
50
+ selected: false,
51
+ },
52
+ ],
53
+ },
54
+ {
55
+ isDisabled: false,
56
+ key: "donorDisease",
57
+ label: "Donor Disease",
58
+ values: FilterMenuStory.args?.values || defaultValues,
59
+ },
60
+ {
61
+ isDisabled: true,
62
+ key: "anatomicalEntity",
63
+ label: "Anatomical Entity",
64
+ values: [
65
+ {
66
+ count: 12,
67
+ key: "oralCavity",
68
+ label: "oral cavity",
69
+ selected: true,
70
+ },
71
+ {
72
+ count: 6,
73
+ key: "pancreas",
74
+ label: "pancreas",
75
+ selected: false,
76
+ },
77
+ ],
78
+ },
79
+ ],
80
+ onFilter: onFilter,
81
+ },
82
+ };
@@ -0,0 +1 @@
1
+ export declare const SearchCloseButton: () => JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { CloseRounded } from "@mui/icons-material";
2
+ import { IconButton } from "@mui/material";
3
+ import React, { Fragment, useContext } from "react";
4
+ import { BREAKPOINT_FN_NAME, useBreakpointHelper, } from "../../../../../../hooks/useBreakpointHelper";
5
+ import { DESKTOP_SM } from "../../../../../../theme/common/breakpoints";
6
+ import { ListboxContext } from "../../../SearchAllFilters/searchAllFilters";
7
+ export const SearchCloseButton = () => {
8
+ const desktopSmDown = useBreakpointHelper(BREAKPOINT_FN_NAME.DOWN, DESKTOP_SM);
9
+ const { onClearSearch, onCloseSearch, open, searchTerm } = useContext(ListboxContext);
10
+ const showButton = open && (desktopSmDown || searchTerm);
11
+ const onClickFn = desktopSmDown ? onCloseSearch : onClearSearch;
12
+ return (React.createElement(Fragment, null, showButton && (React.createElement(IconButton, { onClick: onClickFn, size: "large" },
13
+ React.createElement(CloseRounded, { fontSize: "small" })))));
14
+ };
@@ -0,0 +1,2 @@
1
+ import { TextFieldProps } from "@mui/material";
2
+ export declare const SearchAllFiltersSearch: ({ inputProps, InputProps, ...props }: TextFieldProps) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import React, { useContext } from "react";
2
+ import { SearchIcon } from "../../../common/CustomIcon/components/SearchIcon/searchIcon";
3
+ import { ListboxContext } from "../SearchAllFilters/searchAllFilters";
4
+ import { InputField } from "./searchAllFiltersSearch.styles";
5
+ export const SearchAllFiltersSearch = ({ inputProps, InputProps, ...props }) => {
6
+ const { searchTerm } = useContext(ListboxContext);
7
+ delete inputProps?.value; // Control input value from the search term.
8
+ return (React.createElement(InputField, { ...props, fullWidth: true, InputProps: {
9
+ ...(InputProps || {}),
10
+ startAdornment: React.createElement(SearchIcon, { fontSize: "small" }),
11
+ }, inputProps: { ...(inputProps || {}), spellCheck: false }, placeholder: "Search all filters...", size: "small", value: searchTerm, variant: "outlined" }));
12
+ };
@@ -0,0 +1,5 @@
1
+ export declare const InputField: import("@emotion/styled").StyledComponent<{
2
+ variant?: import("@mui/material").TextFieldVariants | undefined;
3
+ } & Omit<import("@mui/material").OutlinedTextFieldProps | import("@mui/material").FilledTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & {
4
+ theme?: import("@emotion/react").Theme;
5
+ }, {}, {}>;
@@ -0,0 +1,34 @@
1
+ import styled from "@emotion/styled";
2
+ import { TextField } from "@mui/material";
3
+ import { inkLight, inkMain } from "../../../../styles/common/mixins/colors";
4
+ export const InputField = styled(TextField) `
5
+ && {
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: 8px;
9
+
10
+ .MuiInputBase-root {
11
+ & ::placeholder {
12
+ color: ${inkLight};
13
+ opacity: 0.8;
14
+ }
15
+
16
+ &.Mui-focused {
17
+ & ::placeholder {
18
+ opacity: 0;
19
+ }
20
+ }
21
+ }
22
+
23
+ .MuiOutlinedInput-root {
24
+ &.MuiInputBase-sizeSmall {
25
+ padding: 0 0 0 12px;
26
+
27
+ .MuiAutocomplete-input {
28
+ color: ${inkMain};
29
+ padding: 10px 14px 10px 0;
30
+ }
31
+ }
32
+ }
33
+ }
34
+ `;
@@ -0,0 +1,7 @@
1
+ export interface CellProps {
2
+ value?: number | string | string[];
3
+ }
4
+ /**
5
+ * @deprecated - use BasicCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell"
6
+ */
7
+ export declare const Cell: ({ value }: CellProps) => JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ /**
3
+ * @deprecated - use BasicCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell"
4
+ */
5
+ export const Cell = ({ value = "Unspecified" }) => {
6
+ if (typeof value === "string" || typeof value === "number") {
7
+ return React.createElement("div", null, value);
8
+ }
9
+ return (React.createElement(React.Fragment, null, value.map((v) => (React.createElement("div", { key: v }, v)))));
10
+ };
@@ -0,0 +1,2 @@
1
+ import { ChartViewProps } from "./types";
2
+ export declare const ChartView: ({ categoryFilters, entityName, loading, testId, }: ChartViewProps) => JSX.Element | null;
@@ -0,0 +1,20 @@
1
+ import { Typography } from "@mui/material";
2
+ import React, { Fragment } from "react";
3
+ import { TYPOGRAPHY_PROPS } from "../../../../../../styles/common/mui/typography";
4
+ import { Loading, LOADING_PANEL_STYLE } from "../../../../../Loading/loading";
5
+ import { StyledGrid, StyledGridPaperSection } from "./chartView.styles";
6
+ import { Chart } from "./components/Chart/chart";
7
+ import { useChartView } from "./hooks/UseChartView/useChartView";
8
+ export const ChartView = ({ categoryFilters, entityName, loading, testId, }) => {
9
+ const { chartViewRef, selectCategoryViews, width } = useChartView(categoryFilters);
10
+ if (selectCategoryViews.length === 0)
11
+ return null;
12
+ return (React.createElement(Fragment, null,
13
+ React.createElement(Loading, { appear: false, autoPosition: false, loading: loading, panelStyle: LOADING_PANEL_STYLE.INHERIT }),
14
+ React.createElement(StyledGrid, { "data-testid": testId, ref: chartViewRef }, selectCategoryViews.map(({ key, label, values }) => (React.createElement(StyledGridPaperSection, { key: key },
15
+ React.createElement(Typography, { variant: TYPOGRAPHY_PROPS.VARIANT.TEXT_HEADING_SMALL },
16
+ entityName,
17
+ " by ",
18
+ label),
19
+ React.createElement(Chart, { selectCategoryValueViews: values, width: width })))))));
20
+ };
@@ -0,0 +1,13 @@
1
+ export declare const StyledGrid: import("@emotion/styled").StyledComponent<import("@mui/material").GridBaseProps & {
2
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme>;
3
+ } & import("@mui/system").SystemProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
4
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
5
+ }, ("p" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textTransform" | "color" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontStyle" | "textAlign") | "sx" | keyof import("@mui/material").GridBaseProps> & {
6
+ theme?: import("@emotion/react").Theme;
7
+ }, {}, {}>;
8
+ export declare const StyledGridPaperSection: import("@emotion/styled").StyledComponent<{
9
+ theme?: import("@emotion/react").Theme;
10
+ as?: React.ElementType;
11
+ } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
12
+ theme?: import("@emotion/react").Theme;
13
+ }, {}, {}>;
@@ -0,0 +1,12 @@
1
+ import styled from "@emotion/styled";
2
+ import { Grid } from "@mui/material";
3
+ import { GridPaperSection } from "../../../../../common/Section/section.styles";
4
+ export const StyledGrid = styled(Grid) `
5
+ display: grid;
6
+ gap: inherit;
7
+ `;
8
+ export const StyledGridPaperSection = styled(GridPaperSection) `
9
+ &:last-of-type {
10
+ border-radius: inherit;
11
+ }
12
+ `;
@@ -0,0 +1,10 @@
1
+ export declare const BAR_GAP = 8;
2
+ export declare const BAR_HEIGHT = 24;
3
+ export declare const DATA_FIELD: {
4
+ readonly COUNT: "count";
5
+ readonly LABEL: "label";
6
+ readonly SELECTED: "selected";
7
+ };
8
+ export declare const MARGIN_LEFT = 136;
9
+ export declare const TEXT_PADDING = 8;
10
+ export declare const TICKS = 6;
@@ -0,0 +1,10 @@
1
+ export const BAR_GAP = 8;
2
+ export const BAR_HEIGHT = 24;
3
+ export const DATA_FIELD = {
4
+ COUNT: "count",
5
+ LABEL: "label",
6
+ SELECTED: "selected",
7
+ };
8
+ export const MARGIN_LEFT = 136;
9
+ export const TEXT_PADDING = 8;
10
+ export const TICKS = 6;
@@ -0,0 +1,3 @@
1
+ import { PlotOptions } from "@observablehq/plot";
2
+ import { SelectCategoryValueView } from "../../../../../../../../../common/entities";
3
+ export declare function getPlotOptions(selectCategoryValueViews: SelectCategoryValueView[], width: number): PlotOptions;
@@ -0,0 +1,91 @@
1
+ import * as Plot from "@observablehq/plot";
2
+ import { PALETTE } from "../../../../../../../../../styles/common/constants/palette";
3
+ import { formatCountSize } from "../../../../../../../../../utils/formatCountSize";
4
+ import { DATA_FIELD, MARGIN_LEFT, TEXT_PADDING } from "./constants";
5
+ import { getCategoryTotalCount, getCategoryValueText, getCategoryValueTextFill, getColorRangeValue, getCountText, getCountTextFill, getPlotHeight, getTicks, getXDomain, getYPaddingInner, getYPaddingOuter, isAnyValueSelected, renderText, } from "./utils";
6
+ export function getPlotOptions(selectCategoryValueViews, width) {
7
+ const isCategorySelected = isAnyValueSelected(selectCategoryValueViews);
8
+ const totalCount = getCategoryTotalCount(selectCategoryValueViews);
9
+ return {
10
+ color: {
11
+ domain: [false, true], // false = unselected, true = selected.
12
+ legend: false,
13
+ range: [getColorRangeValue(isCategorySelected), PALETTE.PRIMARY_MAIN],
14
+ },
15
+ height: getPlotHeight(selectCategoryValueViews.length),
16
+ margin: 0,
17
+ marginBottom: 32,
18
+ marginLeft: MARGIN_LEFT,
19
+ marks: [
20
+ Plot.axisX({
21
+ className: "x-axis",
22
+ tickFormat: formatCountSize,
23
+ tickPadding: 8,
24
+ tickSize: 0,
25
+ ticks: getTicks(selectCategoryValueViews),
26
+ }),
27
+ Plot.gridX({
28
+ stroke: PALETTE.SMOKE_MAIN,
29
+ strokeOpacity: 1,
30
+ ticks: getTicks(selectCategoryValueViews),
31
+ }),
32
+ Plot.barX(selectCategoryValueViews, {
33
+ className: "x-bar",
34
+ fill: DATA_FIELD.SELECTED,
35
+ rx1: 0,
36
+ rx2: 4,
37
+ sort: { order: "descending", y: "x" }, // Sort by count (x-axis), descending.
38
+ x: DATA_FIELD.COUNT,
39
+ y: DATA_FIELD.LABEL,
40
+ }),
41
+ Plot.text(selectCategoryValueViews, {
42
+ className: "text-category-label",
43
+ dx: -TEXT_PADDING,
44
+ dy: -2,
45
+ fill: (d) => getCategoryValueTextFill(d, isCategorySelected),
46
+ lineHeight: 0.8125,
47
+ lineWidth: (MARGIN_LEFT - TEXT_PADDING) / 13, // "em" unit; font-size is 13px.
48
+ text: getCategoryValueText,
49
+ textAnchor: "end",
50
+ textOverflow: "ellipsis",
51
+ title: getCategoryValueText,
52
+ x: 0,
53
+ y: DATA_FIELD.LABEL,
54
+ }),
55
+ Plot.text(selectCategoryValueViews, {
56
+ className: "text-count",
57
+ dx: -TEXT_PADDING,
58
+ dy: -2,
59
+ fill: (d) => getCountTextFill(d, isCategorySelected),
60
+ fontWeight: 500,
61
+ lineHeight: 0.8125,
62
+ render: renderText,
63
+ text: (d) => getCountText(d, totalCount),
64
+ textAnchor: "end",
65
+ x: DATA_FIELD.COUNT,
66
+ y: DATA_FIELD.LABEL,
67
+ }),
68
+ ],
69
+ style: {
70
+ dominantBaseline: "middle",
71
+ font: "inherit",
72
+ overflow: "visible",
73
+ },
74
+ width,
75
+ x: {
76
+ domain: getXDomain(selectCategoryValueViews),
77
+ grid: false,
78
+ label: null,
79
+ line: false,
80
+ },
81
+ y: {
82
+ label: null,
83
+ line: false,
84
+ paddingInner: getYPaddingInner(),
85
+ paddingOuter: getYPaddingOuter(),
86
+ tickFormat: () => "",
87
+ tickSize: 0,
88
+ type: "band", // Treats number-like strings as categorical labels to prevent numeric scale warnings.
89
+ },
90
+ };
91
+ }