@buildcanada/charts 0.3.2 → 0.3.4
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 +4 -8
- package/src/index.ts +55 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildcanada/charts",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "A configurable data visualization library for creating interactive charts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -30,11 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/BuildCanada/bcds#readme",
|
|
32
32
|
"publishConfig": {
|
|
33
|
-
"access": "public"
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@buildcanada/colours": "^0.3.2",
|
|
36
|
-
"@buildcanada/components": "^0.3.2"
|
|
37
|
-
}
|
|
33
|
+
"access": "public"
|
|
38
34
|
},
|
|
39
35
|
"scripts": {
|
|
40
36
|
"typecheck": "tsc --noEmit",
|
|
@@ -58,8 +54,8 @@
|
|
|
58
54
|
"react-dom": "^19.0.0"
|
|
59
55
|
},
|
|
60
56
|
"dependencies": {
|
|
61
|
-
"@buildcanada/colours": "
|
|
62
|
-
"@buildcanada/components": "
|
|
57
|
+
"@buildcanada/colours": "^0.3.3",
|
|
58
|
+
"@buildcanada/components": "^0.3.3",
|
|
63
59
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
64
60
|
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
65
61
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
package/src/index.ts
CHANGED
|
@@ -41,49 +41,49 @@ export {
|
|
|
41
41
|
createFallbackConfig,
|
|
42
42
|
reportError,
|
|
43
43
|
trackEvent,
|
|
44
|
-
} from "./config/index.
|
|
44
|
+
} from "./config/index.ts"
|
|
45
45
|
|
|
46
46
|
// Re-export grapher components
|
|
47
47
|
export {
|
|
48
48
|
Grapher,
|
|
49
49
|
type GrapherProgrammaticInterface,
|
|
50
50
|
type GrapherManager,
|
|
51
|
-
} from "./grapher/core/Grapher.
|
|
51
|
+
} from "./grapher/core/Grapher.tsx"
|
|
52
52
|
|
|
53
|
-
export { GrapherState } from "./grapher/core/GrapherState.
|
|
54
|
-
export { FetchingGrapher } from "./grapher/core/FetchingGrapher.
|
|
53
|
+
export { GrapherState } from "./grapher/core/GrapherState.ts"
|
|
54
|
+
export { FetchingGrapher } from "./grapher/core/FetchingGrapher.tsx"
|
|
55
55
|
|
|
56
56
|
// Explorer
|
|
57
|
-
export { Explorer } from "./explorer/Explorer.
|
|
58
|
-
export type { ExplorerProps } from "./explorer/Explorer.
|
|
57
|
+
export { Explorer } from "./explorer/Explorer.tsx"
|
|
58
|
+
export type { ExplorerProps } from "./explorer/Explorer.tsx"
|
|
59
59
|
|
|
60
60
|
// Chart State types
|
|
61
|
-
export type { ChartState, ChartSeries } from "./grapher/chart/ChartInterface.
|
|
62
|
-
export type { LineChartState } from "./grapher/lineCharts/LineChartState.
|
|
63
|
-
export type { SlopeChartState } from "./grapher/slopeCharts/SlopeChartState.
|
|
64
|
-
export type { DiscreteBarChartState } from "./grapher/barCharts/DiscreteBarChartState.
|
|
65
|
-
export type { StackedAreaChartState } from "./grapher/stackedCharts/StackedAreaChartState.
|
|
66
|
-
export type { StackedBarChartState } from "./grapher/stackedCharts/StackedBarChartState.
|
|
67
|
-
export type { StackedDiscreteBarChartState } from "./grapher/stackedCharts/StackedDiscreteBarChartState.
|
|
68
|
-
export type { ScatterPlotChartState } from "./grapher/scatterCharts/ScatterPlotChartState.
|
|
69
|
-
export type { MarimekkoChartState } from "./grapher/stackedCharts/MarimekkoChartState.
|
|
70
|
-
export { MapChartState } from "./grapher/mapCharts/MapChartState.
|
|
71
|
-
export { MapConfig } from "./grapher/mapCharts/MapConfig.
|
|
61
|
+
export type { ChartState, ChartSeries } from "./grapher/chart/ChartInterface.ts"
|
|
62
|
+
export type { LineChartState } from "./grapher/lineCharts/LineChartState.ts"
|
|
63
|
+
export type { SlopeChartState } from "./grapher/slopeCharts/SlopeChartState.ts"
|
|
64
|
+
export type { DiscreteBarChartState } from "./grapher/barCharts/DiscreteBarChartState.ts"
|
|
65
|
+
export type { StackedAreaChartState } from "./grapher/stackedCharts/StackedAreaChartState.ts"
|
|
66
|
+
export type { StackedBarChartState } from "./grapher/stackedCharts/StackedBarChartState.ts"
|
|
67
|
+
export type { StackedDiscreteBarChartState } from "./grapher/stackedCharts/StackedDiscreteBarChartState.ts"
|
|
68
|
+
export type { ScatterPlotChartState } from "./grapher/scatterCharts/ScatterPlotChartState.ts"
|
|
69
|
+
export type { MarimekkoChartState } from "./grapher/stackedCharts/MarimekkoChartState.ts"
|
|
70
|
+
export { MapChartState } from "./grapher/mapCharts/MapChartState.ts"
|
|
71
|
+
export { MapConfig } from "./grapher/mapCharts/MapConfig.ts"
|
|
72
72
|
|
|
73
73
|
// Data loading
|
|
74
74
|
export {
|
|
75
75
|
fetchInputTableForConfig,
|
|
76
76
|
getCachingInputTableFetcher,
|
|
77
77
|
type FetchInputTableForConfigFn,
|
|
78
|
-
} from "./grapher/core/loadGrapherTableHelpers.
|
|
78
|
+
} from "./grapher/core/loadGrapherTableHelpers.ts"
|
|
79
79
|
|
|
80
|
-
export { loadVariableDataAndMetadata } from "./grapher/core/loadVariable.
|
|
80
|
+
export { loadVariableDataAndMetadata } from "./grapher/core/loadVariable.ts"
|
|
81
81
|
|
|
82
82
|
// Color system
|
|
83
|
-
export { ColorScale } from "./grapher/color/ColorScale.
|
|
84
|
-
export { ColorScaleConfig } from "./grapher/color/ColorScaleConfig.
|
|
85
|
-
export { ColorScheme } from "./grapher/color/ColorScheme.
|
|
86
|
-
export { ColorSchemes, getColorSchemeForChartType } from "./grapher/color/ColorSchemes.
|
|
83
|
+
export { ColorScale } from "./grapher/color/ColorScale.ts"
|
|
84
|
+
export { ColorScaleConfig } from "./grapher/color/ColorScaleConfig.ts"
|
|
85
|
+
export { ColorScheme } from "./grapher/color/ColorScheme.ts"
|
|
86
|
+
export { ColorSchemes, getColorSchemeForChartType } from "./grapher/color/ColorSchemes.ts"
|
|
87
87
|
export {
|
|
88
88
|
NumericBin,
|
|
89
89
|
CategoricalBin,
|
|
@@ -92,11 +92,11 @@ export {
|
|
|
92
92
|
isNumericBin,
|
|
93
93
|
isNoDataBin,
|
|
94
94
|
isProjectedDataBin,
|
|
95
|
-
} from "./grapher/color/ColorScaleBin.
|
|
95
|
+
} from "./grapher/color/ColorScaleBin.ts"
|
|
96
96
|
|
|
97
97
|
// Selection and Focus
|
|
98
|
-
export { SelectionArray } from "./grapher/selection/SelectionArray.
|
|
99
|
-
export { FocusArray } from "./grapher/focus/FocusArray.
|
|
98
|
+
export { SelectionArray } from "./grapher/selection/SelectionArray.ts"
|
|
99
|
+
export { FocusArray } from "./grapher/focus/FocusArray.ts"
|
|
100
100
|
|
|
101
101
|
// Constants
|
|
102
102
|
export {
|
|
@@ -108,20 +108,20 @@ export {
|
|
|
108
108
|
BASE_FONT_SIZE,
|
|
109
109
|
Patterns,
|
|
110
110
|
latestGrapherConfigSchema,
|
|
111
|
-
} from "./grapher/core/GrapherConstants.
|
|
111
|
+
} from "./grapher/core/GrapherConstants.ts"
|
|
112
112
|
|
|
113
113
|
// Controls
|
|
114
|
-
export { EntityPicker } from "./grapher/controls/entityPicker/EntityPicker.
|
|
115
|
-
export type { EntityPickerManager } from "./grapher/controls/entityPicker/EntityPickerConstants.
|
|
116
|
-
export { GlobalEntitySelector } from "./grapher/controls/globalEntitySelector/GlobalEntitySelector.
|
|
117
|
-
export { Dropdown } from "./grapher/controls/Dropdown.
|
|
114
|
+
export { EntityPicker } from "./grapher/controls/entityPicker/EntityPicker.tsx"
|
|
115
|
+
export type { EntityPickerManager } from "./grapher/controls/entityPicker/EntityPickerConstants.ts"
|
|
116
|
+
export { GlobalEntitySelector } from "./grapher/controls/globalEntitySelector/GlobalEntitySelector.tsx"
|
|
117
|
+
export { Dropdown } from "./grapher/controls/Dropdown.tsx"
|
|
118
118
|
|
|
119
119
|
// Schema and migrations
|
|
120
|
-
export { defaultGrapherConfig } from "./grapher/schema/defaultGrapherConfig.
|
|
120
|
+
export { defaultGrapherConfig } from "./grapher/schema/defaultGrapherConfig.ts"
|
|
121
121
|
export {
|
|
122
122
|
migrateGrapherConfigToLatestVersion,
|
|
123
123
|
migrateGrapherConfigToLatestVersionAndFailOnError,
|
|
124
|
-
} from "./grapher/schema/migrations/migrate.
|
|
124
|
+
} from "./grapher/schema/migrations/migrate.ts"
|
|
125
125
|
|
|
126
126
|
// URL utilities
|
|
127
127
|
export {
|
|
@@ -131,46 +131,46 @@ export {
|
|
|
131
131
|
generateSelectedEntityNamesParam,
|
|
132
132
|
generateFocusedSeriesNamesParam,
|
|
133
133
|
getEntityNamesParam,
|
|
134
|
-
} from "./grapher/core/EntityUrlBuilder.
|
|
134
|
+
} from "./grapher/core/EntityUrlBuilder.ts"
|
|
135
135
|
|
|
136
|
-
export { grapherConfigToQueryParams } from "./grapher/core/GrapherUrl.
|
|
136
|
+
export { grapherConfigToQueryParams } from "./grapher/core/GrapherUrl.ts"
|
|
137
137
|
|
|
138
138
|
// Chart utilities
|
|
139
|
-
export { ChartDimension } from "./grapher/chart/ChartDimension.
|
|
140
|
-
export { DimensionSlot } from "./grapher/chart/DimensionSlot.
|
|
141
|
-
export { makeChartState } from "./grapher/chart/ChartTypeMap.
|
|
142
|
-
export { generateGrapherImageSrcSet } from "./grapher/chart/ChartUtils.
|
|
139
|
+
export { ChartDimension } from "./grapher/chart/ChartDimension.ts"
|
|
140
|
+
export { DimensionSlot } from "./grapher/chart/DimensionSlot.ts"
|
|
141
|
+
export { makeChartState } from "./grapher/chart/ChartTypeMap.tsx"
|
|
142
|
+
export { generateGrapherImageSrcSet } from "./grapher/chart/ChartUtils.tsx"
|
|
143
143
|
|
|
144
144
|
// Slideshow
|
|
145
145
|
export {
|
|
146
146
|
type SlideShowManager,
|
|
147
147
|
SlideShowController,
|
|
148
|
-
} from "./grapher/slideshowController/SlideShowController.
|
|
148
|
+
} from "./grapher/slideshowController/SlideShowController.tsx"
|
|
149
149
|
|
|
150
150
|
// Analytics
|
|
151
|
-
export { GrapherAnalytics } from "./grapher/core/GrapherAnalytics.
|
|
151
|
+
export { GrapherAnalytics } from "./grapher/core/GrapherAnalytics.ts"
|
|
152
152
|
|
|
153
153
|
// Rendering helpers
|
|
154
154
|
export {
|
|
155
155
|
renderGrapherIntoContainer,
|
|
156
156
|
renderSingleGrapherOnGrapherPage,
|
|
157
|
-
} from "./grapher/core/GrapherUseHelpers.
|
|
157
|
+
} from "./grapher/core/GrapherUseHelpers.tsx"
|
|
158
158
|
|
|
159
159
|
// Map features
|
|
160
|
-
export { GeoFeatures } from "./grapher/mapCharts/GeoFeatures.
|
|
160
|
+
export { GeoFeatures } from "./grapher/mapCharts/GeoFeatures.ts"
|
|
161
161
|
export {
|
|
162
162
|
MAP_REGION_LABELS,
|
|
163
163
|
type GeoFeature,
|
|
164
164
|
type Direction,
|
|
165
165
|
type Ellipse,
|
|
166
166
|
type EllipseCoords,
|
|
167
|
-
} from "./grapher/mapCharts/MapChartConstants.
|
|
167
|
+
} from "./grapher/mapCharts/MapChartConstants.ts"
|
|
168
168
|
|
|
169
169
|
// Comparison lines
|
|
170
|
-
export { isValidVerticalComparisonLineConfig } from "./grapher/comparisonLine/ComparisonLineHelpers.
|
|
170
|
+
export { isValidVerticalComparisonLineConfig } from "./grapher/comparisonLine/ComparisonLineHelpers.ts"
|
|
171
171
|
|
|
172
172
|
// Binning strategies
|
|
173
|
-
export { hasValidConfigForBinningStrategy } from "./grapher/color/BinningStrategies.
|
|
173
|
+
export { hasValidConfigForBinningStrategy } from "./grapher/color/BinningStrategies.ts"
|
|
174
174
|
|
|
175
175
|
// Chart tabs
|
|
176
176
|
export {
|
|
@@ -180,7 +180,7 @@ export {
|
|
|
180
180
|
mapGrapherTabNameToQueryParam,
|
|
181
181
|
mapGrapherTabNameToConfigOption,
|
|
182
182
|
makeLabelForGrapherTab,
|
|
183
|
-
} from "./grapher/chart/ChartTabs.
|
|
183
|
+
} from "./grapher/chart/ChartTabs.ts"
|
|
184
184
|
|
|
185
185
|
// Guided chart utilities
|
|
186
186
|
export {
|
|
@@ -190,15 +190,15 @@ export {
|
|
|
190
190
|
type GuidedChartContextValue,
|
|
191
191
|
type ArchiveGuidedChartRegistration,
|
|
192
192
|
buildArchiveGuidedChartSrc,
|
|
193
|
-
} from "./grapher/chart/guidedChartUtils.
|
|
193
|
+
} from "./grapher/chart/guidedChartUtils.ts"
|
|
194
194
|
|
|
195
195
|
// Legacy conversion
|
|
196
196
|
export {
|
|
197
197
|
legacyToChartsTableAndDimensions,
|
|
198
198
|
legacyToChartsTableAndDimensionsWithMandatorySlug,
|
|
199
|
-
} from "./grapher/core/LegacyToChartsTable.
|
|
199
|
+
} from "./grapher/core/LegacyToChartsTable.ts"
|
|
200
200
|
|
|
201
|
-
export { legacyToCurrentGrapherUrl } from "./grapher/core/GrapherUrlMigrations.
|
|
201
|
+
export { legacyToCurrentGrapherUrl } from "./grapher/core/GrapherUrlMigrations.ts"
|
|
202
202
|
|
|
203
203
|
// Test data helpers (useful for demos and testing)
|
|
204
204
|
export {
|
|
@@ -206,8 +206,8 @@ export {
|
|
|
206
206
|
createTestDataset,
|
|
207
207
|
type TestData,
|
|
208
208
|
type TestMetadata,
|
|
209
|
-
} from "./grapher/testData/TestData.
|
|
210
|
-
export { LifeExpectancyGrapher } from "./grapher/testData/TestData.sample.
|
|
209
|
+
} from "./grapher/testData/TestData.ts"
|
|
210
|
+
export { LifeExpectancyGrapher } from "./grapher/testData/TestData.sample.ts"
|
|
211
211
|
|
|
212
212
|
// Types commonly needed for data loading
|
|
213
213
|
export {
|
|
@@ -219,8 +219,8 @@ export {
|
|
|
219
219
|
type EntityName,
|
|
220
220
|
type EntityId,
|
|
221
221
|
type EntityCode,
|
|
222
|
-
} from "./types/index.
|
|
222
|
+
} from "./types/index.ts"
|
|
223
223
|
|
|
224
224
|
// Utilities for data loading
|
|
225
|
-
export { Bounds } from "./utils/index.
|
|
226
|
-
export { parseDelimited, ChartsTable, BlankChartsTable } from "./core-table/index.
|
|
225
|
+
export { Bounds } from "./utils/index.ts"
|
|
226
|
+
export { parseDelimited, ChartsTable, BlankChartsTable } from "./core-table/index.ts"
|