@buildcanada/charts 0.1.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.
Files changed (404) hide show
  1. package/LICENSE.md +8 -0
  2. package/README.md +113 -0
  3. package/package.json +137 -0
  4. package/src/components/BodyPortal/BodyPortal.tsx +40 -0
  5. package/src/components/Button/Button.scss +110 -0
  6. package/src/components/Button/Button.tsx +101 -0
  7. package/src/components/Checkbox.scss +93 -0
  8. package/src/components/Checkbox.tsx +47 -0
  9. package/src/components/ExpandableToggle/ExpandableToggle.scss +123 -0
  10. package/src/components/ExpandableToggle/ExpandableToggle.tsx +60 -0
  11. package/src/components/GrapherTabIcon.tsx +156 -0
  12. package/src/components/GrapherTrendArrow.scss +16 -0
  13. package/src/components/GrapherTrendArrow.tsx +30 -0
  14. package/src/components/Halo/Halo.tsx +44 -0
  15. package/src/components/LabeledSwitch/LabeledSwitch.scss +109 -0
  16. package/src/components/LabeledSwitch/LabeledSwitch.tsx +62 -0
  17. package/src/components/MarkdownTextWrap/MarkdownTextWrap.tsx +1173 -0
  18. package/src/components/OverlayHeader.scss +18 -0
  19. package/src/components/OverlayHeader.tsx +29 -0
  20. package/src/components/RadioButton.scss +69 -0
  21. package/src/components/RadioButton.tsx +42 -0
  22. package/src/components/SimpleMarkdownText.tsx +89 -0
  23. package/src/components/TextInput.scss +17 -0
  24. package/src/components/TextInput.tsx +19 -0
  25. package/src/components/TextWrap/TextWrap.tsx +361 -0
  26. package/src/components/TextWrap/TextWrapUtils.ts +32 -0
  27. package/src/components/closeButton/CloseButton.scss +40 -0
  28. package/src/components/closeButton/CloseButton.tsx +27 -0
  29. package/src/components/index.ts +70 -0
  30. package/src/components/loadingIndicator/LoadingIndicator.scss +40 -0
  31. package/src/components/loadingIndicator/LoadingIndicator.tsx +28 -0
  32. package/src/components/markdown/remarkPlainLinks.ts +36 -0
  33. package/src/components/reactUtil.ts +20 -0
  34. package/src/components/stubs/CodeSnippet.tsx +19 -0
  35. package/src/components/stubs/DataCitation.tsx +16 -0
  36. package/src/components/stubs/IndicatorKeyData.tsx +45 -0
  37. package/src/components/stubs/IndicatorProcessing.tsx +15 -0
  38. package/src/components/stubs/IndicatorSources.tsx +15 -0
  39. package/src/components/styles/colors.scss +113 -0
  40. package/src/components/styles/mixins.scss +630 -0
  41. package/src/components/styles/typography.scss +579 -0
  42. package/src/components/styles/util.scss +89 -0
  43. package/src/components/styles/variables.scss +208 -0
  44. package/src/config/ChartsConfig.ts +163 -0
  45. package/src/config/ChartsProvider.tsx +157 -0
  46. package/src/config/index.ts +20 -0
  47. package/src/core-table/CoreTable.ts +1355 -0
  48. package/src/core-table/CoreTableColumns.ts +973 -0
  49. package/src/core-table/CoreTableUtils.ts +793 -0
  50. package/src/core-table/ErrorValues.ts +73 -0
  51. package/src/core-table/OwidTable.ts +1175 -0
  52. package/src/core-table/OwidTableSynthesizers.ts +272 -0
  53. package/src/core-table/OwidTableUtil.ts +76 -0
  54. package/src/core-table/Transforms.ts +484 -0
  55. package/src/core-table/index.ts +82 -0
  56. package/src/explorer/ColumnGrammar.ts +217 -0
  57. package/src/explorer/Explorer.sample.ts +212 -0
  58. package/src/explorer/Explorer.scss +148 -0
  59. package/src/explorer/Explorer.tsx +1283 -0
  60. package/src/explorer/ExplorerConstants.ts +85 -0
  61. package/src/explorer/ExplorerControls.scss +156 -0
  62. package/src/explorer/ExplorerControls.tsx +210 -0
  63. package/src/explorer/ExplorerDecisionMatrix.ts +471 -0
  64. package/src/explorer/ExplorerGrammar.ts +161 -0
  65. package/src/explorer/ExplorerProgram.ts +568 -0
  66. package/src/explorer/ExplorerUtils.ts +59 -0
  67. package/src/explorer/GrapherGrammar.ts +387 -0
  68. package/src/explorer/gridLang/GrammarUtils.ts +121 -0
  69. package/src/explorer/gridLang/GridCell.ts +298 -0
  70. package/src/explorer/gridLang/GridLangConstants.ts +255 -0
  71. package/src/explorer/gridLang/GridProgram.ts +311 -0
  72. package/src/explorer/gridLang/readme.md +17 -0
  73. package/src/explorer/index.ts +69 -0
  74. package/src/explorer/readme.md +19 -0
  75. package/src/explorer/urlMigrations/CO2UrlMigration.ts +46 -0
  76. package/src/explorer/urlMigrations/CovidUrlMigration.ts +37 -0
  77. package/src/explorer/urlMigrations/EnergyUrlMigration.ts +41 -0
  78. package/src/explorer/urlMigrations/ExplorerPageUrlMigrationSpec.ts +12 -0
  79. package/src/explorer/urlMigrations/ExplorerUrlMigrationUtils.ts +45 -0
  80. package/src/explorer/urlMigrations/ExplorerUrlMigrations.ts +33 -0
  81. package/src/explorer/urlMigrations/LegacyCovidUrlMigration.ts +144 -0
  82. package/src/explorer/urlMigrations/readme.md +39 -0
  83. package/src/grapher/axis/Axis.ts +973 -0
  84. package/src/grapher/axis/AxisConfig.ts +179 -0
  85. package/src/grapher/axis/AxisViews.tsx +597 -0
  86. package/src/grapher/barCharts/DiscreteBarChart.tsx +728 -0
  87. package/src/grapher/barCharts/DiscreteBarChartConstants.ts +60 -0
  88. package/src/grapher/barCharts/DiscreteBarChartHelpers.ts +338 -0
  89. package/src/grapher/barCharts/DiscreteBarChartState.ts +354 -0
  90. package/src/grapher/barCharts/DiscreteBarChartThumbnail.tsx +34 -0
  91. package/src/grapher/captionedChart/CaptionedChart.scss +61 -0
  92. package/src/grapher/captionedChart/CaptionedChart.tsx +523 -0
  93. package/src/grapher/captionedChart/Logos.tsx +141 -0
  94. package/src/grapher/captionedChart/LogosSVG.tsx +16 -0
  95. package/src/grapher/captionedChart/StaticChartRasterizer.tsx +178 -0
  96. package/src/grapher/captionedChart/assets/buildcanada-logo-square.svg +15 -0
  97. package/src/grapher/captionedChart/assets/buildcanada-logo.svg +15 -0
  98. package/src/grapher/captionedChart/assets/canadaspends.svg +7 -0
  99. package/src/grapher/captionedChart/readme.md +14 -0
  100. package/src/grapher/chart/Chart.tsx +62 -0
  101. package/src/grapher/chart/ChartAreaContent.tsx +172 -0
  102. package/src/grapher/chart/ChartDimension.ts +121 -0
  103. package/src/grapher/chart/ChartInterface.ts +83 -0
  104. package/src/grapher/chart/ChartManager.ts +113 -0
  105. package/src/grapher/chart/ChartTabs.ts +178 -0
  106. package/src/grapher/chart/ChartTypeMap.tsx +158 -0
  107. package/src/grapher/chart/ChartTypeSwitcher.tsx +26 -0
  108. package/src/grapher/chart/ChartUtils.tsx +364 -0
  109. package/src/grapher/chart/DimensionSlot.ts +45 -0
  110. package/src/grapher/chart/StaticChartWrapper.tsx +94 -0
  111. package/src/grapher/chart/guidedChartUtils.ts +82 -0
  112. package/src/grapher/color/BinningStrategies.ts +484 -0
  113. package/src/grapher/color/BinningStrategyEqualSizeBins.ts +132 -0
  114. package/src/grapher/color/BinningStrategyLogarithmic.ts +121 -0
  115. package/src/grapher/color/CategoricalColorAssigner.ts +97 -0
  116. package/src/grapher/color/ColorBrewerSchemes.ts +80 -0
  117. package/src/grapher/color/ColorConstants.ts +20 -0
  118. package/src/grapher/color/ColorScale.ts +339 -0
  119. package/src/grapher/color/ColorScaleBin.ts +147 -0
  120. package/src/grapher/color/ColorScaleConfig.ts +204 -0
  121. package/src/grapher/color/ColorScheme.ts +137 -0
  122. package/src/grapher/color/ColorSchemes.ts +149 -0
  123. package/src/grapher/color/ColorUtils.ts +86 -0
  124. package/src/grapher/color/CustomSchemes.ts +1772 -0
  125. package/src/grapher/color/readme.md +84 -0
  126. package/src/grapher/comparisonLine/ComparisonLine.tsx +31 -0
  127. package/src/grapher/comparisonLine/ComparisonLineConstants.ts +11 -0
  128. package/src/grapher/comparisonLine/ComparisonLineGenerator.ts +60 -0
  129. package/src/grapher/comparisonLine/ComparisonLineHelpers.ts +10 -0
  130. package/src/grapher/comparisonLine/CustomComparisonLine.tsx +159 -0
  131. package/src/grapher/comparisonLine/VerticalComparisonLine.tsx +208 -0
  132. package/src/grapher/controls/ActionButtons.scss +97 -0
  133. package/src/grapher/controls/ActionButtons.tsx +453 -0
  134. package/src/grapher/controls/CommandPalette.scss +50 -0
  135. package/src/grapher/controls/CommandPalette.tsx +74 -0
  136. package/src/grapher/controls/ContentSwitchers.scss +93 -0
  137. package/src/grapher/controls/ContentSwitchers.tsx +238 -0
  138. package/src/grapher/controls/Controls.scss +158 -0
  139. package/src/grapher/controls/DataTableFilterDropdown.scss +7 -0
  140. package/src/grapher/controls/DataTableFilterDropdown.tsx +168 -0
  141. package/src/grapher/controls/DataTableSearchField.scss +3 -0
  142. package/src/grapher/controls/DataTableSearchField.tsx +76 -0
  143. package/src/grapher/controls/Dropdown.scss +252 -0
  144. package/src/grapher/controls/Dropdown.tsx +235 -0
  145. package/src/grapher/controls/EntitySelectionToggle.tsx +135 -0
  146. package/src/grapher/controls/MapRegionDropdown.scss +3 -0
  147. package/src/grapher/controls/MapRegionDropdown.tsx +104 -0
  148. package/src/grapher/controls/MapResetButton.tsx +115 -0
  149. package/src/grapher/controls/MapZoomDropdown.scss +9 -0
  150. package/src/grapher/controls/MapZoomDropdown.tsx +270 -0
  151. package/src/grapher/controls/MapZoomToSelectionButton.tsx +87 -0
  152. package/src/grapher/controls/SearchField.scss +78 -0
  153. package/src/grapher/controls/SearchField.tsx +63 -0
  154. package/src/grapher/controls/SettingsMenu.scss +191 -0
  155. package/src/grapher/controls/SettingsMenu.tsx +399 -0
  156. package/src/grapher/controls/ShareMenu.scss +58 -0
  157. package/src/grapher/controls/ShareMenu.tsx +304 -0
  158. package/src/grapher/controls/SortIcon.tsx +39 -0
  159. package/src/grapher/controls/VerticalScrollContainer.tsx +263 -0
  160. package/src/grapher/controls/controlsRow/ControlsRow.tsx +168 -0
  161. package/src/grapher/controls/dropdown-icons.scss +4 -0
  162. package/src/grapher/controls/entityPicker/EntityPicker.scss +255 -0
  163. package/src/grapher/controls/entityPicker/EntityPicker.tsx +816 -0
  164. package/src/grapher/controls/entityPicker/EntityPickerConstants.ts +23 -0
  165. package/src/grapher/controls/globalEntitySelector/GlobalEntitySelector.scss +129 -0
  166. package/src/grapher/controls/globalEntitySelector/GlobalEntitySelector.tsx +463 -0
  167. package/src/grapher/controls/globalEntitySelector/GlobalEntitySelectorConstants.ts +3 -0
  168. package/src/grapher/controls/globalEntitySelector/readme.md +17 -0
  169. package/src/grapher/controls/settings/AbsRelToggle.tsx +64 -0
  170. package/src/grapher/controls/settings/AxisScaleToggle.tsx +53 -0
  171. package/src/grapher/controls/settings/FacetStrategySelector.tsx +110 -0
  172. package/src/grapher/controls/settings/FacetYDomainToggle.tsx +51 -0
  173. package/src/grapher/controls/settings/NoDataAreaToggle.tsx +38 -0
  174. package/src/grapher/controls/settings/ZoomToggle.tsx +36 -0
  175. package/src/grapher/core/EntitiesByRegionType.ts +174 -0
  176. package/src/grapher/core/EntityCodes.ts +19 -0
  177. package/src/grapher/core/EntityUrlBuilder.ts +200 -0
  178. package/src/grapher/core/FetchingGrapher.tsx +156 -0
  179. package/src/grapher/core/Grapher.tsx +760 -0
  180. package/src/grapher/core/GrapherAnalytics.ts +229 -0
  181. package/src/grapher/core/GrapherConstants.ts +173 -0
  182. package/src/grapher/core/GrapherState.tsx +3659 -0
  183. package/src/grapher/core/GrapherUrl.ts +184 -0
  184. package/src/grapher/core/GrapherUrlMigrations.ts +29 -0
  185. package/src/grapher/core/GrapherUseHelpers.tsx +147 -0
  186. package/src/grapher/core/LegacyToOwidTable.ts +841 -0
  187. package/src/grapher/core/grapher.entry.ts +5 -0
  188. package/src/grapher/core/grapher.scss +257 -0
  189. package/src/grapher/core/loadGrapherTableHelpers.ts +116 -0
  190. package/src/grapher/core/loadVariable.ts +104 -0
  191. package/src/grapher/core/relatedQuestion.ts +12 -0
  192. package/src/grapher/core/typography.scss +206 -0
  193. package/src/grapher/dataTable/DataTable.sample.ts +206 -0
  194. package/src/grapher/dataTable/DataTable.scss +249 -0
  195. package/src/grapher/dataTable/DataTable.tsx +1332 -0
  196. package/src/grapher/dataTable/DataTableConstants.ts +186 -0
  197. package/src/grapher/entitySelector/EntitySelector.scss +255 -0
  198. package/src/grapher/entitySelector/EntitySelector.tsx +1838 -0
  199. package/src/grapher/facet/FacetChart.tsx +943 -0
  200. package/src/grapher/facet/FacetChartConstants.ts +24 -0
  201. package/src/grapher/facet/FacetChartUtils.ts +51 -0
  202. package/src/grapher/facet/FacetMap.tsx +604 -0
  203. package/src/grapher/facet/FacetMapConstants.ts +23 -0
  204. package/src/grapher/facet/readme.md +13 -0
  205. package/src/grapher/focus/FocusArray.ts +79 -0
  206. package/src/grapher/footer/Footer.scss +63 -0
  207. package/src/grapher/footer/Footer.tsx +809 -0
  208. package/src/grapher/footer/FooterManager.ts +44 -0
  209. package/src/grapher/fullScreen/FullScreen.scss +11 -0
  210. package/src/grapher/fullScreen/FullScreen.tsx +61 -0
  211. package/src/grapher/header/Header.scss +35 -0
  212. package/src/grapher/header/Header.tsx +372 -0
  213. package/src/grapher/header/HeaderManager.ts +28 -0
  214. package/src/grapher/index.ts +157 -0
  215. package/src/grapher/interaction/InteractionState.ts +60 -0
  216. package/src/grapher/legend/HorizontalColorLegends.tsx +923 -0
  217. package/src/grapher/legend/LegendInteractionState.ts +40 -0
  218. package/src/grapher/legend/VerticalColorLegend.tsx +295 -0
  219. package/src/grapher/lineCharts/LineChart.tsx +968 -0
  220. package/src/grapher/lineCharts/LineChartConstants.ts +89 -0
  221. package/src/grapher/lineCharts/LineChartHelpers.ts +184 -0
  222. package/src/grapher/lineCharts/LineChartState.ts +394 -0
  223. package/src/grapher/lineCharts/LineChartThumbnail.tsx +437 -0
  224. package/src/grapher/lineCharts/Lines.tsx +258 -0
  225. package/src/grapher/lineLegend/LineLegend.tsx +723 -0
  226. package/src/grapher/lineLegend/LineLegendConstants.ts +9 -0
  227. package/src/grapher/lineLegend/LineLegendFilterAlgorithms.ts +143 -0
  228. package/src/grapher/lineLegend/LineLegendHelpers.ts +253 -0
  229. package/src/grapher/lineLegend/LineLegendTypes.ts +32 -0
  230. package/src/grapher/mapCharts/CanadaTopology.ts +17922 -0
  231. package/src/grapher/mapCharts/ChoroplethGlobe.tsx +949 -0
  232. package/src/grapher/mapCharts/ChoroplethMap.tsx +662 -0
  233. package/src/grapher/mapCharts/GeoFeatures.ts +184 -0
  234. package/src/grapher/mapCharts/GlobeController.ts +496 -0
  235. package/src/grapher/mapCharts/MapAnnotationPlacements.json +1040 -0
  236. package/src/grapher/mapCharts/MapAnnotationPlacements.ts +31 -0
  237. package/src/grapher/mapCharts/MapAnnotations.ts +723 -0
  238. package/src/grapher/mapCharts/MapChart.sample.ts +59 -0
  239. package/src/grapher/mapCharts/MapChart.scss +5 -0
  240. package/src/grapher/mapCharts/MapChart.tsx +720 -0
  241. package/src/grapher/mapCharts/MapChartConstants.ts +260 -0
  242. package/src/grapher/mapCharts/MapChartState.ts +416 -0
  243. package/src/grapher/mapCharts/MapChartThumbnail.tsx +25 -0
  244. package/src/grapher/mapCharts/MapComponents.tsx +338 -0
  245. package/src/grapher/mapCharts/MapConfig.ts +156 -0
  246. package/src/grapher/mapCharts/MapHelpers.ts +181 -0
  247. package/src/grapher/mapCharts/MapProjections.ts +49 -0
  248. package/src/grapher/mapCharts/MapSparkline.tsx +257 -0
  249. package/src/grapher/mapCharts/MapTooltip.scss +49 -0
  250. package/src/grapher/mapCharts/MapTooltip.tsx +409 -0
  251. package/src/grapher/mapCharts/MapTopology.ts +1766 -0
  252. package/src/grapher/mapCharts/d3-bboxCollide.js +204 -0
  253. package/src/grapher/mapCharts/d3-geo-projection.ts +198 -0
  254. package/src/grapher/modal/DownloadIcons.tsx +39 -0
  255. package/src/grapher/modal/DownloadModal.scss +300 -0
  256. package/src/grapher/modal/DownloadModal.tsx +1226 -0
  257. package/src/grapher/modal/EmbedModal.scss +40 -0
  258. package/src/grapher/modal/EmbedModal.tsx +160 -0
  259. package/src/grapher/modal/EntitySelectorModal.tsx +59 -0
  260. package/src/grapher/modal/Modal.scss +31 -0
  261. package/src/grapher/modal/Modal.tsx +90 -0
  262. package/src/grapher/modal/ModalHeader.scss +12 -0
  263. package/src/grapher/modal/ModalHeader.tsx +16 -0
  264. package/src/grapher/modal/SourcesDescriptions.scss +87 -0
  265. package/src/grapher/modal/SourcesDescriptions.tsx +89 -0
  266. package/src/grapher/modal/SourcesKeyDataTable.scss +49 -0
  267. package/src/grapher/modal/SourcesKeyDataTable.tsx +87 -0
  268. package/src/grapher/modal/SourcesModal.scss +301 -0
  269. package/src/grapher/modal/SourcesModal.tsx +568 -0
  270. package/src/grapher/noDataModal/NoDataModal.tsx +125 -0
  271. package/src/grapher/scatterCharts/ConnectedScatterLegend.tsx +143 -0
  272. package/src/grapher/scatterCharts/MultiColorPolyline.tsx +129 -0
  273. package/src/grapher/scatterCharts/NoDataSection.scss +14 -0
  274. package/src/grapher/scatterCharts/NoDataSection.tsx +56 -0
  275. package/src/grapher/scatterCharts/ScatterPlotChart.tsx +792 -0
  276. package/src/grapher/scatterCharts/ScatterPlotChartConstants.ts +157 -0
  277. package/src/grapher/scatterCharts/ScatterPlotChartState.ts +678 -0
  278. package/src/grapher/scatterCharts/ScatterPlotChartThumbnail.tsx +155 -0
  279. package/src/grapher/scatterCharts/ScatterPlotTooltip.tsx +560 -0
  280. package/src/grapher/scatterCharts/ScatterPoints.tsx +153 -0
  281. package/src/grapher/scatterCharts/ScatterPointsWithLabels.tsx +708 -0
  282. package/src/grapher/scatterCharts/ScatterSizeLegend.tsx +327 -0
  283. package/src/grapher/scatterCharts/ScatterUtils.ts +265 -0
  284. package/src/grapher/scatterCharts/Triangle.tsx +41 -0
  285. package/src/grapher/schema/README.md +33 -0
  286. package/src/grapher/schema/defaultGrapherConfig.ts +100 -0
  287. package/src/grapher/schema/grapher-schema.009.yaml +781 -0
  288. package/src/grapher/schema/migrations/helpers.ts +58 -0
  289. package/src/grapher/schema/migrations/migrate.ts +75 -0
  290. package/src/grapher/schema/migrations/migrations.ts +158 -0
  291. package/src/grapher/selection/MapSelectionArray.ts +99 -0
  292. package/src/grapher/selection/SelectionArray.ts +71 -0
  293. package/src/grapher/selection/readme.md +16 -0
  294. package/src/grapher/sidePanel/SidePanel.scss +10 -0
  295. package/src/grapher/sidePanel/SidePanel.tsx +23 -0
  296. package/src/grapher/slideInDrawer/SlideInDrawer.scss +57 -0
  297. package/src/grapher/slideInDrawer/SlideInDrawer.tsx +125 -0
  298. package/src/grapher/slideshowController/SlideShowController.tsx +43 -0
  299. package/src/grapher/slideshowController/readme.md +7 -0
  300. package/src/grapher/slopeCharts/MarkX.tsx +45 -0
  301. package/src/grapher/slopeCharts/Slope.tsx +102 -0
  302. package/src/grapher/slopeCharts/SlopeChart.tsx +1152 -0
  303. package/src/grapher/slopeCharts/SlopeChartConstants.ts +33 -0
  304. package/src/grapher/slopeCharts/SlopeChartHelpers.ts +73 -0
  305. package/src/grapher/slopeCharts/SlopeChartState.ts +392 -0
  306. package/src/grapher/slopeCharts/SlopeChartThumbnail.tsx +368 -0
  307. package/src/grapher/stackedCharts/AbstractStackedChartState.ts +370 -0
  308. package/src/grapher/stackedCharts/MarimekkoBars.tsx +190 -0
  309. package/src/grapher/stackedCharts/MarimekkoBarsForOneEntity.tsx +168 -0
  310. package/src/grapher/stackedCharts/MarimekkoChart.tsx +1144 -0
  311. package/src/grapher/stackedCharts/MarimekkoChartConstants.ts +112 -0
  312. package/src/grapher/stackedCharts/MarimekkoChartHelpers.ts +21 -0
  313. package/src/grapher/stackedCharts/MarimekkoChartState.ts +465 -0
  314. package/src/grapher/stackedCharts/MarimekkoChartThumbnail.tsx +168 -0
  315. package/src/grapher/stackedCharts/MarimekkoInternalLabels.tsx +124 -0
  316. package/src/grapher/stackedCharts/StackedAreaChart.tsx +678 -0
  317. package/src/grapher/stackedCharts/StackedAreaChartState.ts +34 -0
  318. package/src/grapher/stackedCharts/StackedAreaChartThumbnail.tsx +215 -0
  319. package/src/grapher/stackedCharts/StackedAreas.tsx +223 -0
  320. package/src/grapher/stackedCharts/StackedBarChart.tsx +619 -0
  321. package/src/grapher/stackedCharts/StackedBarChartState.ts +80 -0
  322. package/src/grapher/stackedCharts/StackedBarChartThumbnail.tsx +220 -0
  323. package/src/grapher/stackedCharts/StackedBarSegment.tsx +87 -0
  324. package/src/grapher/stackedCharts/StackedBars.tsx +102 -0
  325. package/src/grapher/stackedCharts/StackedConstants.ts +109 -0
  326. package/src/grapher/stackedCharts/StackedDiscreteBarChart.tsx +270 -0
  327. package/src/grapher/stackedCharts/StackedDiscreteBarChartState.ts +296 -0
  328. package/src/grapher/stackedCharts/StackedDiscreteBarChartThumbnail.tsx +27 -0
  329. package/src/grapher/stackedCharts/StackedDiscreteBars.tsx +648 -0
  330. package/src/grapher/stackedCharts/StackedUtils.ts +142 -0
  331. package/src/grapher/tabs/Tabs.scss +169 -0
  332. package/src/grapher/tabs/Tabs.tsx +54 -0
  333. package/src/grapher/tabs/TabsWithDropdown.scss +62 -0
  334. package/src/grapher/tabs/TabsWithDropdown.tsx +114 -0
  335. package/src/grapher/testData/OwidTestData.sample.ts +273 -0
  336. package/src/grapher/testData/OwidTestData.ts +64 -0
  337. package/src/grapher/timeline/TimelineComponent.scss +139 -0
  338. package/src/grapher/timeline/TimelineComponent.tsx +658 -0
  339. package/src/grapher/timeline/TimelineController.ts +368 -0
  340. package/src/grapher/timeline/readme.md +7 -0
  341. package/src/grapher/tooltip/Tooltip.scss +510 -0
  342. package/src/grapher/tooltip/Tooltip.tsx +294 -0
  343. package/src/grapher/tooltip/TooltipContents.tsx +383 -0
  344. package/src/grapher/tooltip/TooltipProps.ts +123 -0
  345. package/src/grapher/tooltip/TooltipState.ts +81 -0
  346. package/src/grapher/verticalLabels/VerticalLabels.tsx +31 -0
  347. package/src/grapher/verticalLabels/VerticalLabelsState.ts +154 -0
  348. package/src/index.ts +226 -0
  349. package/src/styles/charts.scss +15 -0
  350. package/src/types/NominalType.ts +30 -0
  351. package/src/types/OwidOrigin.ts +18 -0
  352. package/src/types/OwidSource.ts +9 -0
  353. package/src/types/OwidVariable.ts +133 -0
  354. package/src/types/OwidVariableDisplayConfigInterface.ts +49 -0
  355. package/src/types/analyticsTypes.ts +54 -0
  356. package/src/types/dbTypes/Tags.ts +11 -0
  357. package/src/types/domainTypes/Archive.ts +139 -0
  358. package/src/types/domainTypes/Author.ts +28 -0
  359. package/src/types/domainTypes/ContentGraph.ts +76 -0
  360. package/src/types/domainTypes/CoreTableTypes.ts +305 -0
  361. package/src/types/domainTypes/DeployStatus.ts +23 -0
  362. package/src/types/domainTypes/Layout.ts +34 -0
  363. package/src/types/domainTypes/Posts.ts +34 -0
  364. package/src/types/domainTypes/Search.ts +299 -0
  365. package/src/types/domainTypes/Site.ts +8 -0
  366. package/src/types/domainTypes/StaticViz.ts +64 -0
  367. package/src/types/domainTypes/Toc.ts +11 -0
  368. package/src/types/domainTypes/Tombstone.ts +19 -0
  369. package/src/types/domainTypes/Various.ts +79 -0
  370. package/src/types/gdocTypes/Gdoc.ts +280 -0
  371. package/src/types/grapherTypes/BinningStrategyTypes.ts +46 -0
  372. package/src/types/grapherTypes/GrapherConstants.ts +53 -0
  373. package/src/types/grapherTypes/GrapherTypes.ts +743 -0
  374. package/src/types/index.ts +316 -0
  375. package/src/types/wordpressTypes/WordpressTypes.ts +9 -0
  376. package/src/utils/Bounds.ts +439 -0
  377. package/src/utils/BrowserUtils.ts +12 -0
  378. package/src/utils/FuzzySearch.ts +74 -0
  379. package/src/utils/MultiDimDataPageConfig.ts +31 -0
  380. package/src/utils/OwidVariable.ts +82 -0
  381. package/src/utils/PointVector.ts +97 -0
  382. package/src/utils/PromiseCache.ts +36 -0
  383. package/src/utils/PromiseSwitcher.ts +52 -0
  384. package/src/utils/TimeBounds.ts +130 -0
  385. package/src/utils/Tippy.tsx +57 -0
  386. package/src/utils/Util.ts +2369 -0
  387. package/src/utils/archival/archivalDate.ts +48 -0
  388. package/src/utils/dayjs.ts +32 -0
  389. package/src/utils/formatValue.ts +242 -0
  390. package/src/utils/grapherConfigUtils.ts +81 -0
  391. package/src/utils/image.ts +225 -0
  392. package/src/utils/index.ts +318 -0
  393. package/src/utils/isPresent.ts +5 -0
  394. package/src/utils/metadataHelpers.ts +329 -0
  395. package/src/utils/persistable/Persistable.ts +82 -0
  396. package/src/utils/persistable/readme.md +50 -0
  397. package/src/utils/regions.json +5635 -0
  398. package/src/utils/regions.ts +463 -0
  399. package/src/utils/serializers.ts +16 -0
  400. package/src/utils/string.ts +42 -0
  401. package/src/utils/urls/Url.ts +195 -0
  402. package/src/utils/urls/UrlMigration.ts +10 -0
  403. package/src/utils/urls/UrlUtils.ts +54 -0
  404. package/src/utils/urls/readme.md +90 -0
@@ -0,0 +1,1772 @@
1
+ import * as _ from "lodash-es"
2
+ import { lazy } from "../../utils/index.js"
3
+ import { ColorSchemeInterface, ColorSchemeName } from "../../types/index.js"
4
+ import * as R from "remeda"
5
+
6
+ // TODO: Initialize CustomColorSchemes lazily
7
+ export const CustomColorSchemes: ColorSchemeInterface[] = []
8
+
9
+ // Create some of our own!
10
+
11
+ export const OwidDistinctColors = {
12
+ Purple: "#6d3e91",
13
+ DarkOrange: "#c05917",
14
+ LightTeal: "#58ac8c",
15
+ Blue: "#286bbb",
16
+ Maroon: "#883039",
17
+ Camel: "#bc8e5a",
18
+ MidnightBlue: "#00295b",
19
+ DustyCoral: "#c15065",
20
+ DarkOliveGreen: "#18470f",
21
+ DarkCopper: "#9a5129",
22
+ Peach: "#e56e5a",
23
+ Mauve: "#a2559c",
24
+ Turquoise: "#38aaba",
25
+ OliveGreen: "#578145",
26
+ Cherry: "#970046",
27
+ Teal: "#00847e",
28
+ RustyOrange: "#b13507",
29
+ Denim: "#4c6a9c",
30
+ Fuchsia: "#cf0a66",
31
+ TealishGreen: "#00875e",
32
+ Copper: "#b16214",
33
+ DarkMauve: "#8c4569",
34
+ Lime: "#3b8e1d",
35
+ Coral: "#d73c50",
36
+ } as const
37
+
38
+ const OwidDistinctColorsNames = lazy(() => R.invert(OwidDistinctColors))
39
+
40
+ // These are variations of some of the colors above where the original color would have too little
41
+ // contrast against a white background for thin lines or text elements
42
+ export const DarkerOwidDistinctColors: Record<string, string> = {
43
+ DarkOrangeDarker: "#be5915",
44
+ PeachDarker: "#c4523e",
45
+ LightTealDarker: "#2c8465",
46
+ TurquoiseDarker: "#008291",
47
+ CamelDarker: "#996d39",
48
+ LimeDarker: "#338711",
49
+ }
50
+
51
+ const darkerColorReplacementsHexToReplacementColorName = {
52
+ [OwidDistinctColors.DarkOrange]: DarkerOwidDistinctColors.DarkOrangeDarker,
53
+ [OwidDistinctColors.Peach]: DarkerOwidDistinctColors.PeachDarker,
54
+ [OwidDistinctColors.LightTeal]: DarkerOwidDistinctColors.LightTealDarker,
55
+ [OwidDistinctColors.Turquoise]: DarkerOwidDistinctColors.TurquoiseDarker,
56
+ [OwidDistinctColors.Camel]: DarkerOwidDistinctColors.CamelDarker,
57
+ [OwidDistinctColors.Lime]: DarkerOwidDistinctColors.LimeDarker,
58
+ } as Record<string, string>
59
+
60
+ // TODO: Make this into a lazy initialization
61
+ export const OwidDistinctLinesColors = {
62
+ ..._.omit(OwidDistinctColors, Object.keys(DarkerOwidDistinctColors)),
63
+ ...DarkerOwidDistinctColors,
64
+ }
65
+
66
+ // Used for looking up names from color hex values
67
+ const OwidDistinctLinesColorNames = lazy(() =>
68
+ R.invert(OwidDistinctLinesColors)
69
+ )
70
+
71
+ // Below are 5 variations of the same colors in different permutations
72
+ export const CategoricalColorsPaletteA = [
73
+ OwidDistinctColors.Denim,
74
+ OwidDistinctColors.Maroon,
75
+ OwidDistinctColors.OliveGreen,
76
+ OwidDistinctColors.RustyOrange,
77
+ OwidDistinctColors.Copper,
78
+ OwidDistinctColors.Cherry,
79
+ OwidDistinctColors.Coral,
80
+ OwidDistinctColors.MidnightBlue,
81
+ OwidDistinctColors.Teal,
82
+ OwidDistinctColors.Camel,
83
+ OwidDistinctColors.Mauve,
84
+ OwidDistinctColors.DarkOliveGreen,
85
+ ]
86
+
87
+ export const CategoricalColorsPaletteB = [
88
+ OwidDistinctColors.Teal,
89
+ OwidDistinctColors.MidnightBlue,
90
+ OwidDistinctColors.DustyCoral,
91
+ OwidDistinctColors.Turquoise,
92
+ OwidDistinctColors.DarkMauve,
93
+ OwidDistinctColors.DarkOliveGreen,
94
+ OwidDistinctColors.RustyOrange,
95
+ OwidDistinctColors.Camel,
96
+ OwidDistinctColors.Blue,
97
+ OwidDistinctColors.Cherry,
98
+ OwidDistinctColors.LightTeal,
99
+ OwidDistinctColors.DarkCopper,
100
+ OwidDistinctColors.Peach,
101
+ ]
102
+
103
+ export const CategoricalColorsPaletteC = [
104
+ OwidDistinctColors.Purple,
105
+ OwidDistinctColors.DarkOrange,
106
+ OwidDistinctColors.LightTeal,
107
+ OwidDistinctColors.Blue,
108
+ OwidDistinctColors.Maroon,
109
+ OwidDistinctColors.Camel,
110
+ OwidDistinctColors.MidnightBlue,
111
+ OwidDistinctColors.DustyCoral,
112
+ OwidDistinctColors.DarkOliveGreen,
113
+ OwidDistinctColors.DarkCopper,
114
+ OwidDistinctColors.Peach,
115
+ OwidDistinctColors.Mauve,
116
+ OwidDistinctColors.Turquoise,
117
+ OwidDistinctColors.OliveGreen,
118
+ OwidDistinctColors.Cherry,
119
+ OwidDistinctColors.Teal,
120
+ OwidDistinctColors.RustyOrange,
121
+ OwidDistinctColors.Denim,
122
+ OwidDistinctColors.Fuchsia,
123
+ OwidDistinctColors.TealishGreen,
124
+ OwidDistinctColors.Copper,
125
+ OwidDistinctColors.DarkMauve,
126
+ OwidDistinctColors.Lime,
127
+ OwidDistinctColors.Coral,
128
+ ]
129
+
130
+ export const CategoricalColorsPaletteD = [
131
+ OwidDistinctColors.DustyCoral,
132
+ OwidDistinctColors.DarkOliveGreen,
133
+ OwidDistinctColors.Camel,
134
+ OwidDistinctColors.DarkMauve,
135
+ OwidDistinctColors.Turquoise,
136
+ OwidDistinctColors.TealishGreen,
137
+ OwidDistinctColors.Peach,
138
+ OwidDistinctColors.DarkCopper,
139
+ OwidDistinctColors.Fuchsia,
140
+ OwidDistinctColors.MidnightBlue,
141
+ ]
142
+
143
+ export const CategoricalColorsPaletteE = [
144
+ OwidDistinctColors.DarkCopper,
145
+ OwidDistinctColors.Peach,
146
+ OwidDistinctColors.Blue,
147
+ OwidDistinctColors.DarkOliveGreen,
148
+ OwidDistinctColors.Purple,
149
+ OwidDistinctColors.Teal,
150
+ OwidDistinctColors.Maroon,
151
+ OwidDistinctColors.Coral,
152
+ OwidDistinctColors.OliveGreen,
153
+ OwidDistinctColors.Camel,
154
+ OwidDistinctColors.DarkMauve,
155
+ ]
156
+ export const OwidDistinctColorScheme = {
157
+ name: ColorSchemeName["owid-distinct"],
158
+ displayName: "OWID Distinct",
159
+ singleColorScale: false,
160
+ isDistinct: true,
161
+ // We use the feature of ColorSchemes to use the Palette A permutation
162
+ // for 12 categories or less and the Palette C to reach up to 24 different
163
+ // colors
164
+ colorSets: [CategoricalColorsPaletteA, CategoricalColorsPaletteC],
165
+ }
166
+ CustomColorSchemes.push(OwidDistinctColorScheme)
167
+
168
+ const OwidDistinctLinesPalette = [
169
+ OwidDistinctColors.Denim,
170
+ OwidDistinctColors.RustyOrange,
171
+ DarkerOwidDistinctColors.CamelDarker,
172
+ DarkerOwidDistinctColors.LightTealDarker,
173
+ OwidDistinctColors.Purple,
174
+ OwidDistinctColors.Maroon,
175
+ OwidDistinctColors.MidnightBlue,
176
+ OwidDistinctColors.Mauve,
177
+ OwidDistinctColors.DarkCopper,
178
+ DarkerOwidDistinctColors.TurquoiseDarker,
179
+ OwidDistinctColors.Cherry,
180
+ DarkerOwidDistinctColors.LimeDarker,
181
+ DarkerOwidDistinctColors.PeachDarker,
182
+ OwidDistinctColors.Blue,
183
+ OwidDistinctColors.DarkOliveGreen,
184
+ OwidDistinctColors.Coral,
185
+ OwidDistinctColors.Copper,
186
+ OwidDistinctColors.Teal,
187
+ OwidDistinctColors.Fuchsia,
188
+ OwidDistinctColors.OliveGreen,
189
+ DarkerOwidDistinctColors.DarkOrangeDarker,
190
+ OwidDistinctColors.DarkMauve,
191
+ OwidDistinctColors.TealishGreen,
192
+ OwidDistinctColors.DustyCoral,
193
+ ]
194
+
195
+ export const OwidDistinctLinesColorScheme = {
196
+ name: ColorSchemeName["OwidDistinctLines"],
197
+ displayName: "OWID Distinct (lines)",
198
+ singleColorScale: false,
199
+ isDistinct: true,
200
+ colorSets: [OwidDistinctLinesPalette],
201
+ }
202
+ CustomColorSchemes.push(OwidDistinctLinesColorScheme)
203
+
204
+ export const OwidCategoricalAScheme = {
205
+ name: ColorSchemeName["OwidCategoricalA"],
206
+ displayName: "OWID categorical A",
207
+ singleColorScale: false,
208
+ isDistinct: true,
209
+ colorSets: [CategoricalColorsPaletteA],
210
+ }
211
+ CustomColorSchemes.push(OwidCategoricalAScheme)
212
+
213
+ export const OwidCategoricalBScheme = {
214
+ name: ColorSchemeName["OwidCategoricalB"],
215
+ displayName: "OWID categorical B",
216
+ singleColorScale: false,
217
+ isDistinct: true,
218
+ colorSets: [CategoricalColorsPaletteB],
219
+ }
220
+ CustomColorSchemes.push(OwidCategoricalBScheme)
221
+
222
+ export const OwidCategoricalCScheme = {
223
+ name: ColorSchemeName["OwidCategoricalC"],
224
+ displayName: "OWID categorical C",
225
+ singleColorScale: false,
226
+ isDistinct: true,
227
+ colorSets: [CategoricalColorsPaletteC],
228
+ }
229
+ CustomColorSchemes.push(OwidCategoricalCScheme)
230
+
231
+ export const OwidCategoricalDScheme = {
232
+ name: ColorSchemeName["OwidCategoricalD"],
233
+ displayName: "OWID categorical D",
234
+ singleColorScale: false,
235
+ isDistinct: true,
236
+ colorSets: [CategoricalColorsPaletteD],
237
+ }
238
+ CustomColorSchemes.push(OwidCategoricalDScheme)
239
+
240
+ export const OwidCategoricalEScheme = {
241
+ name: ColorSchemeName["OwidCategoricalE"],
242
+ displayName: "OWID categorical E",
243
+ singleColorScale: false,
244
+ isDistinct: true,
245
+ colorSets: [CategoricalColorsPaletteE],
246
+ }
247
+ CustomColorSchemes.push(OwidCategoricalEScheme)
248
+
249
+ export const EnergyColors = {
250
+ Coal: OwidDistinctColors.Maroon,
251
+ Oil: OwidDistinctColors.DustyCoral,
252
+ Gas: OwidDistinctColors.Purple,
253
+ Biomass: OwidDistinctColors.DarkCopper,
254
+ Hydropower: OwidDistinctColors.Blue,
255
+ Nuclear: OwidDistinctColors.Teal,
256
+ Wind: OwidDistinctColors.MidnightBlue,
257
+ Solar: OwidDistinctColors.Peach,
258
+ OtherRenewables: OwidDistinctColors.OliveGreen,
259
+ }
260
+
261
+ // Used for looking up color names from hex values
262
+ const EnergyColorsNames = lazy(() => R.invert(EnergyColors))
263
+
264
+ const EnergyColorPalette = [
265
+ EnergyColors.Coal,
266
+ EnergyColors.Oil,
267
+ EnergyColors.Gas,
268
+ EnergyColors.Biomass,
269
+ EnergyColors.Hydropower,
270
+ EnergyColors.Nuclear,
271
+ EnergyColors.Wind,
272
+ EnergyColors.Solar,
273
+ EnergyColors.OtherRenewables,
274
+ ]
275
+
276
+ export const OwidEnergy = {
277
+ name: ColorSchemeName["OwidEnergy"],
278
+ displayName: "OWID Energy",
279
+ singleColorScale: false,
280
+ isDistinct: true,
281
+ colorSets: [EnergyColorPalette],
282
+ colorMap: EnergyColors,
283
+ }
284
+ CustomColorSchemes.push(OwidEnergy)
285
+
286
+ function getModifiedLinesNames(
287
+ colorNames: Record<string, string>
288
+ ): Record<string, string> {
289
+ return Object.fromEntries(
290
+ Object.entries(colorNames).map(([k, v]) => [
291
+ k in darkerColorReplacementsHexToReplacementColorName
292
+ ? darkerColorReplacementsHexToReplacementColorName[k]
293
+ : k,
294
+ v,
295
+ ])
296
+ )
297
+ }
298
+
299
+ const EnergyColorsLinesNames = lazy(() =>
300
+ getModifiedLinesNames(EnergyColorsNames())
301
+ )
302
+
303
+ export const OwidEnergyLines = getModifiedLinesColorScheme(OwidEnergy)
304
+ CustomColorSchemes.push(OwidEnergyLines)
305
+
306
+ CustomColorSchemes.push({
307
+ name: ColorSchemeName.stackedAreaDefault,
308
+ displayName: "OWID 4 Color Gradient (=Owid Distinct)",
309
+ singleColorScale: false,
310
+ isDistinct: true,
311
+ // TODO: this is now a copy of owid-distinct. After a data migration to get
312
+ // rid of stackedAreaDefault in existing chart configs we should replace it with
313
+ // owid-distinct
314
+ // We use the feature of ColorSchemes to use the Palette A permutation
315
+ // for 12 categories or less and the Palette C to reach up to 24 different
316
+ // colors
317
+ colorSets: [CategoricalColorsPaletteA, CategoricalColorsPaletteC],
318
+ })
319
+
320
+ export const ContinentColors = {
321
+ Africa: OwidDistinctColors.Mauve,
322
+ Antarctica: OwidDistinctColors.DarkCopper,
323
+ Asia: OwidDistinctColors.Teal,
324
+ Europe: OwidDistinctColors.Denim,
325
+ NorthAmerica: OwidDistinctColors.Peach,
326
+ ["North America"]: OwidDistinctColors.Peach,
327
+ SouthAmerica: OwidDistinctColors.Maroon,
328
+ ["South America"]: OwidDistinctColors.Maroon,
329
+ Oceania: OwidDistinctColors.Turquoise,
330
+ World: OwidDistinctColors.DarkOliveGreen,
331
+ SubSaharanAfrica: OwidDistinctColors.DarkMauve,
332
+ MiddleEastNorthAfrica: OwidDistinctColors.Purple,
333
+ CentralAsia: OwidDistinctColors.LightTeal,
334
+ EastAsia: OwidDistinctColors.TealishGreen,
335
+ SoutheastAsia: OwidDistinctColors.Lime,
336
+ SouthAsia: OwidDistinctColors.OliveGreen,
337
+ CentralAmericaAndCarribean: OwidDistinctColors.DustyCoral,
338
+ EasternEurope: OwidDistinctColors.Blue,
339
+ WesternEurope: OwidDistinctColors.MidnightBlue,
340
+ AustralasiaAndOceania: OwidDistinctColors.Copper,
341
+
342
+ // World Bank regions
343
+ "East Asia and Pacific (WB)": OwidDistinctColors.Copper,
344
+ "Europe and Central Asia (WB)": OwidDistinctColors.Denim,
345
+ "Middle East, North Africa, Afghanistan and Pakistan (WB)":
346
+ OwidDistinctColors.Camel,
347
+ "North America (WB)": OwidDistinctColors.Peach,
348
+ "South Asia (WB)": OwidDistinctColors.OliveGreen,
349
+ "Sub-Saharan Africa (WB)": OwidDistinctColors.DarkMauve,
350
+ "Latin America and Caribbean (WB)": OwidDistinctColors.Maroon,
351
+
352
+ // UN regions
353
+ "Asia (UN)": OwidDistinctColors.Teal,
354
+ "Africa (UN)": OwidDistinctColors.Mauve,
355
+ "Europe (UN)": OwidDistinctColors.Denim,
356
+ "Oceania (UN)": OwidDistinctColors.Turquoise,
357
+ "Northern America (UN)": OwidDistinctColors.Peach,
358
+ "Latin America and the Caribbean (UN)": OwidDistinctColors.Maroon,
359
+
360
+ // WHO regions
361
+ "Africa (WHO)": OwidDistinctColors.Mauve,
362
+ "Europe (WHO)": OwidDistinctColors.Denim,
363
+ "Americas (WHO)": OwidDistinctColors.Peach,
364
+ "South-East Asia (WHO)": OwidDistinctColors.Lime,
365
+ "Western Pacific (WHO)": OwidDistinctColors.Turquoise,
366
+ "Eastern Mediterranean (WHO)": OwidDistinctColors.Camel,
367
+
368
+ // Maddison regions
369
+ "Australia and New Zealand": OwidDistinctColors.Teal,
370
+ "Central and Southern Asia": OwidDistinctColors.OliveGreen,
371
+ "Europe and Northern America": OwidDistinctColors.Denim,
372
+ "Eastern and South-Eastern Asia": OwidDistinctColors.Copper,
373
+ "Northern Africa and Western Asia": OwidDistinctColors.Camel,
374
+ "East Asia": OwidDistinctColors.Copper,
375
+ "Latin America": OwidDistinctColors.Maroon,
376
+ "Eastern Europe": OwidDistinctColors.MidnightBlue,
377
+ "Western Europe": OwidDistinctColors.Denim,
378
+ "Western Offshoots": OwidDistinctColors.Peach,
379
+ "Sub Saharan Africa": OwidDistinctColors.DarkMauve,
380
+ "South and South East Asia": OwidDistinctColors.OliveGreen,
381
+ "Middle East and North Africa": OwidDistinctColors.Camel,
382
+
383
+ // Pew Research Center regions
384
+ "Europe (Pew)": OwidDistinctColors.Denim,
385
+ "Asia-Pacific (Pew)": OwidDistinctColors.Teal,
386
+ "North America (Pew)": OwidDistinctColors.Peach,
387
+ "Sub-Saharan Africa (Pew)": OwidDistinctColors.DarkMauve,
388
+ "Latin America-Caribbean (Pew)": OwidDistinctColors.Maroon,
389
+ "Middle East-North Africa (Pew)": OwidDistinctColors.Camel,
390
+ } as const
391
+
392
+ // Used for looking up color names from hex values
393
+ const ContinentColorsNames = lazy(() => R.invert(ContinentColors))
394
+
395
+ const ContinentColorPalette = [
396
+ ContinentColors.Africa,
397
+ ContinentColors.Asia,
398
+ ContinentColors.Europe,
399
+ ContinentColors.NorthAmerica,
400
+ ContinentColors.Oceania,
401
+ ContinentColors.SouthAmerica,
402
+ ContinentColors.World,
403
+ ContinentColors.SubSaharanAfrica,
404
+ ContinentColors.MiddleEastNorthAfrica,
405
+ ContinentColors.CentralAsia,
406
+ ContinentColors.EastAsia,
407
+ ContinentColors.SoutheastAsia,
408
+ ContinentColors.SouthAsia,
409
+ ContinentColors.CentralAmericaAndCarribean,
410
+ ContinentColors.EasternEurope,
411
+ ContinentColors.WesternEurope,
412
+ ContinentColors.AustralasiaAndOceania,
413
+ ContinentColors.Antarctica,
414
+ ]
415
+
416
+ export const ContinentColorsColorScheme = {
417
+ name: ColorSchemeName.continents,
418
+ displayName: "Continents",
419
+ singleColorScale: false,
420
+ isDistinct: true,
421
+ colorSets: [ContinentColorPalette],
422
+ colorMap: ContinentColors,
423
+ }
424
+
425
+ CustomColorSchemes.push(ContinentColorsColorScheme)
426
+
427
+ function getModifiedLinesColorScheme(
428
+ colorScheme: ColorSchemeInterface
429
+ ): ColorSchemeInterface {
430
+ const colors = colorScheme.colorSets[0]
431
+ const modifiedColors = colors.map((color) =>
432
+ color in darkerColorReplacementsHexToReplacementColorName
433
+ ? darkerColorReplacementsHexToReplacementColorName[color]
434
+ : color
435
+ )
436
+
437
+ // If the scheme has a colorMap, we need to create a modified version with darker colors
438
+ const modifiedColorMap = colorScheme.colorMap
439
+ ? _.mapValues(colorScheme.colorMap, (color) =>
440
+ color in darkerColorReplacementsHexToReplacementColorName
441
+ ? darkerColorReplacementsHexToReplacementColorName[color]
442
+ : color
443
+ )
444
+ : undefined
445
+
446
+ return {
447
+ ...colorScheme,
448
+ colorSets: [modifiedColors],
449
+ colorMap: modifiedColorMap,
450
+ name: colorScheme.name + "Lines",
451
+ displayName: (colorScheme.displayName ?? "") + " (Lines)",
452
+ }
453
+ }
454
+
455
+ const ContinentColorsLinesNames = lazy(() =>
456
+ getModifiedLinesNames(ContinentColorsNames())
457
+ )
458
+
459
+ export const ContinentColorsLinesColorScheme = getModifiedLinesColorScheme(
460
+ ContinentColorsColorScheme
461
+ )
462
+
463
+ CustomColorSchemes.push(ContinentColorsLinesColorScheme)
464
+
465
+ export const SingleColorDenim = {
466
+ name: ColorSchemeName.SingleColorDenim,
467
+ displayName: "Single color: Denim",
468
+ singleColorScale: true,
469
+ isDistinct: true,
470
+ colorSets: [[OwidDistinctColors.Denim]],
471
+ }
472
+
473
+ CustomColorSchemes.push(SingleColorDenim)
474
+
475
+ export const SingleColorTeal = {
476
+ name: ColorSchemeName.SingleColorTeal,
477
+ displayName: "Single color: Teal",
478
+ singleColorScale: true,
479
+ isDistinct: true,
480
+ colorSets: [[OwidDistinctColors.Teal]],
481
+ }
482
+
483
+ CustomColorSchemes.push(SingleColorTeal)
484
+
485
+ export const SingleColorPurple = {
486
+ name: ColorSchemeName.SingleColorPurple,
487
+ displayName: "Single color: Purple",
488
+ singleColorScale: true,
489
+ isDistinct: true,
490
+ colorSets: [[OwidDistinctColors.Purple]],
491
+ }
492
+
493
+ CustomColorSchemes.push(SingleColorPurple)
494
+
495
+ export const SingleColorDustyCoral = {
496
+ name: ColorSchemeName.SingleColorDustyCoral,
497
+ displayName: "Single color: Dusty coral",
498
+ singleColorScale: true,
499
+ isDistinct: true,
500
+ colorSets: [[OwidDistinctColors.DustyCoral]],
501
+ }
502
+
503
+ CustomColorSchemes.push(SingleColorDustyCoral)
504
+
505
+ export const SingleColorDarkCopper = {
506
+ name: ColorSchemeName.SingleColorDarkCopper,
507
+ displayName: "Single color: Dark copper",
508
+ singleColorScale: true,
509
+ isDistinct: true,
510
+ colorSets: [[OwidDistinctColors.DarkCopper]],
511
+ }
512
+
513
+ CustomColorSchemes.push(SingleColorDarkCopper)
514
+
515
+ export const SingleColorGradientDenim = {
516
+ name: ColorSchemeName.SingleColorGradientDenim,
517
+ displayName: "Single color gradient: Denim",
518
+ singleColorScale: true,
519
+ isDistinct: false,
520
+ colorSets: [
521
+ [
522
+ "#00173e",
523
+ "#152a55",
524
+ "#273f6c",
525
+ "#3a5484",
526
+ "#4e6b9e",
527
+ "#6683b5",
528
+ "#7f9bcd",
529
+ "#98b3e6",
530
+ "#b2ccff",
531
+ ],
532
+ ],
533
+ }
534
+ CustomColorSchemes.push(SingleColorGradientDenim)
535
+ export const SingleColorGradientTeal = {
536
+ name: ColorSchemeName.SingleColorGradientTeal,
537
+ displayName: "Single color gradient: Teal",
538
+ singleColorScale: true,
539
+ isDistinct: false,
540
+ colorSets: [
541
+ [
542
+ "#002926",
543
+ "#003f3b",
544
+ "#005551",
545
+ "#006e68",
546
+ "#088780",
547
+ "#339f98",
548
+ "#51b7b0",
549
+ "#6cd1c9",
550
+ "#86ebe3",
551
+ ],
552
+ ],
553
+ }
554
+ CustomColorSchemes.push(SingleColorGradientTeal)
555
+
556
+ export const SingleColorGradientPurple = {
557
+ name: ColorSchemeName.SingleColorGradientPurple,
558
+ displayName: "Single color gradient: Purple",
559
+ singleColorScale: true,
560
+ isDistinct: false,
561
+ colorSets: [
562
+ [
563
+ "#3d1161",
564
+ "#542777",
565
+ "#6b3d8f",
566
+ "#8354a2",
567
+ "#9c6bb4",
568
+ "#b484c6",
569
+ "#cd9dd9",
570
+ "#e5b7ec",
571
+ "#ffd1ff",
572
+ ],
573
+ ],
574
+ }
575
+ CustomColorSchemes.push(SingleColorGradientPurple)
576
+
577
+ export const SingleColorGradientDustyCoral = {
578
+ name: ColorSchemeName.SingleColorGradientDustyCoral,
579
+ displayName: "Single color gradient: DustyCoral",
580
+ singleColorScale: true,
581
+ isDistinct: false,
582
+ colorSets: [
583
+ [
584
+ "#580014",
585
+ "#711626",
586
+ "#8b293a",
587
+ "#a53c4e",
588
+ "#bf4e63",
589
+ "#d1697b",
590
+ "#e18495",
591
+ "#f09dae",
592
+ "#ffb8c9",
593
+ ],
594
+ ],
595
+ }
596
+ CustomColorSchemes.push(SingleColorGradientDustyCoral)
597
+ export const SingleColorGradientDarkCopper = {
598
+ name: ColorSchemeName.SingleColorGradientDarkCopper,
599
+ displayName: "Single color gradient: DarkCopper",
600
+ singleColorScale: true,
601
+ isDistinct: false,
602
+ colorSets: [
603
+ [
604
+ "#390000",
605
+ "#501510",
606
+ "#692919",
607
+ "#823d21",
608
+ "#9c532a",
609
+ "#b46a40",
610
+ "#cd8257",
611
+ "#e69a6e",
612
+ "#ffb285",
613
+ ],
614
+ ],
615
+ }
616
+ CustomColorSchemes.push(SingleColorGradientDarkCopper)
617
+
618
+ export const BinaryMapPaletteA = {
619
+ name: ColorSchemeName.BinaryMapPaletteA,
620
+ displayName: "Binary map palette A",
621
+ singleColorScale: false,
622
+ isDistinct: true,
623
+ colorSets: [["#dfc27d", "#80cdc1"]],
624
+ }
625
+
626
+ CustomColorSchemes.push(BinaryMapPaletteA)
627
+
628
+ export const BinaryMapPaletteB = {
629
+ name: ColorSchemeName.BinaryMapPaletteB,
630
+ displayName: "Binary map palette B",
631
+ singleColorScale: false,
632
+ isDistinct: true,
633
+ colorSets: [["#f1b6da", "#b8e186"]],
634
+ }
635
+
636
+ CustomColorSchemes.push(BinaryMapPaletteB)
637
+
638
+ export const BinaryMapPaletteC = {
639
+ name: ColorSchemeName.BinaryMapPaletteC,
640
+ displayName: "Binary map palette C",
641
+ singleColorScale: false,
642
+ isDistinct: true,
643
+ colorSets: [["#c2a5cf", "#a6dba0"]],
644
+ }
645
+
646
+ CustomColorSchemes.push(BinaryMapPaletteC)
647
+
648
+ export const BinaryMapPaletteD = {
649
+ name: ColorSchemeName.BinaryMapPaletteD,
650
+ displayName: "Binary map palette D",
651
+ singleColorScale: false,
652
+ isDistinct: true,
653
+ colorSets: [["#fdb863", "#b2abd2"]],
654
+ }
655
+
656
+ CustomColorSchemes.push(BinaryMapPaletteD)
657
+
658
+ export const BinaryMapPaletteE = {
659
+ name: ColorSchemeName.BinaryMapPaletteE,
660
+ displayName: "Binary map palette E",
661
+ singleColorScale: false,
662
+ isDistinct: true,
663
+ colorSets: [["#f4a582", "#92c5de"]],
664
+ }
665
+
666
+ CustomColorSchemes.push(BinaryMapPaletteE)
667
+
668
+ export const DefaultColorScheme = OwidDistinctColorScheme
669
+
670
+ export function getColorNameAndSemanticPalettes(
671
+ color: string,
672
+ baseColorSchemeNames: Record<string, string>,
673
+ continentsColorSchemeNames: Record<string, string>,
674
+ energyColorSchemeNames: Record<string, string>
675
+ ): string[] {
676
+ const colorNameStandardized = color.toUpperCase()
677
+ const owidDistinct =
678
+ colorNameStandardized in baseColorSchemeNames
679
+ ? `🎨 ${baseColorSchemeNames[colorNameStandardized]}`
680
+ : ""
681
+ const continents =
682
+ colorNameStandardized in continentsColorSchemeNames
683
+ ? `🌍 ${continentsColorSchemeNames[colorNameStandardized]}`
684
+ : ""
685
+ const energy =
686
+ colorNameStandardized in energyColorSchemeNames
687
+ ? `⚡ ${energyColorSchemeNames[colorNameStandardized]}`
688
+ : ""
689
+ const lines = [owidDistinct, continents, energy].filter((x) => x !== "")
690
+
691
+ return lines
692
+ }
693
+
694
+ export function getColorNameOwidDistinctAndSemanticPalettes(
695
+ color: string
696
+ ): string[] {
697
+ return getColorNameAndSemanticPalettes(
698
+ color,
699
+ OwidDistinctColorsNames(),
700
+ ContinentColorsNames(),
701
+ EnergyColorsNames()
702
+ )
703
+ }
704
+
705
+ export function getColorNameOwidDistinctLinesAndSemanticPalettes(
706
+ color: string
707
+ ): string[] {
708
+ return getColorNameAndSemanticPalettes(
709
+ color,
710
+ OwidDistinctLinesColorNames(),
711
+ ContinentColorsLinesNames(),
712
+ EnergyColorsLinesNames()
713
+ )
714
+ }
715
+
716
+ // Perceptual color scales from https://github.com/politiken-journalism/scale-color-perceptual
717
+ CustomColorSchemes.push({
718
+ name: ColorSchemeName.Viridis,
719
+ singleColorScale: false,
720
+ colorSets: [
721
+ [
722
+ "#440154",
723
+ "#440256",
724
+ "#450457",
725
+ "#450559",
726
+ "#46075a",
727
+ "#46085c",
728
+ "#460a5d",
729
+ "#460b5e",
730
+ "#470d60",
731
+ "#470e61",
732
+ "#471063",
733
+ "#471164",
734
+ "#471365",
735
+ "#481467",
736
+ "#481668",
737
+ "#481769",
738
+ "#48186a",
739
+ "#481a6c",
740
+ "#481b6d",
741
+ "#481c6e",
742
+ "#481d6f",
743
+ "#481f70",
744
+ "#482071",
745
+ "#482173",
746
+ "#482374",
747
+ "#482475",
748
+ "#482576",
749
+ "#482677",
750
+ "#482878",
751
+ "#482979",
752
+ "#472a7a",
753
+ "#472c7a",
754
+ "#472d7b",
755
+ "#472e7c",
756
+ "#472f7d",
757
+ "#46307e",
758
+ "#46327e",
759
+ "#46337f",
760
+ "#463480",
761
+ "#453581",
762
+ "#453781",
763
+ "#453882",
764
+ "#443983",
765
+ "#443a83",
766
+ "#443b84",
767
+ "#433d84",
768
+ "#433e85",
769
+ "#423f85",
770
+ "#424086",
771
+ "#424186",
772
+ "#414287",
773
+ "#414487",
774
+ "#404588",
775
+ "#404688",
776
+ "#3f4788",
777
+ "#3f4889",
778
+ "#3e4989",
779
+ "#3e4a89",
780
+ "#3e4c8a",
781
+ "#3d4d8a",
782
+ "#3d4e8a",
783
+ "#3c4f8a",
784
+ "#3c508b",
785
+ "#3b518b",
786
+ "#3b528b",
787
+ "#3a538b",
788
+ "#3a548c",
789
+ "#39558c",
790
+ "#39568c",
791
+ "#38588c",
792
+ "#38598c",
793
+ "#375a8c",
794
+ "#375b8d",
795
+ "#365c8d",
796
+ "#365d8d",
797
+ "#355e8d",
798
+ "#355f8d",
799
+ "#34608d",
800
+ "#34618d",
801
+ "#33628d",
802
+ "#33638d",
803
+ "#32648e",
804
+ "#32658e",
805
+ "#31668e",
806
+ "#31678e",
807
+ "#31688e",
808
+ "#30698e",
809
+ "#306a8e",
810
+ "#2f6b8e",
811
+ "#2f6c8e",
812
+ "#2e6d8e",
813
+ "#2e6e8e",
814
+ "#2e6f8e",
815
+ "#2d708e",
816
+ "#2d718e",
817
+ "#2c718e",
818
+ "#2c728e",
819
+ "#2c738e",
820
+ "#2b748e",
821
+ "#2b758e",
822
+ "#2a768e",
823
+ "#2a778e",
824
+ "#2a788e",
825
+ "#29798e",
826
+ "#297a8e",
827
+ "#297b8e",
828
+ "#287c8e",
829
+ "#287d8e",
830
+ "#277e8e",
831
+ "#277f8e",
832
+ "#27808e",
833
+ "#26818e",
834
+ "#26828e",
835
+ "#26828e",
836
+ "#25838e",
837
+ "#25848e",
838
+ "#25858e",
839
+ "#24868e",
840
+ "#24878e",
841
+ "#23888e",
842
+ "#23898e",
843
+ "#238a8d",
844
+ "#228b8d",
845
+ "#228c8d",
846
+ "#228d8d",
847
+ "#218e8d",
848
+ "#218f8d",
849
+ "#21908d",
850
+ "#21918c",
851
+ "#20928c",
852
+ "#20928c",
853
+ "#20938c",
854
+ "#1f948c",
855
+ "#1f958b",
856
+ "#1f968b",
857
+ "#1f978b",
858
+ "#1f988b",
859
+ "#1f998a",
860
+ "#1f9a8a",
861
+ "#1e9b8a",
862
+ "#1e9c89",
863
+ "#1e9d89",
864
+ "#1f9e89",
865
+ "#1f9f88",
866
+ "#1fa088",
867
+ "#1fa188",
868
+ "#1fa187",
869
+ "#1fa287",
870
+ "#20a386",
871
+ "#20a486",
872
+ "#21a585",
873
+ "#21a685",
874
+ "#22a785",
875
+ "#22a884",
876
+ "#23a983",
877
+ "#24aa83",
878
+ "#25ab82",
879
+ "#25ac82",
880
+ "#26ad81",
881
+ "#27ad81",
882
+ "#28ae80",
883
+ "#29af7f",
884
+ "#2ab07f",
885
+ "#2cb17e",
886
+ "#2db27d",
887
+ "#2eb37c",
888
+ "#2fb47c",
889
+ "#31b57b",
890
+ "#32b67a",
891
+ "#34b679",
892
+ "#35b779",
893
+ "#37b878",
894
+ "#38b977",
895
+ "#3aba76",
896
+ "#3bbb75",
897
+ "#3dbc74",
898
+ "#3fbc73",
899
+ "#40bd72",
900
+ "#42be71",
901
+ "#44bf70",
902
+ "#46c06f",
903
+ "#48c16e",
904
+ "#4ac16d",
905
+ "#4cc26c",
906
+ "#4ec36b",
907
+ "#50c46a",
908
+ "#52c569",
909
+ "#54c568",
910
+ "#56c667",
911
+ "#58c765",
912
+ "#5ac864",
913
+ "#5cc863",
914
+ "#5ec962",
915
+ "#60ca60",
916
+ "#63cb5f",
917
+ "#65cb5e",
918
+ "#67cc5c",
919
+ "#69cd5b",
920
+ "#6ccd5a",
921
+ "#6ece58",
922
+ "#70cf57",
923
+ "#73d056",
924
+ "#75d054",
925
+ "#77d153",
926
+ "#7ad151",
927
+ "#7cd250",
928
+ "#7fd34e",
929
+ "#81d34d",
930
+ "#84d44b",
931
+ "#86d549",
932
+ "#89d548",
933
+ "#8bd646",
934
+ "#8ed645",
935
+ "#90d743",
936
+ "#93d741",
937
+ "#95d840",
938
+ "#98d83e",
939
+ "#9bd93c",
940
+ "#9dd93b",
941
+ "#a0da39",
942
+ "#a2da37",
943
+ "#a5db36",
944
+ "#a8db34",
945
+ "#aadc32",
946
+ "#addc30",
947
+ "#b0dd2f",
948
+ "#b2dd2d",
949
+ "#b5de2b",
950
+ "#b8de29",
951
+ "#bade28",
952
+ "#bddf26",
953
+ "#c0df25",
954
+ "#c2df23",
955
+ "#c5e021",
956
+ "#c8e020",
957
+ "#cae11f",
958
+ "#cde11d",
959
+ "#d0e11c",
960
+ "#d2e21b",
961
+ "#d5e21a",
962
+ "#d8e219",
963
+ "#dae319",
964
+ "#dde318",
965
+ "#dfe318",
966
+ "#e2e418",
967
+ "#e5e419",
968
+ "#e7e419",
969
+ "#eae51a",
970
+ "#ece51b",
971
+ "#efe51c",
972
+ "#f1e51d",
973
+ "#f4e61e",
974
+ "#f6e620",
975
+ "#f8e621",
976
+ "#fbe723",
977
+ "#fde725",
978
+ ],
979
+ ],
980
+ })
981
+
982
+ CustomColorSchemes.push({
983
+ name: ColorSchemeName.Magma,
984
+ colorSets: [
985
+ [
986
+ "#000004",
987
+ "#010005",
988
+ "#010106",
989
+ "#010108",
990
+ "#020109",
991
+ "#02020b",
992
+ "#02020d",
993
+ "#03030f",
994
+ "#030312",
995
+ "#040414",
996
+ "#050416",
997
+ "#060518",
998
+ "#06051a",
999
+ "#07061c",
1000
+ "#08071e",
1001
+ "#090720",
1002
+ "#0a0822",
1003
+ "#0b0924",
1004
+ "#0c0926",
1005
+ "#0d0a29",
1006
+ "#0e0b2b",
1007
+ "#100b2d",
1008
+ "#110c2f",
1009
+ "#120d31",
1010
+ "#130d34",
1011
+ "#140e36",
1012
+ "#150e38",
1013
+ "#160f3b",
1014
+ "#180f3d",
1015
+ "#19103f",
1016
+ "#1a1042",
1017
+ "#1c1044",
1018
+ "#1d1147",
1019
+ "#1e1149",
1020
+ "#20114b",
1021
+ "#21114e",
1022
+ "#221150",
1023
+ "#241253",
1024
+ "#251255",
1025
+ "#271258",
1026
+ "#29115a",
1027
+ "#2a115c",
1028
+ "#2c115f",
1029
+ "#2d1161",
1030
+ "#2f1163",
1031
+ "#311165",
1032
+ "#331067",
1033
+ "#341069",
1034
+ "#36106b",
1035
+ "#38106c",
1036
+ "#390f6e",
1037
+ "#3b0f70",
1038
+ "#3d0f71",
1039
+ "#3f0f72",
1040
+ "#400f74",
1041
+ "#420f75",
1042
+ "#440f76",
1043
+ "#451077",
1044
+ "#471078",
1045
+ "#491078",
1046
+ "#4a1079",
1047
+ "#4c117a",
1048
+ "#4e117b",
1049
+ "#4f127b",
1050
+ "#51127c",
1051
+ "#52137c",
1052
+ "#54137d",
1053
+ "#56147d",
1054
+ "#57157e",
1055
+ "#59157e",
1056
+ "#5a167e",
1057
+ "#5c167f",
1058
+ "#5d177f",
1059
+ "#5f187f",
1060
+ "#601880",
1061
+ "#621980",
1062
+ "#641a80",
1063
+ "#651a80",
1064
+ "#671b80",
1065
+ "#681c81",
1066
+ "#6a1c81",
1067
+ "#6b1d81",
1068
+ "#6d1d81",
1069
+ "#6e1e81",
1070
+ "#701f81",
1071
+ "#721f81",
1072
+ "#732081",
1073
+ "#752181",
1074
+ "#762181",
1075
+ "#782281",
1076
+ "#792282",
1077
+ "#7b2382",
1078
+ "#7c2382",
1079
+ "#7e2482",
1080
+ "#802582",
1081
+ "#812581",
1082
+ "#832681",
1083
+ "#842681",
1084
+ "#862781",
1085
+ "#882781",
1086
+ "#892881",
1087
+ "#8b2981",
1088
+ "#8c2981",
1089
+ "#8e2a81",
1090
+ "#902a81",
1091
+ "#912b81",
1092
+ "#932b80",
1093
+ "#942c80",
1094
+ "#962c80",
1095
+ "#982d80",
1096
+ "#992d80",
1097
+ "#9b2e7f",
1098
+ "#9c2e7f",
1099
+ "#9e2f7f",
1100
+ "#a02f7f",
1101
+ "#a1307e",
1102
+ "#a3307e",
1103
+ "#a5317e",
1104
+ "#a6317d",
1105
+ "#a8327d",
1106
+ "#aa337d",
1107
+ "#ab337c",
1108
+ "#ad347c",
1109
+ "#ae347b",
1110
+ "#b0357b",
1111
+ "#b2357b",
1112
+ "#b3367a",
1113
+ "#b5367a",
1114
+ "#b73779",
1115
+ "#b83779",
1116
+ "#ba3878",
1117
+ "#bc3978",
1118
+ "#bd3977",
1119
+ "#bf3a77",
1120
+ "#c03a76",
1121
+ "#c23b75",
1122
+ "#c43c75",
1123
+ "#c53c74",
1124
+ "#c73d73",
1125
+ "#c83e73",
1126
+ "#ca3e72",
1127
+ "#cc3f71",
1128
+ "#cd4071",
1129
+ "#cf4070",
1130
+ "#d0416f",
1131
+ "#d2426f",
1132
+ "#d3436e",
1133
+ "#d5446d",
1134
+ "#d6456c",
1135
+ "#d8456c",
1136
+ "#d9466b",
1137
+ "#db476a",
1138
+ "#dc4869",
1139
+ "#de4968",
1140
+ "#df4a68",
1141
+ "#e04c67",
1142
+ "#e24d66",
1143
+ "#e34e65",
1144
+ "#e44f64",
1145
+ "#e55064",
1146
+ "#e75263",
1147
+ "#e85362",
1148
+ "#e95462",
1149
+ "#ea5661",
1150
+ "#eb5760",
1151
+ "#ec5860",
1152
+ "#ed5a5f",
1153
+ "#ee5b5e",
1154
+ "#ef5d5e",
1155
+ "#f05f5e",
1156
+ "#f1605d",
1157
+ "#f2625d",
1158
+ "#f2645c",
1159
+ "#f3655c",
1160
+ "#f4675c",
1161
+ "#f4695c",
1162
+ "#f56b5c",
1163
+ "#f66c5c",
1164
+ "#f66e5c",
1165
+ "#f7705c",
1166
+ "#f7725c",
1167
+ "#f8745c",
1168
+ "#f8765c",
1169
+ "#f9785d",
1170
+ "#f9795d",
1171
+ "#f97b5d",
1172
+ "#fa7d5e",
1173
+ "#fa7f5e",
1174
+ "#fa815f",
1175
+ "#fb835f",
1176
+ "#fb8560",
1177
+ "#fb8761",
1178
+ "#fc8961",
1179
+ "#fc8a62",
1180
+ "#fc8c63",
1181
+ "#fc8e64",
1182
+ "#fc9065",
1183
+ "#fd9266",
1184
+ "#fd9467",
1185
+ "#fd9668",
1186
+ "#fd9869",
1187
+ "#fd9a6a",
1188
+ "#fd9b6b",
1189
+ "#fe9d6c",
1190
+ "#fe9f6d",
1191
+ "#fea16e",
1192
+ "#fea36f",
1193
+ "#fea571",
1194
+ "#fea772",
1195
+ "#fea973",
1196
+ "#feaa74",
1197
+ "#feac76",
1198
+ "#feae77",
1199
+ "#feb078",
1200
+ "#feb27a",
1201
+ "#feb47b",
1202
+ "#feb67c",
1203
+ "#feb77e",
1204
+ "#feb97f",
1205
+ "#febb81",
1206
+ "#febd82",
1207
+ "#febf84",
1208
+ "#fec185",
1209
+ "#fec287",
1210
+ "#fec488",
1211
+ "#fec68a",
1212
+ "#fec88c",
1213
+ "#feca8d",
1214
+ "#fecc8f",
1215
+ "#fecd90",
1216
+ "#fecf92",
1217
+ "#fed194",
1218
+ "#fed395",
1219
+ "#fed597",
1220
+ "#fed799",
1221
+ "#fed89a",
1222
+ "#fdda9c",
1223
+ "#fddc9e",
1224
+ "#fddea0",
1225
+ "#fde0a1",
1226
+ "#fde2a3",
1227
+ "#fde3a5",
1228
+ "#fde5a7",
1229
+ "#fde7a9",
1230
+ "#fde9aa",
1231
+ "#fdebac",
1232
+ "#fcecae",
1233
+ "#fceeb0",
1234
+ "#fcf0b2",
1235
+ "#fcf2b4",
1236
+ "#fcf4b6",
1237
+ "#fcf6b8",
1238
+ "#fcf7b9",
1239
+ "#fcf9bb",
1240
+ "#fcfbbd",
1241
+ "#fcfdbf",
1242
+ ],
1243
+ ],
1244
+ })
1245
+
1246
+ CustomColorSchemes.push({
1247
+ name: ColorSchemeName.Plasma,
1248
+ colorSets: [
1249
+ [
1250
+ "#0d0887",
1251
+ "#100788",
1252
+ "#130789",
1253
+ "#16078a",
1254
+ "#19068c",
1255
+ "#1b068d",
1256
+ "#1d068e",
1257
+ "#20068f",
1258
+ "#220690",
1259
+ "#240691",
1260
+ "#260591",
1261
+ "#280592",
1262
+ "#2a0593",
1263
+ "#2c0594",
1264
+ "#2e0595",
1265
+ "#2f0596",
1266
+ "#310597",
1267
+ "#330597",
1268
+ "#350498",
1269
+ "#370499",
1270
+ "#38049a",
1271
+ "#3a049a",
1272
+ "#3c049b",
1273
+ "#3e049c",
1274
+ "#3f049c",
1275
+ "#41049d",
1276
+ "#43039e",
1277
+ "#44039e",
1278
+ "#46039f",
1279
+ "#48039f",
1280
+ "#4903a0",
1281
+ "#4b03a1",
1282
+ "#4c02a1",
1283
+ "#4e02a2",
1284
+ "#5002a2",
1285
+ "#5102a3",
1286
+ "#5302a3",
1287
+ "#5502a4",
1288
+ "#5601a4",
1289
+ "#5801a4",
1290
+ "#5901a5",
1291
+ "#5b01a5",
1292
+ "#5c01a6",
1293
+ "#5e01a6",
1294
+ "#6001a6",
1295
+ "#6100a7",
1296
+ "#6300a7",
1297
+ "#6400a7",
1298
+ "#6600a7",
1299
+ "#6700a8",
1300
+ "#6900a8",
1301
+ "#6a00a8",
1302
+ "#6c00a8",
1303
+ "#6e00a8",
1304
+ "#6f00a8",
1305
+ "#7100a8",
1306
+ "#7201a8",
1307
+ "#7401a8",
1308
+ "#7501a8",
1309
+ "#7701a8",
1310
+ "#7801a8",
1311
+ "#7a02a8",
1312
+ "#7b02a8",
1313
+ "#7d03a8",
1314
+ "#7e03a8",
1315
+ "#8004a8",
1316
+ "#8104a7",
1317
+ "#8305a7",
1318
+ "#8405a7",
1319
+ "#8606a6",
1320
+ "#8707a6",
1321
+ "#8808a6",
1322
+ "#8a09a5",
1323
+ "#8b0aa5",
1324
+ "#8d0ba5",
1325
+ "#8e0ca4",
1326
+ "#8f0da4",
1327
+ "#910ea3",
1328
+ "#920fa3",
1329
+ "#9410a2",
1330
+ "#9511a1",
1331
+ "#9613a1",
1332
+ "#9814a0",
1333
+ "#99159f",
1334
+ "#9a169f",
1335
+ "#9c179e",
1336
+ "#9d189d",
1337
+ "#9e199d",
1338
+ "#a01a9c",
1339
+ "#a11b9b",
1340
+ "#a21d9a",
1341
+ "#a31e9a",
1342
+ "#a51f99",
1343
+ "#a62098",
1344
+ "#a72197",
1345
+ "#a82296",
1346
+ "#aa2395",
1347
+ "#ab2494",
1348
+ "#ac2694",
1349
+ "#ad2793",
1350
+ "#ae2892",
1351
+ "#b02991",
1352
+ "#b12a90",
1353
+ "#b22b8f",
1354
+ "#b32c8e",
1355
+ "#b42e8d",
1356
+ "#b52f8c",
1357
+ "#b6308b",
1358
+ "#b7318a",
1359
+ "#b83289",
1360
+ "#ba3388",
1361
+ "#bb3488",
1362
+ "#bc3587",
1363
+ "#bd3786",
1364
+ "#be3885",
1365
+ "#bf3984",
1366
+ "#c03a83",
1367
+ "#c13b82",
1368
+ "#c23c81",
1369
+ "#c33d80",
1370
+ "#c43e7f",
1371
+ "#c5407e",
1372
+ "#c6417d",
1373
+ "#c7427c",
1374
+ "#c8437b",
1375
+ "#c9447a",
1376
+ "#ca457a",
1377
+ "#cb4679",
1378
+ "#cc4778",
1379
+ "#cc4977",
1380
+ "#cd4a76",
1381
+ "#ce4b75",
1382
+ "#cf4c74",
1383
+ "#d04d73",
1384
+ "#d14e72",
1385
+ "#d24f71",
1386
+ "#d35171",
1387
+ "#d45270",
1388
+ "#d5536f",
1389
+ "#d5546e",
1390
+ "#d6556d",
1391
+ "#d7566c",
1392
+ "#d8576b",
1393
+ "#d9586a",
1394
+ "#da5a6a",
1395
+ "#da5b69",
1396
+ "#db5c68",
1397
+ "#dc5d67",
1398
+ "#dd5e66",
1399
+ "#de5f65",
1400
+ "#de6164",
1401
+ "#df6263",
1402
+ "#e06363",
1403
+ "#e16462",
1404
+ "#e26561",
1405
+ "#e26660",
1406
+ "#e3685f",
1407
+ "#e4695e",
1408
+ "#e56a5d",
1409
+ "#e56b5d",
1410
+ "#e66c5c",
1411
+ "#e76e5b",
1412
+ "#e76f5a",
1413
+ "#e87059",
1414
+ "#e97158",
1415
+ "#e97257",
1416
+ "#ea7457",
1417
+ "#eb7556",
1418
+ "#eb7655",
1419
+ "#ec7754",
1420
+ "#ed7953",
1421
+ "#ed7a52",
1422
+ "#ee7b51",
1423
+ "#ef7c51",
1424
+ "#ef7e50",
1425
+ "#f07f4f",
1426
+ "#f0804e",
1427
+ "#f1814d",
1428
+ "#f1834c",
1429
+ "#f2844b",
1430
+ "#f3854b",
1431
+ "#f3874a",
1432
+ "#f48849",
1433
+ "#f48948",
1434
+ "#f58b47",
1435
+ "#f58c46",
1436
+ "#f68d45",
1437
+ "#f68f44",
1438
+ "#f79044",
1439
+ "#f79143",
1440
+ "#f79342",
1441
+ "#f89441",
1442
+ "#f89540",
1443
+ "#f9973f",
1444
+ "#f9983e",
1445
+ "#f99a3e",
1446
+ "#fa9b3d",
1447
+ "#fa9c3c",
1448
+ "#fa9e3b",
1449
+ "#fb9f3a",
1450
+ "#fba139",
1451
+ "#fba238",
1452
+ "#fca338",
1453
+ "#fca537",
1454
+ "#fca636",
1455
+ "#fca835",
1456
+ "#fca934",
1457
+ "#fdab33",
1458
+ "#fdac33",
1459
+ "#fdae32",
1460
+ "#fdaf31",
1461
+ "#fdb130",
1462
+ "#fdb22f",
1463
+ "#fdb42f",
1464
+ "#fdb52e",
1465
+ "#feb72d",
1466
+ "#feb82c",
1467
+ "#feba2c",
1468
+ "#febb2b",
1469
+ "#febd2a",
1470
+ "#febe2a",
1471
+ "#fec029",
1472
+ "#fdc229",
1473
+ "#fdc328",
1474
+ "#fdc527",
1475
+ "#fdc627",
1476
+ "#fdc827",
1477
+ "#fdca26",
1478
+ "#fdcb26",
1479
+ "#fccd25",
1480
+ "#fcce25",
1481
+ "#fcd025",
1482
+ "#fcd225",
1483
+ "#fbd324",
1484
+ "#fbd524",
1485
+ "#fbd724",
1486
+ "#fad824",
1487
+ "#fada24",
1488
+ "#f9dc24",
1489
+ "#f9dd25",
1490
+ "#f8df25",
1491
+ "#f8e125",
1492
+ "#f7e225",
1493
+ "#f7e425",
1494
+ "#f6e626",
1495
+ "#f6e826",
1496
+ "#f5e926",
1497
+ "#f5eb27",
1498
+ "#f4ed27",
1499
+ "#f3ee27",
1500
+ "#f3f027",
1501
+ "#f2f227",
1502
+ "#f1f426",
1503
+ "#f1f525",
1504
+ "#f0f724",
1505
+ "#f0f921",
1506
+ ],
1507
+ ],
1508
+ })
1509
+
1510
+ CustomColorSchemes.push({
1511
+ name: ColorSchemeName.Inferno,
1512
+ colorSets: [
1513
+ [
1514
+ "#000004",
1515
+ "#010005",
1516
+ "#010106",
1517
+ "#010108",
1518
+ "#02010a",
1519
+ "#02020c",
1520
+ "#02020e",
1521
+ "#030210",
1522
+ "#040312",
1523
+ "#040314",
1524
+ "#050417",
1525
+ "#060419",
1526
+ "#07051b",
1527
+ "#08051d",
1528
+ "#09061f",
1529
+ "#0a0722",
1530
+ "#0b0724",
1531
+ "#0c0826",
1532
+ "#0d0829",
1533
+ "#0e092b",
1534
+ "#10092d",
1535
+ "#110a30",
1536
+ "#120a32",
1537
+ "#140b34",
1538
+ "#150b37",
1539
+ "#160b39",
1540
+ "#180c3c",
1541
+ "#190c3e",
1542
+ "#1b0c41",
1543
+ "#1c0c43",
1544
+ "#1e0c45",
1545
+ "#1f0c48",
1546
+ "#210c4a",
1547
+ "#230c4c",
1548
+ "#240c4f",
1549
+ "#260c51",
1550
+ "#280b53",
1551
+ "#290b55",
1552
+ "#2b0b57",
1553
+ "#2d0b59",
1554
+ "#2f0a5b",
1555
+ "#310a5c",
1556
+ "#320a5e",
1557
+ "#340a5f",
1558
+ "#360961",
1559
+ "#380962",
1560
+ "#390963",
1561
+ "#3b0964",
1562
+ "#3d0965",
1563
+ "#3e0966",
1564
+ "#400a67",
1565
+ "#420a68",
1566
+ "#440a68",
1567
+ "#450a69",
1568
+ "#470b6a",
1569
+ "#490b6a",
1570
+ "#4a0c6b",
1571
+ "#4c0c6b",
1572
+ "#4d0d6c",
1573
+ "#4f0d6c",
1574
+ "#510e6c",
1575
+ "#520e6d",
1576
+ "#540f6d",
1577
+ "#550f6d",
1578
+ "#57106e",
1579
+ "#59106e",
1580
+ "#5a116e",
1581
+ "#5c126e",
1582
+ "#5d126e",
1583
+ "#5f136e",
1584
+ "#61136e",
1585
+ "#62146e",
1586
+ "#64156e",
1587
+ "#65156e",
1588
+ "#67166e",
1589
+ "#69166e",
1590
+ "#6a176e",
1591
+ "#6c186e",
1592
+ "#6d186e",
1593
+ "#6f196e",
1594
+ "#71196e",
1595
+ "#721a6e",
1596
+ "#741a6e",
1597
+ "#751b6e",
1598
+ "#771c6d",
1599
+ "#781c6d",
1600
+ "#7a1d6d",
1601
+ "#7c1d6d",
1602
+ "#7d1e6d",
1603
+ "#7f1e6c",
1604
+ "#801f6c",
1605
+ "#82206c",
1606
+ "#84206b",
1607
+ "#85216b",
1608
+ "#87216b",
1609
+ "#88226a",
1610
+ "#8a226a",
1611
+ "#8c2369",
1612
+ "#8d2369",
1613
+ "#8f2469",
1614
+ "#902568",
1615
+ "#922568",
1616
+ "#932667",
1617
+ "#952667",
1618
+ "#972766",
1619
+ "#982766",
1620
+ "#9a2865",
1621
+ "#9b2964",
1622
+ "#9d2964",
1623
+ "#9f2a63",
1624
+ "#a02a63",
1625
+ "#a22b62",
1626
+ "#a32c61",
1627
+ "#a52c60",
1628
+ "#a62d60",
1629
+ "#a82e5f",
1630
+ "#a92e5e",
1631
+ "#ab2f5e",
1632
+ "#ad305d",
1633
+ "#ae305c",
1634
+ "#b0315b",
1635
+ "#b1325a",
1636
+ "#b3325a",
1637
+ "#b43359",
1638
+ "#b63458",
1639
+ "#b73557",
1640
+ "#b93556",
1641
+ "#ba3655",
1642
+ "#bc3754",
1643
+ "#bd3853",
1644
+ "#bf3952",
1645
+ "#c03a51",
1646
+ "#c13a50",
1647
+ "#c33b4f",
1648
+ "#c43c4e",
1649
+ "#c63d4d",
1650
+ "#c73e4c",
1651
+ "#c83f4b",
1652
+ "#ca404a",
1653
+ "#cb4149",
1654
+ "#cc4248",
1655
+ "#ce4347",
1656
+ "#cf4446",
1657
+ "#d04545",
1658
+ "#d24644",
1659
+ "#d34743",
1660
+ "#d44842",
1661
+ "#d54a41",
1662
+ "#d74b3f",
1663
+ "#d84c3e",
1664
+ "#d94d3d",
1665
+ "#da4e3c",
1666
+ "#db503b",
1667
+ "#dd513a",
1668
+ "#de5238",
1669
+ "#df5337",
1670
+ "#e05536",
1671
+ "#e15635",
1672
+ "#e25734",
1673
+ "#e35933",
1674
+ "#e45a31",
1675
+ "#e55c30",
1676
+ "#e65d2f",
1677
+ "#e75e2e",
1678
+ "#e8602d",
1679
+ "#e9612b",
1680
+ "#ea632a",
1681
+ "#eb6429",
1682
+ "#eb6628",
1683
+ "#ec6726",
1684
+ "#ed6925",
1685
+ "#ee6a24",
1686
+ "#ef6c23",
1687
+ "#ef6e21",
1688
+ "#f06f20",
1689
+ "#f1711f",
1690
+ "#f1731d",
1691
+ "#f2741c",
1692
+ "#f3761b",
1693
+ "#f37819",
1694
+ "#f47918",
1695
+ "#f57b17",
1696
+ "#f57d15",
1697
+ "#f67e14",
1698
+ "#f68013",
1699
+ "#f78212",
1700
+ "#f78410",
1701
+ "#f8850f",
1702
+ "#f8870e",
1703
+ "#f8890c",
1704
+ "#f98b0b",
1705
+ "#f98c0a",
1706
+ "#f98e09",
1707
+ "#fa9008",
1708
+ "#fa9207",
1709
+ "#fa9407",
1710
+ "#fb9606",
1711
+ "#fb9706",
1712
+ "#fb9906",
1713
+ "#fb9b06",
1714
+ "#fb9d07",
1715
+ "#fc9f07",
1716
+ "#fca108",
1717
+ "#fca309",
1718
+ "#fca50a",
1719
+ "#fca60c",
1720
+ "#fca80d",
1721
+ "#fcaa0f",
1722
+ "#fcac11",
1723
+ "#fcae12",
1724
+ "#fcb014",
1725
+ "#fcb216",
1726
+ "#fcb418",
1727
+ "#fbb61a",
1728
+ "#fbb81d",
1729
+ "#fbba1f",
1730
+ "#fbbc21",
1731
+ "#fbbe23",
1732
+ "#fac026",
1733
+ "#fac228",
1734
+ "#fac42a",
1735
+ "#fac62d",
1736
+ "#f9c72f",
1737
+ "#f9c932",
1738
+ "#f9cb35",
1739
+ "#f8cd37",
1740
+ "#f8cf3a",
1741
+ "#f7d13d",
1742
+ "#f7d340",
1743
+ "#f6d543",
1744
+ "#f6d746",
1745
+ "#f5d949",
1746
+ "#f5db4c",
1747
+ "#f4dd4f",
1748
+ "#f4df53",
1749
+ "#f4e156",
1750
+ "#f3e35a",
1751
+ "#f3e55d",
1752
+ "#f2e661",
1753
+ "#f2e865",
1754
+ "#f2ea69",
1755
+ "#f1ec6d",
1756
+ "#f1ed71",
1757
+ "#f1ef75",
1758
+ "#f1f179",
1759
+ "#f2f27d",
1760
+ "#f2f482",
1761
+ "#f3f586",
1762
+ "#f3f68a",
1763
+ "#f4f88e",
1764
+ "#f5f992",
1765
+ "#f6fa96",
1766
+ "#f8fb9a",
1767
+ "#f9fc9d",
1768
+ "#fafda1",
1769
+ "#fcffa4",
1770
+ ],
1771
+ ],
1772
+ })