@buildcanada/charts 0.1.0 → 0.2.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 (127) hide show
  1. package/package.json +9 -24
  2. package/src/components/Button/Button.scss +17 -17
  3. package/src/components/Button/Button.tsx +4 -4
  4. package/src/components/MarkdownTextWrap/MarkdownTextWrap.tsx +1 -1
  5. package/src/components/index.ts +1 -1
  6. package/src/components/stubs/DataCitation.tsx +1 -1
  7. package/src/components/stubs/IndicatorKeyData.tsx +1 -1
  8. package/src/components/stubs/IndicatorProcessing.tsx +1 -1
  9. package/src/components/stubs/IndicatorSources.tsx +1 -1
  10. package/src/components/styles/colors.scss +1 -1
  11. package/src/components/styles/mixins.scss +5 -5
  12. package/src/core-table/{OwidTable.ts → ChartsTable.ts} +31 -31
  13. package/src/core-table/CoreTable.ts +12 -12
  14. package/src/core-table/CoreTableColumns.ts +24 -24
  15. package/src/core-table/CoreTableUtils.ts +7 -7
  16. package/src/core-table/{OwidTableSynthesizers.ts → TableSynthesizers.ts} +24 -24
  17. package/src/core-table/{OwidTableUtil.ts → TableUtil.ts} +5 -5
  18. package/src/core-table/index.ts +3 -3
  19. package/src/explorer/ColumnGrammar.ts +1 -1
  20. package/src/explorer/Explorer.sample.ts +7 -7
  21. package/src/explorer/Explorer.scss +1 -1
  22. package/src/explorer/Explorer.tsx +23 -23
  23. package/src/explorer/ExplorerConstants.ts +2 -2
  24. package/src/explorer/ExplorerGrammar.ts +3 -3
  25. package/src/explorer/ExplorerProgram.ts +21 -18
  26. package/src/explorer/ExplorerUtils.ts +1 -1
  27. package/src/explorer/gridLang/readme.md +1 -1
  28. package/src/grapher/axis/Axis.ts +3 -3
  29. package/src/grapher/barCharts/DiscreteBarChart.tsx +2 -2
  30. package/src/grapher/barCharts/DiscreteBarChartState.ts +8 -8
  31. package/src/grapher/captionedChart/Logos.tsx +11 -13
  32. package/src/grapher/captionedChart/LogosSVG.tsx +2 -2
  33. package/src/grapher/chart/ChartAreaContent.tsx +1 -1
  34. package/src/grapher/chart/ChartDimension.ts +15 -15
  35. package/src/grapher/chart/ChartInterface.ts +6 -6
  36. package/src/grapher/chart/ChartManager.ts +3 -3
  37. package/src/grapher/chart/ChartUtils.tsx +3 -3
  38. package/src/grapher/color/ColorConstants.ts +2 -2
  39. package/src/grapher/color/ColorScale.ts +4 -4
  40. package/src/grapher/color/ColorSchemes.ts +26 -26
  41. package/src/grapher/color/CustomSchemes.ts +227 -227
  42. package/src/grapher/controls/ContentSwitchers.tsx +1 -1
  43. package/src/grapher/controls/DataTableFilterDropdown.tsx +2 -2
  44. package/src/grapher/controls/MapZoomDropdown.tsx +3 -3
  45. package/src/grapher/controls/ShareMenu.tsx +1 -1
  46. package/src/grapher/controls/entityPicker/EntityPicker.tsx +8 -8
  47. package/src/grapher/controls/entityPicker/EntityPickerConstants.ts +3 -3
  48. package/src/grapher/controls/globalEntitySelector/GlobalEntitySelector.tsx +1 -1
  49. package/src/grapher/core/EntitiesByRegionType.ts +4 -4
  50. package/src/grapher/core/EntityUrlBuilder.ts +2 -2
  51. package/src/grapher/core/FetchingGrapher.tsx +4 -4
  52. package/src/grapher/core/Grapher.tsx +10 -10
  53. package/src/grapher/core/GrapherState.tsx +47 -50
  54. package/src/grapher/core/GrapherUseHelpers.tsx +4 -4
  55. package/src/grapher/core/{LegacyToOwidTable.ts → LegacyToChartsTable.ts} +100 -100
  56. package/src/grapher/core/loadGrapherTableHelpers.ts +13 -13
  57. package/src/grapher/core/loadVariable.ts +5 -5
  58. package/src/grapher/dataTable/DataTable.sample.ts +12 -12
  59. package/src/grapher/dataTable/DataTable.tsx +22 -22
  60. package/src/grapher/dataTable/DataTableConstants.ts +9 -9
  61. package/src/grapher/entitySelector/EntitySelector.tsx +13 -13
  62. package/src/grapher/facet/FacetChart.tsx +4 -4
  63. package/src/grapher/facet/FacetMap.tsx +6 -6
  64. package/src/grapher/footer/Footer.tsx +4 -4
  65. package/src/grapher/footer/FooterManager.ts +2 -2
  66. package/src/grapher/header/Header.tsx +5 -5
  67. package/src/grapher/header/HeaderManager.ts +1 -1
  68. package/src/grapher/index.ts +8 -8
  69. package/src/grapher/lineCharts/LineChartHelpers.ts +4 -4
  70. package/src/grapher/lineCharts/LineChartState.ts +9 -9
  71. package/src/grapher/mapCharts/ChoroplethGlobe.tsx +1 -1
  72. package/src/grapher/mapCharts/GlobeController.ts +9 -9
  73. package/src/grapher/mapCharts/MapChartState.ts +16 -16
  74. package/src/grapher/mapCharts/MapSparkline.tsx +5 -5
  75. package/src/grapher/mapCharts/MapTooltip.tsx +13 -13
  76. package/src/grapher/modal/DownloadModal.scss +3 -3
  77. package/src/grapher/modal/DownloadModal.tsx +24 -29
  78. package/src/grapher/modal/SourcesDescriptions.scss +1 -1
  79. package/src/grapher/modal/SourcesKeyDataTable.tsx +2 -2
  80. package/src/grapher/modal/SourcesModal.tsx +15 -15
  81. package/src/grapher/scatterCharts/ScatterPlotChart.tsx +2 -2
  82. package/src/grapher/scatterCharts/ScatterPlotChartConstants.ts +2 -2
  83. package/src/grapher/scatterCharts/ScatterPlotChartState.ts +8 -8
  84. package/src/grapher/scatterCharts/ScatterSizeLegend.tsx +2 -2
  85. package/src/grapher/scatterCharts/ScatterUtils.ts +2 -2
  86. package/src/grapher/schema/grapher-schema.009.yaml +18 -18
  87. package/src/grapher/schema/migrations/migrations.ts +4 -4
  88. package/src/grapher/selection/MapSelectionArray.ts +1 -1
  89. package/src/grapher/selection/readme.md +1 -1
  90. package/src/grapher/slopeCharts/SlopeChartConstants.ts +3 -3
  91. package/src/grapher/slopeCharts/SlopeChartHelpers.ts +1 -1
  92. package/src/grapher/slopeCharts/SlopeChartState.ts +10 -10
  93. package/src/grapher/stackedCharts/AbstractStackedChartState.ts +8 -8
  94. package/src/grapher/stackedCharts/MarimekkoChart.tsx +5 -5
  95. package/src/grapher/stackedCharts/MarimekkoChartConstants.ts +2 -2
  96. package/src/grapher/stackedCharts/MarimekkoChartState.ts +12 -12
  97. package/src/grapher/stackedCharts/StackedBarChartState.ts +1 -1
  98. package/src/grapher/stackedCharts/StackedConstants.ts +2 -2
  99. package/src/grapher/stackedCharts/StackedDiscreteBarChartState.ts +12 -12
  100. package/src/grapher/stackedCharts/StackedDiscreteBars.tsx +2 -2
  101. package/src/grapher/tabs/Tabs.tsx +1 -1
  102. package/src/grapher/testData/{OwidTestData.sample.ts → TestData.sample.ts} +7 -7
  103. package/src/grapher/testData/{OwidTestData.ts → TestData.ts} +5 -5
  104. package/src/index.ts +7 -7
  105. package/src/types/{OwidOrigin.ts → Origin.ts} +3 -3
  106. package/src/types/{OwidSource.ts → Source.ts} +1 -1
  107. package/src/types/Variable.ts +133 -0
  108. package/src/types/{OwidVariableDisplayConfigInterface.ts → VariableDisplayConfigInterface.ts} +11 -11
  109. package/src/types/domainTypes/ContentGraph.ts +3 -3
  110. package/src/types/domainTypes/CoreTableTypes.ts +29 -29
  111. package/src/types/domainTypes/Posts.ts +2 -2
  112. package/src/types/domainTypes/Search.ts +6 -6
  113. package/src/types/domainTypes/Various.ts +1 -1
  114. package/src/types/gdocTypes/Gdoc.ts +42 -42
  115. package/src/types/grapherTypes/GrapherTypes.ts +21 -21
  116. package/src/types/index.ts +51 -51
  117. package/src/utils/MultiDimDataPageConfig.ts +1 -1
  118. package/src/utils/Util.ts +61 -55
  119. package/src/utils/{OwidVariable.ts → Variable.ts} +15 -15
  120. package/src/utils/formatValue.ts +12 -12
  121. package/src/utils/image.ts +12 -12
  122. package/src/utils/index.ts +5 -5
  123. package/src/utils/metadataHelpers.ts +19 -19
  124. package/src/utils/regions.ts +9 -9
  125. package/LICENSE.md +0 -8
  126. package/README.md +0 -113
  127. package/src/types/OwidVariable.ts +0 -133
@@ -26,7 +26,7 @@ function getPreferredSchemesByType(
26
26
  ColorSchemeName.SingleColorDarkCopper,
27
27
  ])
28
28
  .with(GRAPHER_CHART_TYPES.LineChart, () => [
29
- ColorSchemeName.OwidDistinctLines,
29
+ ColorSchemeName.DistinctLines,
30
30
  ])
31
31
  .with(GRAPHER_CHART_TYPES.Marimekko, () => [
32
32
  ColorSchemeName.continents,
@@ -35,27 +35,27 @@ function getPreferredSchemesByType(
35
35
  ColorSchemeName.SingleColorPurple,
36
36
  ColorSchemeName.SingleColorTeal,
37
37
  ColorSchemeName.SingleColorDarkCopper,
38
- ColorSchemeName.OwidCategoricalA,
39
- ColorSchemeName.OwidCategoricalB,
40
- ColorSchemeName.OwidCategoricalC,
41
- ColorSchemeName.OwidCategoricalD,
42
- ColorSchemeName.OwidCategoricalE,
38
+ ColorSchemeName.CategoricalA,
39
+ ColorSchemeName.CategoricalB,
40
+ ColorSchemeName.CategoricalC,
41
+ ColorSchemeName.CategoricalD,
42
+ ColorSchemeName.CategoricalE,
43
43
  ])
44
44
  .with(GRAPHER_CHART_TYPES.ScatterPlot, () => [
45
45
  ColorSchemeName.continents,
46
- ColorSchemeName.OwidDistinctLines,
46
+ ColorSchemeName.DistinctLines,
47
47
  ])
48
48
  .with(GRAPHER_CHART_TYPES.SlopeChart, () => [
49
49
  ColorSchemeName.continents,
50
- ColorSchemeName.OwidDistinctLines,
50
+ ColorSchemeName.DistinctLines,
51
51
  ])
52
52
  .with(GRAPHER_CHART_TYPES.StackedArea, () => [
53
- ColorSchemeName["owid-distinct"],
54
- ColorSchemeName.OwidCategoricalA,
55
- ColorSchemeName.OwidCategoricalB,
56
- ColorSchemeName.OwidCategoricalC,
57
- ColorSchemeName.OwidCategoricalD,
58
- ColorSchemeName.OwidCategoricalE,
53
+ ColorSchemeName["distinct"],
54
+ ColorSchemeName.CategoricalA,
55
+ ColorSchemeName.CategoricalB,
56
+ ColorSchemeName.CategoricalC,
57
+ ColorSchemeName.CategoricalD,
58
+ ColorSchemeName.CategoricalE,
59
59
  ColorSchemeName.SingleColorGradientDenim,
60
60
  ColorSchemeName.SingleColorGradientTeal,
61
61
  ColorSchemeName.SingleColorGradientPurple,
@@ -63,12 +63,12 @@ function getPreferredSchemesByType(
63
63
  ColorSchemeName.SingleColorGradientDarkCopper,
64
64
  ])
65
65
  .with(GRAPHER_CHART_TYPES.StackedBar, () => [
66
- ColorSchemeName["owid-distinct"],
67
- ColorSchemeName.OwidCategoricalA,
68
- ColorSchemeName.OwidCategoricalB,
69
- ColorSchemeName.OwidCategoricalC,
70
- ColorSchemeName.OwidCategoricalD,
71
- ColorSchemeName.OwidCategoricalE,
66
+ ColorSchemeName["distinct"],
67
+ ColorSchemeName.CategoricalA,
68
+ ColorSchemeName.CategoricalB,
69
+ ColorSchemeName.CategoricalC,
70
+ ColorSchemeName.CategoricalD,
71
+ ColorSchemeName.CategoricalE,
72
72
  ColorSchemeName.SingleColorGradientDenim,
73
73
  ColorSchemeName.SingleColorGradientTeal,
74
74
  ColorSchemeName.SingleColorGradientPurple,
@@ -76,12 +76,12 @@ function getPreferredSchemesByType(
76
76
  ColorSchemeName.SingleColorGradientDarkCopper,
77
77
  ])
78
78
  .with(GRAPHER_CHART_TYPES.StackedDiscreteBar, () => [
79
- ColorSchemeName["owid-distinct"],
80
- ColorSchemeName.OwidCategoricalA,
81
- ColorSchemeName.OwidCategoricalB,
82
- ColorSchemeName.OwidCategoricalC,
83
- ColorSchemeName.OwidCategoricalD,
84
- ColorSchemeName.OwidCategoricalE,
79
+ ColorSchemeName["distinct"],
80
+ ColorSchemeName.CategoricalA,
81
+ ColorSchemeName.CategoricalB,
82
+ ColorSchemeName.CategoricalC,
83
+ ColorSchemeName.CategoricalD,
84
+ ColorSchemeName.CategoricalE,
85
85
  ColorSchemeName.SingleColorGradientDenim,
86
86
  ColorSchemeName.SingleColorGradientTeal,
87
87
  ColorSchemeName.SingleColorGradientPurple,