@buildcanada/charts 0.3.4 → 0.3.5
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 +1 -1
- package/src/components/GrapherTabIcon.tsx +1 -1
- package/src/components/GrapherTrendArrow.tsx +1 -1
- package/src/components/Halo/Halo.tsx +1 -1
- package/src/components/LabeledSwitch/LabeledSwitch.tsx +1 -1
- package/src/components/MarkdownTextWrap/MarkdownTextWrap.tsx +4 -4
- package/src/components/OverlayHeader.tsx +1 -1
- package/src/components/SimpleMarkdownText.tsx +1 -1
- package/src/components/TextWrap/TextWrap.tsx +1 -1
- package/src/components/index.ts +23 -23
- package/src/components/loadingIndicator/LoadingIndicator.tsx +1 -1
- package/src/core-table/ChartsTable.ts +7 -7
- package/src/core-table/CoreTable.ts +6 -6
- package/src/core-table/CoreTableColumns.ts +5 -5
- package/src/core-table/CoreTableUtils.ts +3 -3
- package/src/core-table/ErrorValues.ts +1 -1
- package/src/core-table/TableSynthesizers.ts +3 -3
- package/src/core-table/TableUtil.ts +2 -2
- package/src/core-table/Transforms.ts +3 -3
- package/src/core-table/index.ts +8 -8
- package/src/explorer/ColumnGrammar.ts +4 -4
- package/src/explorer/Explorer.sample.ts +4 -4
- package/src/explorer/Explorer.tsx +10 -10
- package/src/explorer/ExplorerConstants.ts +2 -2
- package/src/explorer/ExplorerControls.tsx +4 -4
- package/src/explorer/ExplorerDecisionMatrix.ts +7 -7
- package/src/explorer/ExplorerGrammar.ts +4 -4
- package/src/explorer/ExplorerProgram.ts +11 -11
- package/src/explorer/ExplorerUtils.ts +4 -4
- package/src/explorer/GrapherGrammar.ts +3 -3
- package/src/explorer/gridLang/GridCell.ts +4 -4
- package/src/explorer/gridLang/GridLangConstants.ts +1 -1
- package/src/explorer/gridLang/GridProgram.ts +5 -5
- package/src/explorer/index.ts +15 -15
- package/src/explorer/urlMigrations/CO2UrlMigration.ts +3 -3
- package/src/explorer/urlMigrations/CovidUrlMigration.ts +2 -2
- package/src/explorer/urlMigrations/EnergyUrlMigration.ts +3 -3
- package/src/explorer/urlMigrations/ExplorerPageUrlMigrationSpec.ts +1 -1
- package/src/explorer/urlMigrations/ExplorerUrlMigrationUtils.ts +2 -2
- package/src/explorer/urlMigrations/ExplorerUrlMigrations.ts +5 -5
- package/src/explorer/urlMigrations/LegacyCovidUrlMigration.ts +4 -4
- package/src/grapher/axis/Axis.ts +5 -5
- package/src/grapher/axis/AxisConfig.ts +2 -2
- package/src/grapher/axis/AxisViews.tsx +2 -2
- package/src/grapher/barCharts/DiscreteBarChart.tsx +4 -4
- package/src/grapher/barCharts/DiscreteBarChartConstants.ts +4 -4
- package/src/grapher/barCharts/DiscreteBarChartHelpers.ts +3 -3
- package/src/grapher/barCharts/DiscreteBarChartState.ts +2 -2
- package/src/grapher/barCharts/DiscreteBarChartThumbnail.tsx +2 -2
- package/src/grapher/captionedChart/CaptionedChart.tsx +4 -4
- package/src/grapher/captionedChart/Logos.tsx +2 -2
- package/src/grapher/captionedChart/StaticChartRasterizer.tsx +1 -1
- package/src/grapher/chart/Chart.tsx +5 -5
- package/src/grapher/chart/ChartAreaContent.tsx +3 -3
- package/src/grapher/chart/ChartDimension.ts +2 -2
- package/src/grapher/chart/ChartInterface.ts +2 -2
- package/src/grapher/chart/ChartManager.ts +3 -3
- package/src/grapher/chart/ChartTabs.ts +1 -1
- package/src/grapher/chart/ChartTypeMap.tsx +9 -9
- package/src/grapher/chart/ChartTypeSwitcher.tsx +1 -1
- package/src/grapher/chart/ChartUtils.tsx +3 -3
- package/src/grapher/chart/DimensionSlot.ts +1 -1
- package/src/grapher/chart/StaticChartWrapper.tsx +5 -5
- package/src/grapher/chart/guidedChartUtils.ts +4 -4
- package/src/grapher/color/BinningStrategies.ts +4 -4
- package/src/grapher/color/BinningStrategyEqualSizeBins.ts +3 -3
- package/src/grapher/color/BinningStrategyLogarithmic.ts +3 -3
- package/src/grapher/color/CategoricalColorAssigner.ts +1 -1
- package/src/grapher/color/ColorBrewerSchemes.ts +1 -1
- package/src/grapher/color/ColorScale.ts +4 -4
- package/src/grapher/color/ColorScaleBin.ts +1 -1
- package/src/grapher/color/ColorScaleConfig.ts +2 -2
- package/src/grapher/color/ColorScheme.ts +2 -2
- package/src/grapher/color/ColorSchemes.ts +2 -2
- package/src/grapher/color/ColorUtils.ts +1 -1
- package/src/grapher/color/CustomSchemes.ts +2 -2
- package/src/grapher/comparisonLine/ComparisonLine.tsx +1 -1
- package/src/grapher/comparisonLine/ComparisonLineGenerator.ts +1 -1
- package/src/grapher/comparisonLine/ComparisonLineHelpers.ts +1 -1
- package/src/grapher/comparisonLine/CustomComparisonLine.tsx +3 -3
- package/src/grapher/comparisonLine/VerticalComparisonLine.tsx +2 -2
- package/src/grapher/controls/ActionButtons.tsx +4 -4
- package/src/grapher/controls/CommandPalette.tsx +1 -1
- package/src/grapher/controls/ContentSwitchers.tsx +3 -3
- package/src/grapher/controls/DataTableFilterDropdown.tsx +2 -2
- package/src/grapher/controls/Dropdown.tsx +1 -1
- package/src/grapher/controls/EntitySelectionToggle.tsx +1 -1
- package/src/grapher/controls/MapRegionDropdown.tsx +1 -1
- package/src/grapher/controls/MapResetButton.tsx +1 -1
- package/src/grapher/controls/MapZoomDropdown.tsx +2 -2
- package/src/grapher/controls/MapZoomToSelectionButton.tsx +1 -1
- package/src/grapher/controls/SearchField.tsx +1 -1
- package/src/grapher/controls/SettingsMenu.tsx +3 -3
- package/src/grapher/controls/ShareMenu.tsx +3 -3
- package/src/grapher/controls/SortIcon.tsx +1 -1
- package/src/grapher/controls/controlsRow/ControlsRow.tsx +1 -1
- package/src/grapher/controls/entityPicker/EntityPicker.tsx +2 -2
- package/src/grapher/controls/entityPicker/EntityPickerConstants.ts +3 -3
- package/src/grapher/controls/globalEntitySelector/GlobalEntitySelector.tsx +2 -2
- package/src/grapher/controls/settings/AbsRelToggle.tsx +2 -2
- package/src/grapher/controls/settings/AxisScaleToggle.tsx +1 -1
- package/src/grapher/controls/settings/FacetStrategySelector.tsx +1 -1
- package/src/grapher/controls/settings/FacetYDomainToggle.tsx +2 -2
- package/src/grapher/controls/settings/NoDataAreaToggle.tsx +1 -1
- package/src/grapher/controls/settings/ZoomToggle.tsx +1 -1
- package/src/grapher/core/EntitiesByRegionType.ts +2 -2
- package/src/grapher/core/EntityCodes.ts +2 -2
- package/src/grapher/core/EntityUrlBuilder.ts +2 -2
- package/src/grapher/core/FetchingGrapher.tsx +8 -8
- package/src/grapher/core/Grapher.tsx +6 -6
- package/src/grapher/core/GrapherAnalytics.ts +1 -1
- package/src/grapher/core/GrapherConstants.ts +3 -3
- package/src/grapher/core/GrapherState.tsx +38 -38
- package/src/grapher/core/GrapherUrl.ts +4 -4
- package/src/grapher/core/GrapherUrlMigrations.ts +1 -1
- package/src/grapher/core/GrapherUseHelpers.tsx +5 -5
- package/src/grapher/core/LegacyToChartsTable.ts +4 -4
- package/src/grapher/core/loadGrapherTableHelpers.ts +4 -4
- package/src/grapher/core/loadVariable.ts +2 -2
- package/src/grapher/core/relatedQuestion.ts +1 -1
- package/src/grapher/dataTable/DataTable.sample.ts +3 -3
- package/src/grapher/dataTable/DataTable.tsx +3 -3
- package/src/grapher/dataTable/DataTableConstants.ts +2 -2
- package/src/grapher/entitySelector/EntitySelector.tsx +7 -7
- package/src/grapher/facet/FacetChart.tsx +4 -4
- package/src/grapher/facet/FacetChartConstants.ts +2 -2
- package/src/grapher/facet/FacetMap.tsx +4 -4
- package/src/grapher/facet/FacetMapConstants.ts +1 -1
- package/src/grapher/focus/FocusArray.ts +2 -2
- package/src/grapher/footer/Footer.tsx +2 -2
- package/src/grapher/footer/FooterManager.ts +1 -1
- package/src/grapher/fullScreen/FullScreen.tsx +1 -1
- package/src/grapher/header/Header.tsx +2 -2
- package/src/grapher/header/HeaderManager.ts +2 -2
- package/src/grapher/index.ts +8 -8
- package/src/grapher/legend/HorizontalColorLegends.tsx +2 -2
- package/src/grapher/legend/LegendInteractionState.ts +1 -1
- package/src/grapher/legend/VerticalColorLegend.tsx +2 -2
- package/src/grapher/lineCharts/LineChart.tsx +6 -6
- package/src/grapher/lineCharts/LineChartConstants.ts +2 -2
- package/src/grapher/lineCharts/LineChartHelpers.ts +2 -2
- package/src/grapher/lineCharts/LineChartState.ts +3 -3
- package/src/grapher/lineCharts/LineChartThumbnail.tsx +3 -3
- package/src/grapher/lineCharts/Lines.tsx +1 -1
- package/src/grapher/lineLegend/LineLegend.tsx +6 -6
- package/src/grapher/lineLegend/LineLegendHelpers.ts +1 -1
- package/src/grapher/lineLegend/LineLegendTypes.ts +2 -2
- package/src/grapher/mapCharts/ChoroplethGlobe.tsx +1 -1
- package/src/grapher/mapCharts/ChoroplethMap.tsx +1 -1
- package/src/grapher/mapCharts/GeoFeatures.ts +1 -1
- package/src/grapher/mapCharts/GlobeController.ts +2 -2
- package/src/grapher/mapCharts/MapAnnotations.ts +1 -1
- package/src/grapher/mapCharts/MapChart.sample.ts +2 -2
- package/src/grapher/mapCharts/MapChart.tsx +6 -6
- package/src/grapher/mapCharts/MapChartConstants.ts +4 -4
- package/src/grapher/mapCharts/MapChartState.ts +3 -3
- package/src/grapher/mapCharts/MapComponents.tsx +2 -2
- package/src/grapher/mapCharts/MapConfig.ts +2 -2
- package/src/grapher/mapCharts/MapHelpers.ts +5 -5
- package/src/grapher/mapCharts/MapProjections.ts +2 -2
- package/src/grapher/mapCharts/MapSparkline.tsx +5 -5
- package/src/grapher/mapCharts/MapTooltip.tsx +6 -6
- package/src/grapher/modal/DownloadModal.tsx +7 -7
- package/src/grapher/modal/EmbedModal.tsx +2 -2
- package/src/grapher/modal/EntitySelectorModal.tsx +1 -1
- package/src/grapher/modal/Modal.tsx +1 -1
- package/src/grapher/modal/ModalHeader.tsx +1 -1
- package/src/grapher/modal/SourcesDescriptions.tsx +1 -1
- package/src/grapher/modal/SourcesKeyDataTable.tsx +2 -2
- package/src/grapher/modal/SourcesModal.tsx +4 -4
- package/src/grapher/noDataModal/NoDataModal.tsx +2 -2
- package/src/grapher/scatterCharts/ConnectedScatterLegend.tsx +2 -2
- package/src/grapher/scatterCharts/NoDataSection.tsx +1 -1
- package/src/grapher/scatterCharts/ScatterPlotChart.tsx +5 -5
- package/src/grapher/scatterCharts/ScatterPlotChartConstants.ts +4 -4
- package/src/grapher/scatterCharts/ScatterPlotChartState.ts +4 -4
- package/src/grapher/scatterCharts/ScatterPlotChartThumbnail.tsx +2 -2
- package/src/grapher/scatterCharts/ScatterPlotTooltip.tsx +3 -3
- package/src/grapher/scatterCharts/ScatterPoints.tsx +1 -1
- package/src/grapher/scatterCharts/ScatterPointsWithLabels.tsx +3 -3
- package/src/grapher/scatterCharts/ScatterSizeLegend.tsx +3 -3
- package/src/grapher/scatterCharts/ScatterUtils.ts +3 -3
- package/src/grapher/schema/defaultGrapherConfig.ts +1 -1
- package/src/grapher/schema/migrations/migrate.ts +1 -1
- package/src/grapher/schema/migrations/migrations.ts +1 -1
- package/src/grapher/selection/MapSelectionArray.ts +1 -1
- package/src/grapher/selection/SelectionArray.ts +1 -1
- package/src/grapher/sidePanel/SidePanel.tsx +2 -2
- package/src/grapher/slopeCharts/MarkX.tsx +1 -1
- package/src/grapher/slopeCharts/Slope.tsx +1 -1
- package/src/grapher/slopeCharts/SlopeChart.tsx +5 -5
- package/src/grapher/slopeCharts/SlopeChartConstants.ts +3 -3
- package/src/grapher/slopeCharts/SlopeChartHelpers.ts +1 -1
- package/src/grapher/slopeCharts/SlopeChartState.ts +3 -3
- package/src/grapher/slopeCharts/SlopeChartThumbnail.tsx +3 -3
- package/src/grapher/stackedCharts/AbstractStackedChartState.ts +13 -13
- package/src/grapher/stackedCharts/MarimekkoBars.tsx +1 -1
- package/src/grapher/stackedCharts/MarimekkoBarsForOneEntity.tsx +2 -2
- package/src/grapher/stackedCharts/MarimekkoChart.tsx +5 -5
- package/src/grapher/stackedCharts/MarimekkoChartConstants.ts +3 -3
- package/src/grapher/stackedCharts/MarimekkoChartState.ts +5 -5
- package/src/grapher/stackedCharts/MarimekkoChartThumbnail.tsx +2 -2
- package/src/grapher/stackedCharts/MarimekkoInternalLabels.tsx +2 -2
- package/src/grapher/stackedCharts/StackedAreaChart.tsx +6 -6
- package/src/grapher/stackedCharts/StackedAreaChartState.ts +5 -5
- package/src/grapher/stackedCharts/StackedAreaChartThumbnail.tsx +3 -3
- package/src/grapher/stackedCharts/StackedAreas.tsx +2 -2
- package/src/grapher/stackedCharts/StackedBarChart.tsx +6 -6
- package/src/grapher/stackedCharts/StackedBarChartState.ts +8 -8
- package/src/grapher/stackedCharts/StackedBarChartThumbnail.tsx +3 -3
- package/src/grapher/stackedCharts/StackedBarSegment.tsx +1 -1
- package/src/grapher/stackedCharts/StackedBars.tsx +3 -3
- package/src/grapher/stackedCharts/StackedConstants.ts +3 -3
- package/src/grapher/stackedCharts/StackedDiscreteBarChart.tsx +3 -3
- package/src/grapher/stackedCharts/StackedDiscreteBarChartState.ts +3 -3
- package/src/grapher/stackedCharts/StackedDiscreteBarChartThumbnail.tsx +1 -1
- package/src/grapher/stackedCharts/StackedDiscreteBars.tsx +5 -5
- package/src/grapher/stackedCharts/StackedUtils.ts +2 -2
- package/src/grapher/testData/TestData.sample.ts +2 -2
- package/src/grapher/testData/TestData.ts +2 -2
- package/src/grapher/timeline/TimelineComponent.tsx +2 -2
- package/src/grapher/timeline/TimelineController.ts +2 -2
- package/src/grapher/tooltip/Tooltip.tsx +4 -4
- package/src/grapher/tooltip/TooltipContents.tsx +5 -5
- package/src/grapher/tooltip/TooltipProps.ts +1 -1
- package/src/grapher/tooltip/TooltipState.ts +1 -1
- package/src/grapher/verticalLabels/VerticalLabels.tsx +1 -1
- package/src/grapher/verticalLabels/VerticalLabelsState.ts +2 -2
- package/src/types/Origin.ts +1 -1
- package/src/types/Variable.ts +3 -3
- package/src/types/VariableDisplayConfigInterface.ts +2 -2
- package/src/types/domainTypes/ContentGraph.ts +2 -2
- package/src/types/domainTypes/CoreTableTypes.ts +5 -5
- package/src/types/domainTypes/Posts.ts +4 -4
- package/src/types/domainTypes/Search.ts +2 -2
- package/src/types/gdocTypes/Gdoc.ts +2 -2
- package/src/types/grapherTypes/GrapherTypes.ts +9 -9
- package/src/types/index.ts +15 -15
- package/src/utils/Bounds.ts +2 -2
- package/src/utils/FuzzySearch.ts +1 -1
- package/src/utils/TimeBounds.ts +2 -2
- package/src/utils/Util.ts +3 -3
- package/src/utils/Variable.ts +2 -2
- package/src/utils/archival/archivalDate.ts +2 -2
- package/src/utils/formatValue.ts +2 -2
- package/src/utils/grapherConfigUtils.ts +1 -1
- package/src/utils/image.ts +2 -2
- package/src/utils/index.ts +27 -27
- package/src/utils/metadataHelpers.ts +3 -3
- package/src/utils/regions.ts +2 -2
- package/src/utils/urls/Url.ts +3 -3
- package/src/utils/urls/UrlMigration.ts +1 -1
- package/src/utils/urls/UrlUtils.ts +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Origin } from "../Origin.
|
|
1
|
+
import { Origin } from "../Origin.ts"
|
|
2
2
|
import {
|
|
3
3
|
ProcessingLevel,
|
|
4
4
|
VariablePresentation,
|
|
5
|
-
} from "../Variable.
|
|
6
|
-
import { VariableDisplayConfigInterface } from "../VariableDisplayConfigInterface.
|
|
5
|
+
} from "../Variable.ts"
|
|
6
|
+
import { VariableDisplayConfigInterface } from "../VariableDisplayConfigInterface.ts"
|
|
7
7
|
import {
|
|
8
8
|
Color,
|
|
9
9
|
ColumnSlug,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
Time,
|
|
12
12
|
ToleranceStrategy,
|
|
13
13
|
Year,
|
|
14
|
-
} from "../grapherTypes/GrapherTypes.
|
|
15
|
-
import { Integer } from "./Various.
|
|
14
|
+
} from "../grapherTypes/GrapherTypes.ts"
|
|
15
|
+
import { Integer } from "./Various.ts"
|
|
16
16
|
|
|
17
17
|
export type TableSlug = string // a url friendly name for a table
|
|
18
18
|
export type ColumnSlugs = string // slugs cannot have spaces, so this is a space delimited array of ColumnSlugs
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GdocType } from "../gdocTypes/Gdoc.
|
|
2
|
-
import { WP_PostType } from "../wordpressTypes/WordpressTypes.
|
|
3
|
-
import { RelatedChart } from "../grapherTypes/GrapherTypes.
|
|
4
|
-
import { TocHeading } from "./Toc.
|
|
1
|
+
import { GdocType } from "../gdocTypes/Gdoc.ts"
|
|
2
|
+
import { WP_PostType } from "../wordpressTypes/WordpressTypes.ts"
|
|
3
|
+
import { RelatedChart } from "../grapherTypes/GrapherTypes.ts"
|
|
4
|
+
import { TocHeading } from "./Toc.ts"
|
|
5
5
|
|
|
6
6
|
export interface FormattedPost extends FullPost {
|
|
7
7
|
stickyNavLinks?: { text: string; target: string }[]
|
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
Hit,
|
|
5
5
|
HitHighlightResult,
|
|
6
6
|
} from "instantsearch.js"
|
|
7
|
-
import { GdocType } from "../gdocTypes/Gdoc.
|
|
8
|
-
import { GrapherTabName } from "../grapherTypes/GrapherTypes.
|
|
7
|
+
import { GdocType } from "../gdocTypes/Gdoc.ts"
|
|
8
|
+
import { GrapherTabName } from "../grapherTypes/GrapherTypes.ts"
|
|
9
9
|
import * as z from "zod/mini"
|
|
10
10
|
|
|
11
11
|
export const PagesIndexRecordSchema = z.object({
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* but the types are required for compilation.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { QueryParams } from "../domainTypes/Various.
|
|
9
|
-
import { ArchivedPageVersion } from "../domainTypes/Archive.
|
|
8
|
+
import { QueryParams } from "../domainTypes/Various.ts"
|
|
9
|
+
import { ArchivedPageVersion } from "../domainTypes/Archive.ts"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Document types in the CMS.
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChartDimensionInterface,
|
|
3
3
|
VariableRoundingMode,
|
|
4
|
-
} from "../VariableDisplayConfigInterface.
|
|
5
|
-
import { ColumnSlugs, EntityName } from "../domainTypes/CoreTableTypes.
|
|
6
|
-
import { AxisAlign, Position } from "../domainTypes/Layout.
|
|
7
|
-
import { Integer, VariableId } from "../domainTypes/Various.
|
|
8
|
-
import { DetailDictionary } from "../gdocTypes/Gdoc.
|
|
4
|
+
} from "../VariableDisplayConfigInterface.ts"
|
|
5
|
+
import { ColumnSlugs, EntityName } from "../domainTypes/CoreTableTypes.ts"
|
|
6
|
+
import { AxisAlign, Position } from "../domainTypes/Layout.ts"
|
|
7
|
+
import { Integer, VariableId } from "../domainTypes/Various.ts"
|
|
8
|
+
import { DetailDictionary } from "../gdocTypes/Gdoc.ts"
|
|
9
9
|
import {
|
|
10
10
|
GRAPHER_CHART_TYPES,
|
|
11
11
|
GRAPHER_MAP_TYPE,
|
|
12
12
|
GRAPHER_TAB_NAMES,
|
|
13
13
|
GRAPHER_TAB_CONFIG_OPTIONS,
|
|
14
14
|
GRAPHER_TAB_QUERY_PARAMS,
|
|
15
|
-
} from "./GrapherConstants.
|
|
16
|
-
import { VariableDataMetadataDimensions } from "../Variable.
|
|
17
|
-
import { ArchiveContext } from "../domainTypes/Archive.
|
|
15
|
+
} from "./GrapherConstants.ts"
|
|
16
|
+
import { VariableDataMetadataDimensions } from "../Variable.ts"
|
|
17
|
+
import { ArchiveContext } from "../domainTypes/Archive.ts"
|
|
18
18
|
import {
|
|
19
19
|
BinningStrategyIncludingManual,
|
|
20
20
|
MidpointMode,
|
|
21
|
-
} from "./BinningStrategyTypes.
|
|
21
|
+
} from "./BinningStrategyTypes.ts"
|
|
22
22
|
|
|
23
23
|
// Utility type that marks all properties of T that may be undefined as optional.
|
|
24
24
|
export type UndefinedToOptional<T> = Partial<T> & {
|
package/src/types/index.ts
CHANGED
|
@@ -16,7 +16,7 @@ export {
|
|
|
16
16
|
type SerializedGridProgram,
|
|
17
17
|
type VariableId,
|
|
18
18
|
type QueryParams,
|
|
19
|
-
} from "./domainTypes/Various.
|
|
19
|
+
} from "./domainTypes/Various.ts"
|
|
20
20
|
|
|
21
21
|
export {
|
|
22
22
|
Position,
|
|
@@ -25,7 +25,7 @@ export {
|
|
|
25
25
|
VerticalAlign,
|
|
26
26
|
type GridParameters,
|
|
27
27
|
HorizontalAlign,
|
|
28
|
-
} from "./domainTypes/Layout.
|
|
28
|
+
} from "./domainTypes/Layout.ts"
|
|
29
29
|
|
|
30
30
|
export {
|
|
31
31
|
type TableSlug,
|
|
@@ -57,7 +57,7 @@ export {
|
|
|
57
57
|
type ColumnColorScale,
|
|
58
58
|
type CoreColumnDef,
|
|
59
59
|
ErrorValue,
|
|
60
|
-
} from "./domainTypes/CoreTableTypes.
|
|
60
|
+
} from "./domainTypes/CoreTableTypes.ts"
|
|
61
61
|
|
|
62
62
|
// Grapher types
|
|
63
63
|
export {
|
|
@@ -69,7 +69,7 @@ export {
|
|
|
69
69
|
GRAPHER_TAB_CONFIG_OPTIONS,
|
|
70
70
|
GRAPHER_TAB_QUERY_PARAMS,
|
|
71
71
|
ALL_GRAPHER_CHART_TYPES,
|
|
72
|
-
} from "./grapherTypes/GrapherConstants.
|
|
72
|
+
} from "./grapherTypes/GrapherConstants.ts"
|
|
73
73
|
|
|
74
74
|
export {
|
|
75
75
|
type Box,
|
|
@@ -140,7 +140,7 @@ export {
|
|
|
140
140
|
type ToleranceOptions,
|
|
141
141
|
type AdditionalGrapherDataFetchFn,
|
|
142
142
|
type GrapherTrendArrowDirection,
|
|
143
|
-
} from "./grapherTypes/GrapherTypes.
|
|
143
|
+
} from "./grapherTypes/GrapherTypes.ts"
|
|
144
144
|
|
|
145
145
|
export {
|
|
146
146
|
logBinningStrategies,
|
|
@@ -154,7 +154,7 @@ export {
|
|
|
154
154
|
type AutomaticBinningStrategy,
|
|
155
155
|
type ResolvedBinningStrategy,
|
|
156
156
|
type MidpointMode,
|
|
157
|
-
} from "./grapherTypes/BinningStrategyTypes.
|
|
157
|
+
} from "./grapherTypes/BinningStrategyTypes.ts"
|
|
158
158
|
|
|
159
159
|
// Variable types
|
|
160
160
|
export {
|
|
@@ -176,10 +176,10 @@ export {
|
|
|
176
176
|
type IndicatorTitleWithFragments,
|
|
177
177
|
joinTitleFragments,
|
|
178
178
|
type VariableType,
|
|
179
|
-
} from "./Variable.
|
|
179
|
+
} from "./Variable.ts"
|
|
180
180
|
|
|
181
|
-
export type { Source } from "./Source.
|
|
182
|
-
export type { Origin } from "./Origin.
|
|
181
|
+
export type { Source } from "./Source.ts"
|
|
182
|
+
export type { Origin } from "./Origin.ts"
|
|
183
183
|
|
|
184
184
|
export {
|
|
185
185
|
type VariableDisplayConfigInterface,
|
|
@@ -187,9 +187,9 @@ export {
|
|
|
187
187
|
VariableRoundingMode,
|
|
188
188
|
type ChartDimensionInterface,
|
|
189
189
|
type ChartDimensionInterfaceWithMandatorySlug,
|
|
190
|
-
} from "./VariableDisplayConfigInterface.
|
|
190
|
+
} from "./VariableDisplayConfigInterface.ts"
|
|
191
191
|
|
|
192
|
-
export { type Nominal, wrap, unwrap } from "./NominalType.
|
|
192
|
+
export { type Nominal, wrap, unwrap } from "./NominalType.ts"
|
|
193
193
|
|
|
194
194
|
// Archive types (needed for data loading)
|
|
195
195
|
export {
|
|
@@ -198,7 +198,7 @@ export {
|
|
|
198
198
|
type AssetMap,
|
|
199
199
|
type ArchiveContext,
|
|
200
200
|
type ArchivedPageVersion,
|
|
201
|
-
} from "./domainTypes/Archive.
|
|
201
|
+
} from "./domainTypes/Archive.ts"
|
|
202
202
|
|
|
203
203
|
// Gdoc types (stubs for type compatibility)
|
|
204
204
|
export {
|
|
@@ -229,10 +229,10 @@ export {
|
|
|
229
229
|
type EnrichedHybridLink,
|
|
230
230
|
type TocHeadingWithTitleSupertitle,
|
|
231
231
|
type DisplaySource,
|
|
232
|
-
} from "./gdocTypes/Gdoc.
|
|
232
|
+
} from "./gdocTypes/Gdoc.ts"
|
|
233
233
|
|
|
234
234
|
// Database types (stubs)
|
|
235
|
-
export { type DbPlainTag } from "./dbTypes/Tags.
|
|
235
|
+
export { type DbPlainTag } from "./dbTypes/Tags.ts"
|
|
236
236
|
|
|
237
237
|
// Constants for site sections
|
|
238
238
|
export const ALL_CHARTS_ID = "all-charts"
|
|
@@ -250,7 +250,7 @@ export {
|
|
|
250
250
|
GrapherErrorAction,
|
|
251
251
|
type GrapherAnalyticsContext,
|
|
252
252
|
type GAEvent,
|
|
253
|
-
} from "./analyticsTypes.
|
|
253
|
+
} from "./analyticsTypes.ts"
|
|
254
254
|
|
|
255
255
|
// Additional stub types
|
|
256
256
|
export type SubNavId = string
|
package/src/utils/Bounds.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as _ from "lodash-es"
|
|
2
|
-
import { PointVector } from "./PointVector.
|
|
2
|
+
import { PointVector } from "./PointVector.ts"
|
|
3
3
|
import pixelWidth from "string-pixel-width"
|
|
4
4
|
import {
|
|
5
5
|
Box,
|
|
6
6
|
GridParameters,
|
|
7
7
|
Position,
|
|
8
8
|
PositionMap,
|
|
9
|
-
} from "../types/index.
|
|
9
|
+
} from "../types/index.ts"
|
|
10
10
|
|
|
11
11
|
// Important utility class for all visualizations
|
|
12
12
|
// Since we want to be able to render charts headlessly and functionally, we
|
package/src/utils/FuzzySearch.ts
CHANGED
package/src/utils/TimeBounds.ts
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
TimeBound,
|
|
5
5
|
TimeBoundValue,
|
|
6
6
|
TimeBoundValueStr,
|
|
7
|
-
} from "../types/index.
|
|
7
|
+
} from "../types/index.ts"
|
|
8
8
|
import {
|
|
9
9
|
parseIntOrUndefined,
|
|
10
10
|
diffDateISOStringInDays,
|
|
11
11
|
formatDay,
|
|
12
12
|
isNegativeInfinity,
|
|
13
13
|
isPositiveInfinity,
|
|
14
|
-
} from "./Util.
|
|
14
|
+
} from "./Util.ts"
|
|
15
15
|
import * as R from "remeda"
|
|
16
16
|
|
|
17
17
|
export const timeFromTimebounds = (
|
package/src/utils/Util.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as _ from "lodash-es"
|
|
5
5
|
import * as R from "remeda"
|
|
6
6
|
import { extent } from "d3-array"
|
|
7
|
-
import dayjs from "./dayjs.
|
|
7
|
+
import dayjs from "./dayjs.ts"
|
|
8
8
|
import { formatLocale, FormatLocaleObject } from "d3-format"
|
|
9
9
|
import striptags from "striptags"
|
|
10
10
|
import {
|
|
@@ -49,8 +49,8 @@ import {
|
|
|
49
49
|
FEATURED_DATA_INSIGHTS_ID,
|
|
50
50
|
EXPLORE_DATA_SECTION_DEFAULT_TITLE,
|
|
51
51
|
EXPLORE_DATA_SECTION_ID,
|
|
52
|
-
} from "../types/index.
|
|
53
|
-
import { PointVector } from "./PointVector.
|
|
52
|
+
} from "../types/index.ts"
|
|
53
|
+
import { PointVector } from "./PointVector.ts"
|
|
54
54
|
import * as React from "react"
|
|
55
55
|
import { match, P } from "ts-pattern"
|
|
56
56
|
import urlSlug from "url-slug"
|
package/src/utils/Variable.ts
CHANGED
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
updatePersistables,
|
|
7
7
|
objectWithPersistablesToObject,
|
|
8
8
|
deleteRuntimeAndUnchangedProps,
|
|
9
|
-
} from "./persistable/Persistable.
|
|
9
|
+
} from "./persistable/Persistable.ts"
|
|
10
10
|
import {
|
|
11
11
|
VariableDataTableConfigInterface,
|
|
12
12
|
VariableDisplayConfigInterface,
|
|
13
13
|
VariableRoundingMode,
|
|
14
|
-
} from "../types/index.
|
|
14
|
+
} from "../types/index.ts"
|
|
15
15
|
|
|
16
16
|
class VariableDisplayConfigDefaults {
|
|
17
17
|
name: string | undefined = undefined
|
package/src/utils/formatValue.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FormatSpecifier } from "d3-format"
|
|
2
|
-
import { createFormatter } from "./Util.
|
|
2
|
+
import { createFormatter } from "./Util.ts"
|
|
3
3
|
import {
|
|
4
4
|
VariableRoundingMode,
|
|
5
5
|
TickFormattingOptions,
|
|
6
|
-
} from "../types/index.
|
|
6
|
+
} from "../types/index.ts"
|
|
7
7
|
|
|
8
8
|
// Used outside this module to figure out if the unit will be joined with the number.
|
|
9
9
|
export function checkIsVeryShortUnit(unit: string): unit is "$" | "£" | "%" {
|
package/src/utils/image.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Common utlities for deriving properties from image metadata.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { traverseEnrichedBlock } from "./Util.
|
|
6
|
+
import { traverseEnrichedBlock } from "./Util.ts"
|
|
7
7
|
import {
|
|
8
8
|
AssetMap,
|
|
9
9
|
Gdoc,
|
|
10
10
|
GdocType,
|
|
11
11
|
ImageMetadata,
|
|
12
|
-
} from "../types/index.
|
|
12
|
+
} from "../types/index.ts"
|
|
13
13
|
import { match, P } from "ts-pattern"
|
|
14
14
|
|
|
15
15
|
export const AUTHOR_BYLINE_WIDTH = 48
|
package/src/utils/index.ts
CHANGED
|
@@ -8,13 +8,13 @@ export {
|
|
|
8
8
|
type SplitBoundsPadding,
|
|
9
9
|
FontFamily,
|
|
10
10
|
Bounds,
|
|
11
|
-
} from "./Bounds.
|
|
11
|
+
} from "./Bounds.ts"
|
|
12
12
|
|
|
13
13
|
// Browser utilities
|
|
14
|
-
export { isAndroid, isIOS } from "./BrowserUtils.
|
|
14
|
+
export { isAndroid, isIOS } from "./BrowserUtils.ts"
|
|
15
15
|
|
|
16
16
|
// Dayjs
|
|
17
|
-
import dayjs from "./dayjs.
|
|
17
|
+
import dayjs from "./dayjs.ts"
|
|
18
18
|
export { dayjs }
|
|
19
19
|
export type {
|
|
20
20
|
Dayjs,
|
|
@@ -23,19 +23,19 @@ export type {
|
|
|
23
23
|
isYesterdayType,
|
|
24
24
|
relativeTimeType,
|
|
25
25
|
utcType,
|
|
26
|
-
} from "./dayjs.
|
|
26
|
+
} from "./dayjs.ts"
|
|
27
27
|
|
|
28
28
|
// Format value
|
|
29
|
-
export { formatValue, checkIsVeryShortUnit } from "./formatValue.
|
|
29
|
+
export { formatValue, checkIsVeryShortUnit } from "./formatValue.ts"
|
|
30
30
|
|
|
31
31
|
// Fuzzy search
|
|
32
|
-
export { FuzzySearch, type FuzzySearchResult } from "./FuzzySearch.
|
|
32
|
+
export { FuzzySearch, type FuzzySearchResult } from "./FuzzySearch.ts"
|
|
33
33
|
|
|
34
34
|
// Grapher config utilities
|
|
35
35
|
export {
|
|
36
36
|
diffGrapherConfigs,
|
|
37
37
|
mergeGrapherConfigs,
|
|
38
|
-
} from "./grapherConfigUtils.
|
|
38
|
+
} from "./grapherConfigUtils.ts"
|
|
39
39
|
|
|
40
40
|
// Image utilities
|
|
41
41
|
export {
|
|
@@ -52,10 +52,10 @@ export {
|
|
|
52
52
|
type SourceProps,
|
|
53
53
|
generateSourceProps,
|
|
54
54
|
getFeaturedImageFilename,
|
|
55
|
-
} from "./image.
|
|
55
|
+
} from "./image.ts"
|
|
56
56
|
|
|
57
57
|
// isPresent utility
|
|
58
|
-
export { isPresent } from "./isPresent.
|
|
58
|
+
export { isPresent } from "./isPresent.ts"
|
|
59
59
|
|
|
60
60
|
// Metadata helpers
|
|
61
61
|
export {
|
|
@@ -74,10 +74,10 @@ export {
|
|
|
74
74
|
getCitationLong,
|
|
75
75
|
getCitationShort,
|
|
76
76
|
getPhraseForArchivalDate,
|
|
77
|
-
} from "./metadataHelpers.
|
|
77
|
+
} from "./metadataHelpers.ts"
|
|
78
78
|
|
|
79
79
|
// Variable display config
|
|
80
|
-
export { VariableDisplayConfig } from "./Variable.
|
|
80
|
+
export { VariableDisplayConfig } from "./Variable.ts"
|
|
81
81
|
|
|
82
82
|
// Persistable
|
|
83
83
|
export {
|
|
@@ -85,16 +85,16 @@ export {
|
|
|
85
85
|
objectWithPersistablesToObject,
|
|
86
86
|
updatePersistables,
|
|
87
87
|
deleteRuntimeAndUnchangedProps,
|
|
88
|
-
} from "./persistable/Persistable.
|
|
88
|
+
} from "./persistable/Persistable.ts"
|
|
89
89
|
|
|
90
90
|
// PointVector
|
|
91
|
-
export { PointVector } from "./PointVector.
|
|
91
|
+
export { PointVector } from "./PointVector.ts"
|
|
92
92
|
|
|
93
93
|
// PromiseCache
|
|
94
|
-
export { PromiseCache } from "./PromiseCache.
|
|
94
|
+
export { PromiseCache } from "./PromiseCache.ts"
|
|
95
95
|
|
|
96
96
|
// PromiseSwitcher
|
|
97
|
-
export { PromiseSwitcher } from "./PromiseSwitcher.
|
|
97
|
+
export { PromiseSwitcher } from "./PromiseSwitcher.ts"
|
|
98
98
|
|
|
99
99
|
// Regions
|
|
100
100
|
export {
|
|
@@ -133,10 +133,10 @@ export {
|
|
|
133
133
|
getParentRegions,
|
|
134
134
|
getSiblingRegions,
|
|
135
135
|
articulateEntity,
|
|
136
|
-
} from "./regions.
|
|
136
|
+
} from "./regions.ts"
|
|
137
137
|
|
|
138
138
|
// Serializers
|
|
139
|
-
export { serializeJSONForHTML, deserializeJSONFromHTML } from "./serializers.
|
|
139
|
+
export { serializeJSONForHTML, deserializeJSONFromHTML } from "./serializers.ts"
|
|
140
140
|
|
|
141
141
|
// String utilities
|
|
142
142
|
export {
|
|
@@ -144,7 +144,7 @@ export {
|
|
|
144
144
|
titleCase,
|
|
145
145
|
toAsciiQuotes,
|
|
146
146
|
removeDiacritics,
|
|
147
|
-
} from "./string.
|
|
147
|
+
} from "./string.ts"
|
|
148
148
|
|
|
149
149
|
// TimeBounds
|
|
150
150
|
export {
|
|
@@ -155,10 +155,10 @@ export {
|
|
|
155
155
|
maxTimeToJSON,
|
|
156
156
|
timeBoundToTimeBoundString,
|
|
157
157
|
getTimeDomainFromQueryString,
|
|
158
|
-
} from "./TimeBounds.
|
|
158
|
+
} from "./TimeBounds.ts"
|
|
159
159
|
|
|
160
160
|
// Tippy tooltip component
|
|
161
|
-
export { Tippy, TippyIfInteractive, LazyTippy } from "./Tippy.
|
|
161
|
+
export { Tippy, TippyIfInteractive, LazyTippy } from "./Tippy.tsx"
|
|
162
162
|
|
|
163
163
|
// URL utilities
|
|
164
164
|
export {
|
|
@@ -166,11 +166,11 @@ export {
|
|
|
166
166
|
queryParamsToStr,
|
|
167
167
|
getWindowQueryStr,
|
|
168
168
|
setWindowQueryStr,
|
|
169
|
-
} from "./urls/UrlUtils.
|
|
169
|
+
} from "./urls/UrlUtils.ts"
|
|
170
170
|
|
|
171
|
-
export { Url, setWindowUrl, getWindowUrl } from "./urls/Url.
|
|
171
|
+
export { Url, setWindowUrl, getWindowUrl } from "./urls/Url.ts"
|
|
172
172
|
|
|
173
|
-
export { type UrlMigration, performUrlMigrations } from "./urls/UrlMigration.
|
|
173
|
+
export { type UrlMigration, performUrlMigrations } from "./urls/UrlMigration.ts"
|
|
174
174
|
|
|
175
175
|
// Main utility exports (from Util.ts)
|
|
176
176
|
export {
|
|
@@ -294,7 +294,7 @@ export {
|
|
|
294
294
|
getDisplayUnit,
|
|
295
295
|
stripOuterParentheses,
|
|
296
296
|
dimensionsToViewId,
|
|
297
|
-
} from "./Util.
|
|
297
|
+
} from "./Util.ts"
|
|
298
298
|
|
|
299
299
|
// Archival date utilities
|
|
300
300
|
export {
|
|
@@ -304,15 +304,15 @@ export {
|
|
|
304
304
|
formatAsArchivalDate,
|
|
305
305
|
convertToArchivalDateStringIfNecessary,
|
|
306
306
|
getDateForArchival,
|
|
307
|
-
} from "./archival/archivalDate.
|
|
307
|
+
} from "./archival/archivalDate.ts"
|
|
308
308
|
|
|
309
309
|
// Multi-dimensional data page config (stub)
|
|
310
310
|
export {
|
|
311
311
|
MultiDimDataPageConfig,
|
|
312
312
|
extractMultiDimChoicesFromSearchParams,
|
|
313
313
|
searchParamsToMultiDimView,
|
|
314
|
-
} from "./MultiDimDataPageConfig.
|
|
314
|
+
} from "./MultiDimDataPageConfig.ts"
|
|
315
315
|
|
|
316
316
|
// Re-export all types from the types package for convenience
|
|
317
317
|
// This matches the pattern in @ourworldindata/utils
|
|
318
|
-
export * from "../types/index.
|
|
318
|
+
export * from "../types/index.ts"
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
DisplaySource,
|
|
8
8
|
IndicatorTitleWithFragments,
|
|
9
9
|
Source,
|
|
10
|
-
} from "../types/index.
|
|
10
|
+
} from "../types/index.ts"
|
|
11
11
|
import * as _ from "lodash-es"
|
|
12
12
|
import { excludeUndefined } from "./Util"
|
|
13
|
-
import dayjs from "./dayjs.
|
|
14
|
-
import { parseArchivalDate } from "./archival/archivalDate.
|
|
13
|
+
import dayjs from "./dayjs.ts"
|
|
14
|
+
import { parseArchivalDate } from "./archival/archivalDate.ts"
|
|
15
15
|
|
|
16
16
|
export function getOriginAttributionFragments(
|
|
17
17
|
origins: Origin[] | undefined
|
package/src/utils/regions.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _ from "lodash-es"
|
|
2
2
|
import entities from "./regions.json"
|
|
3
|
-
import { lazy } from "./Util.
|
|
4
|
-
import { EntityName } from "../types/index.
|
|
3
|
+
import { lazy } from "./Util.ts"
|
|
4
|
+
import { EntityName } from "../types/index.ts"
|
|
5
5
|
|
|
6
6
|
export enum RegionType {
|
|
7
7
|
Country = "country",
|
package/src/utils/urls/Url.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import urlParseLib from "url-parse"
|
|
2
|
-
import { gdocUrlRegex, QueryParams } from "../../types/index.
|
|
2
|
+
import { gdocUrlRegex, QueryParams } from "../../types/index.ts"
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
detailOnDemandRegex,
|
|
6
6
|
guidedChartRegex,
|
|
7
7
|
excludeUndefined,
|
|
8
8
|
omitUndefinedValues,
|
|
9
|
-
} from "../Util.
|
|
9
|
+
} from "../Util.ts"
|
|
10
10
|
|
|
11
|
-
import { queryParamsToStr, strToQueryParams } from "./UrlUtils.
|
|
11
|
+
import { queryParamsToStr, strToQueryParams } from "./UrlUtils.ts"
|
|
12
12
|
import * as R from "remeda"
|
|
13
13
|
|
|
14
14
|
const parseUrl = (url: string): urlParseLib<string> => urlParseLib(url, {})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QueryParams } from "../../types/index.
|
|
2
|
-
import { omitUndefinedValues } from "../Util.
|
|
1
|
+
import { QueryParams } from "../../types/index.ts"
|
|
2
|
+
import { omitUndefinedValues } from "../Util.ts"
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Converts a query string into an object of key-value pairs.
|