@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.
- package/package.json +9 -24
- package/src/components/Button/Button.scss +17 -17
- package/src/components/Button/Button.tsx +4 -4
- package/src/components/MarkdownTextWrap/MarkdownTextWrap.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/components/stubs/DataCitation.tsx +1 -1
- package/src/components/stubs/IndicatorKeyData.tsx +1 -1
- package/src/components/stubs/IndicatorProcessing.tsx +1 -1
- package/src/components/stubs/IndicatorSources.tsx +1 -1
- package/src/components/styles/colors.scss +1 -1
- package/src/components/styles/mixins.scss +5 -5
- package/src/core-table/{OwidTable.ts → ChartsTable.ts} +31 -31
- package/src/core-table/CoreTable.ts +12 -12
- package/src/core-table/CoreTableColumns.ts +24 -24
- package/src/core-table/CoreTableUtils.ts +7 -7
- package/src/core-table/{OwidTableSynthesizers.ts → TableSynthesizers.ts} +24 -24
- package/src/core-table/{OwidTableUtil.ts → TableUtil.ts} +5 -5
- package/src/core-table/index.ts +3 -3
- package/src/explorer/ColumnGrammar.ts +1 -1
- package/src/explorer/Explorer.sample.ts +7 -7
- package/src/explorer/Explorer.scss +1 -1
- package/src/explorer/Explorer.tsx +23 -23
- package/src/explorer/ExplorerConstants.ts +2 -2
- package/src/explorer/ExplorerGrammar.ts +3 -3
- package/src/explorer/ExplorerProgram.ts +21 -18
- package/src/explorer/ExplorerUtils.ts +1 -1
- package/src/explorer/gridLang/readme.md +1 -1
- package/src/grapher/axis/Axis.ts +3 -3
- package/src/grapher/barCharts/DiscreteBarChart.tsx +2 -2
- package/src/grapher/barCharts/DiscreteBarChartState.ts +8 -8
- package/src/grapher/captionedChart/Logos.tsx +11 -13
- package/src/grapher/captionedChart/LogosSVG.tsx +2 -2
- package/src/grapher/chart/ChartAreaContent.tsx +1 -1
- package/src/grapher/chart/ChartDimension.ts +15 -15
- package/src/grapher/chart/ChartInterface.ts +6 -6
- package/src/grapher/chart/ChartManager.ts +3 -3
- package/src/grapher/chart/ChartUtils.tsx +3 -3
- package/src/grapher/color/ColorConstants.ts +2 -2
- package/src/grapher/color/ColorScale.ts +4 -4
- package/src/grapher/color/ColorSchemes.ts +26 -26
- package/src/grapher/color/CustomSchemes.ts +227 -227
- package/src/grapher/controls/ContentSwitchers.tsx +1 -1
- package/src/grapher/controls/DataTableFilterDropdown.tsx +2 -2
- package/src/grapher/controls/MapZoomDropdown.tsx +3 -3
- package/src/grapher/controls/ShareMenu.tsx +1 -1
- package/src/grapher/controls/entityPicker/EntityPicker.tsx +8 -8
- package/src/grapher/controls/entityPicker/EntityPickerConstants.ts +3 -3
- package/src/grapher/controls/globalEntitySelector/GlobalEntitySelector.tsx +1 -1
- package/src/grapher/core/EntitiesByRegionType.ts +4 -4
- package/src/grapher/core/EntityUrlBuilder.ts +2 -2
- package/src/grapher/core/FetchingGrapher.tsx +4 -4
- package/src/grapher/core/Grapher.tsx +10 -10
- package/src/grapher/core/GrapherState.tsx +47 -50
- package/src/grapher/core/GrapherUseHelpers.tsx +4 -4
- package/src/grapher/core/{LegacyToOwidTable.ts → LegacyToChartsTable.ts} +100 -100
- package/src/grapher/core/loadGrapherTableHelpers.ts +13 -13
- package/src/grapher/core/loadVariable.ts +5 -5
- package/src/grapher/dataTable/DataTable.sample.ts +12 -12
- package/src/grapher/dataTable/DataTable.tsx +22 -22
- package/src/grapher/dataTable/DataTableConstants.ts +9 -9
- package/src/grapher/entitySelector/EntitySelector.tsx +13 -13
- package/src/grapher/facet/FacetChart.tsx +4 -4
- package/src/grapher/facet/FacetMap.tsx +6 -6
- package/src/grapher/footer/Footer.tsx +4 -4
- package/src/grapher/footer/FooterManager.ts +2 -2
- package/src/grapher/header/Header.tsx +5 -5
- package/src/grapher/header/HeaderManager.ts +1 -1
- package/src/grapher/index.ts +8 -8
- package/src/grapher/lineCharts/LineChartHelpers.ts +4 -4
- package/src/grapher/lineCharts/LineChartState.ts +9 -9
- package/src/grapher/mapCharts/ChoroplethGlobe.tsx +1 -1
- package/src/grapher/mapCharts/GlobeController.ts +9 -9
- package/src/grapher/mapCharts/MapChartState.ts +16 -16
- package/src/grapher/mapCharts/MapSparkline.tsx +5 -5
- package/src/grapher/mapCharts/MapTooltip.tsx +13 -13
- package/src/grapher/modal/DownloadModal.scss +3 -3
- package/src/grapher/modal/DownloadModal.tsx +24 -29
- package/src/grapher/modal/SourcesDescriptions.scss +1 -1
- package/src/grapher/modal/SourcesKeyDataTable.tsx +2 -2
- package/src/grapher/modal/SourcesModal.tsx +15 -15
- package/src/grapher/scatterCharts/ScatterPlotChart.tsx +2 -2
- package/src/grapher/scatterCharts/ScatterPlotChartConstants.ts +2 -2
- package/src/grapher/scatterCharts/ScatterPlotChartState.ts +8 -8
- package/src/grapher/scatterCharts/ScatterSizeLegend.tsx +2 -2
- package/src/grapher/scatterCharts/ScatterUtils.ts +2 -2
- package/src/grapher/schema/grapher-schema.009.yaml +18 -18
- package/src/grapher/schema/migrations/migrations.ts +4 -4
- package/src/grapher/selection/MapSelectionArray.ts +1 -1
- package/src/grapher/selection/readme.md +1 -1
- package/src/grapher/slopeCharts/SlopeChartConstants.ts +3 -3
- package/src/grapher/slopeCharts/SlopeChartHelpers.ts +1 -1
- package/src/grapher/slopeCharts/SlopeChartState.ts +10 -10
- package/src/grapher/stackedCharts/AbstractStackedChartState.ts +8 -8
- package/src/grapher/stackedCharts/MarimekkoChart.tsx +5 -5
- package/src/grapher/stackedCharts/MarimekkoChartConstants.ts +2 -2
- package/src/grapher/stackedCharts/MarimekkoChartState.ts +12 -12
- package/src/grapher/stackedCharts/StackedBarChartState.ts +1 -1
- package/src/grapher/stackedCharts/StackedConstants.ts +2 -2
- package/src/grapher/stackedCharts/StackedDiscreteBarChartState.ts +12 -12
- package/src/grapher/stackedCharts/StackedDiscreteBars.tsx +2 -2
- package/src/grapher/tabs/Tabs.tsx +1 -1
- package/src/grapher/testData/{OwidTestData.sample.ts → TestData.sample.ts} +7 -7
- package/src/grapher/testData/{OwidTestData.ts → TestData.ts} +5 -5
- package/src/index.ts +7 -7
- package/src/types/{OwidOrigin.ts → Origin.ts} +3 -3
- package/src/types/{OwidSource.ts → Source.ts} +1 -1
- package/src/types/Variable.ts +133 -0
- package/src/types/{OwidVariableDisplayConfigInterface.ts → VariableDisplayConfigInterface.ts} +11 -11
- package/src/types/domainTypes/ContentGraph.ts +3 -3
- package/src/types/domainTypes/CoreTableTypes.ts +29 -29
- package/src/types/domainTypes/Posts.ts +2 -2
- package/src/types/domainTypes/Search.ts +6 -6
- package/src/types/domainTypes/Various.ts +1 -1
- package/src/types/gdocTypes/Gdoc.ts +42 -42
- package/src/types/grapherTypes/GrapherTypes.ts +21 -21
- package/src/types/index.ts +51 -51
- package/src/utils/MultiDimDataPageConfig.ts +1 -1
- package/src/utils/Util.ts +61 -55
- package/src/utils/{OwidVariable.ts → Variable.ts} +15 -15
- package/src/utils/formatValue.ts +12 -12
- package/src/utils/image.ts +12 -12
- package/src/utils/index.ts +5 -5
- package/src/utils/metadataHelpers.ts +19 -19
- package/src/utils/regions.ts +9 -9
- package/LICENSE.md +0 -8
- package/README.md +0 -113
- package/src/types/OwidVariable.ts +0 -133
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { OwidOrigin } from "./OwidOrigin.js"
|
|
2
|
-
import { OwidSource } from "./OwidSource.js"
|
|
3
|
-
import { OwidVariableDisplayConfigInterface } from "./OwidVariableDisplayConfigInterface.js"
|
|
4
|
-
|
|
5
|
-
export interface OwidVariableWithSource {
|
|
6
|
-
id: number
|
|
7
|
-
name?: string
|
|
8
|
-
description?: string
|
|
9
|
-
descriptionShort?: string
|
|
10
|
-
descriptionFromProducer?: string
|
|
11
|
-
descriptionKey?: string[]
|
|
12
|
-
descriptionProcessing?: string
|
|
13
|
-
unit?: string
|
|
14
|
-
display?: OwidVariableDisplayConfigInterface
|
|
15
|
-
shortUnit?: string
|
|
16
|
-
datasetName?: string
|
|
17
|
-
datasetId?: number
|
|
18
|
-
coverage?: string
|
|
19
|
-
nonRedistributable?: boolean
|
|
20
|
-
source?: OwidSource
|
|
21
|
-
origins?: OwidOrigin[]
|
|
22
|
-
schemaVersion?: number
|
|
23
|
-
processingLevel?: OwidProcessingLevel
|
|
24
|
-
presentation?: OwidVariablePresentation
|
|
25
|
-
shortName?: string
|
|
26
|
-
timespan?: string
|
|
27
|
-
catalogPath?: string
|
|
28
|
-
license?: OwidLicense
|
|
29
|
-
updatePeriodDays?: number
|
|
30
|
-
datasetVersion?: string
|
|
31
|
-
licenses?: OwidLicense[]
|
|
32
|
-
type?: OwidVariableType
|
|
33
|
-
|
|
34
|
-
// omitted:
|
|
35
|
-
// code
|
|
36
|
-
// coverage
|
|
37
|
-
// dataPath
|
|
38
|
-
// metadataPath
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface IndicatorTitleWithFragments {
|
|
42
|
-
title: string
|
|
43
|
-
attributionShort?: string
|
|
44
|
-
titleVariant?: string
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function joinTitleFragments(
|
|
48
|
-
attributionShort: string | undefined,
|
|
49
|
-
titleVariant: string | undefined
|
|
50
|
-
): string | undefined {
|
|
51
|
-
if (attributionShort && titleVariant && attributionShort !== titleVariant) {
|
|
52
|
-
return `${titleVariant} – ${attributionShort}`
|
|
53
|
-
}
|
|
54
|
-
if (attributionShort) {
|
|
55
|
-
return attributionShort
|
|
56
|
-
}
|
|
57
|
-
if (titleVariant) {
|
|
58
|
-
return titleVariant
|
|
59
|
-
}
|
|
60
|
-
return undefined
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface OwidLicense {
|
|
64
|
-
name: string
|
|
65
|
-
url: string
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface OwidVariablePresentation {
|
|
69
|
-
titlePublic?: string
|
|
70
|
-
titleVariant?: string
|
|
71
|
-
attributionShort?: string
|
|
72
|
-
attribution?: string
|
|
73
|
-
topicTagsLinks?: string[]
|
|
74
|
-
faqs?: FaqLink[]
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export type OwidProcessingLevel = "minor" | "major"
|
|
78
|
-
|
|
79
|
-
export interface FaqLink {
|
|
80
|
-
gdocId: string
|
|
81
|
-
fragmentId: string
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type OwidVariableWithSourceAndDimension = OwidVariableWithSource & {
|
|
85
|
-
dimensions: OwidVariableDimensions
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export type OwidVariableWithSourceAndDimensionWithoutId = Omit<
|
|
89
|
-
OwidVariableWithSourceAndDimension,
|
|
90
|
-
"id"
|
|
91
|
-
>
|
|
92
|
-
|
|
93
|
-
export interface OwidVariableMixedData {
|
|
94
|
-
years: number[]
|
|
95
|
-
entities: number[]
|
|
96
|
-
values: (string | number)[]
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export type OwidVariableWithDataAndSource = OwidVariableWithSource &
|
|
100
|
-
OwidVariableMixedData
|
|
101
|
-
|
|
102
|
-
export interface OwidVariableDimension {
|
|
103
|
-
values: OwidVariableDimensionValuePartial[]
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface OwidVariableDimensions {
|
|
107
|
-
years: OwidVariableDimension
|
|
108
|
-
entities: OwidVariableDimension
|
|
109
|
-
values?: OwidVariableDimension
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export type OwidVariableDataMetadataDimensions = {
|
|
113
|
-
data: OwidVariableMixedData
|
|
114
|
-
metadata: OwidVariableWithSourceAndDimension
|
|
115
|
-
}
|
|
116
|
-
export type MultipleOwidVariableDataDimensionsMap = Map<
|
|
117
|
-
number,
|
|
118
|
-
OwidVariableDataMetadataDimensions
|
|
119
|
-
>
|
|
120
|
-
|
|
121
|
-
export interface OwidVariableDimensionValuePartial {
|
|
122
|
-
id: number
|
|
123
|
-
name?: string
|
|
124
|
-
code?: string
|
|
125
|
-
}
|
|
126
|
-
export type OwidVariableDimensionValueFull =
|
|
127
|
-
Required<OwidVariableDimensionValuePartial>
|
|
128
|
-
|
|
129
|
-
export interface OwidEntityKey {
|
|
130
|
-
[id: string]: OwidVariableDimensionValuePartial
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export type OwidVariableType = "string" | "float" | "int" | "mixed" | "ordinal"
|