@statisticsfinland/pxvisualizer 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.
- package/LICENSE.md +202 -0
- package/README.md +77 -0
- package/dist/pxv.cjs +2 -0
- package/dist/pxv.cjs.map +1 -0
- package/dist/pxv.modern.js +165 -0
- package/dist/pxv.modern.js.map +1 -0
- package/dist/pxv.module.js +2 -0
- package/dist/pxv.module.js.map +1 -0
- package/dist/pxv.umd.js +2 -0
- package/dist/pxv.umd.js.map +1 -0
- package/dist/types/core/chartOptions/Utility/formatters.d.ts +14 -0
- package/dist/types/core/chartOptions/Utility/ordinalIntervals.d.ts +3 -0
- package/dist/types/core/chartOptions/Utility/seriesDataBuilder.d.ts +15 -0
- package/dist/types/core/chartOptions/Utility/tickPositionerUtilities.d.ts +9 -0
- package/dist/types/core/chartOptions/Utility/tickPositioners.d.ts +7 -0
- package/dist/types/core/chartOptions/Utility/timeIntervals.d.ts +5 -0
- package/dist/types/core/chartOptions/basicHorizontalBarchartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/basicVerticalBarChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/groupHorizontalBarChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/groupVerticalBarChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/lineChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/percentHorizontalBarChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/percentVerticalBarChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/pieChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/pyramidChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/scatterPlotOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/stackedHorizontalBarChartOptions.d.ts +3 -0
- package/dist/types/core/chartOptions/stackedVerticalBarChartOptions.d.ts +3 -0
- package/dist/types/core/conversion/helpers.d.ts +7 -0
- package/dist/types/core/conversion/index.d.ts +4 -0
- package/dist/types/core/conversion/pxGrafDataConverter.d.ts +3 -0
- package/dist/types/core/conversion/translations/defaultTranslations.d.ts +3 -0
- package/dist/types/core/conversion/translations/index.d.ts +7 -0
- package/dist/types/core/conversion/translations/translationManager.d.ts +8 -0
- package/dist/types/core/conversion/utilityFunctions.d.ts +5 -0
- package/dist/types/core/conversion/viewSorting.d.ts +10 -0
- package/dist/types/core/conversion/viewUtils.d.ts +10 -0
- package/dist/types/core/highcharts/drawChart.d.ts +4 -0
- package/dist/types/core/highcharts/index.d.ts +2 -0
- package/dist/types/core/highcharts/themes.d.ts +1 -0
- package/dist/types/core/index.d.ts +4 -0
- package/dist/types/core/tables/csvTable.d.ts +6 -0
- package/dist/types/core/tables/exportingUtils.d.ts +6 -0
- package/dist/types/core/tables/htmlTable.d.ts +3 -0
- package/dist/types/core/tables/index.d.ts +5 -0
- package/dist/types/core/tables/tableUtils.d.ts +3 -0
- package/dist/types/core/tables/xlsxTable.d.ts +7 -0
- package/dist/types/core/types/icon.d.ts +2 -0
- package/dist/types/core/types/index.d.ts +1 -0
- package/dist/types/core/types/queryVisualizationResponse.d.ts +96 -0
- package/dist/types/core/types/view.d.ts +40 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/react/components/ErrorBoundary/ErrorBoundary.d.ts +17 -0
- package/dist/types/react/components/burgerMenu/burgerMenu.d.ts +36 -0
- package/dist/types/react/components/burgerMenu/menuItem/menuItem.d.ts +17 -0
- package/dist/types/react/components/chart/ErrorInfo.d.ts +5 -0
- package/dist/types/react/components/chart/chart.d.ts +19 -0
- package/dist/types/react/components/chart/index.d.ts +1 -0
- package/dist/types/react/components/chart/tableView.d.ts +11 -0
- package/dist/types/react/components/globalStyle/globalStyle.d.ts +2 -0
- package/dist/types/react/components/globalStyle/index.d.ts +1 -0
- package/dist/types/react/components/icon/icon.d.ts +8 -0
- package/dist/types/react/components/index.d.ts +1 -0
- package/dist/types/react/index.d.ts +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AxisLabelsFormatterCallbackFunction, DataLabelsFormatterCallbackFunction, FormatterCallbackFunction, Point, ScreenReaderFormatterCallbackFunction, Series, TooltipFormatterCallbackFunction } from "highcharts";
|
|
2
|
+
import { IUnitInfo, View } from "../../types/view";
|
|
3
|
+
export declare function getToolTipFormatterFunction(view: View, locale: string): TooltipFormatterCallbackFunction;
|
|
4
|
+
export declare function getScreenReaderFormatterCallbackFunction(view: View, locale: string): ScreenReaderFormatterCallbackFunction<Point>;
|
|
5
|
+
export declare function getAxisLabelFormatterFunction(locale: string): AxisLabelsFormatterCallbackFunction;
|
|
6
|
+
export declare const formatLocale: (locale: string) => string;
|
|
7
|
+
export declare function getAxisLabelShorteningFunction(valueAmount?: number | null): AxisLabelsFormatterCallbackFunction;
|
|
8
|
+
export declare function getDataLabelShorteningFunction(showData: boolean): DataLabelsFormatterCallbackFunction;
|
|
9
|
+
export declare function getLegendLabelShorteningFunction(): FormatterCallbackFunction<Series | Point>;
|
|
10
|
+
export declare const shortenStringValue: (value: string | number, limit?: number) => string;
|
|
11
|
+
export declare function getScatterPlotScreenReaderFormatterCallbackFunction(view: View, locale: string): ScreenReaderFormatterCallbackFunction<Point>;
|
|
12
|
+
export declare function getScatterPlotTooltipFormatterFunction(view: View, locale: string): TooltipFormatterCallbackFunction;
|
|
13
|
+
export declare function getFormattedUnits(unitInfos: IUnitInfo[], locale: string): string;
|
|
14
|
+
export declare function parseScreenReaderFriendlyTimePeriods(value: string, locale: string): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { View } from "../../types/view";
|
|
2
|
+
export type SeriesType = 'bar' | 'column' | 'line';
|
|
3
|
+
export declare const buildHighchartSeries: (view: View, type: SeriesType, locale: string, reverseOrder?: boolean) => {
|
|
4
|
+
index: number;
|
|
5
|
+
animation: boolean;
|
|
6
|
+
type: SeriesType;
|
|
7
|
+
name: string;
|
|
8
|
+
data: {
|
|
9
|
+
y: number | null;
|
|
10
|
+
name: string;
|
|
11
|
+
custom: {
|
|
12
|
+
preliminary: boolean;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Decimal from 'decimal.js';
|
|
2
|
+
export declare function buildLinearAxisTickPositioner(dataMin: Decimal, dataMax: Decimal, precision: Decimal): (this: {
|
|
3
|
+
chart: {
|
|
4
|
+
plotWidth: number;
|
|
5
|
+
};
|
|
6
|
+
}) => number[];
|
|
7
|
+
export declare function getInterval(dataMinValue: Decimal, dataMaxValue: Decimal, maxNumberOfSegments: number, precision?: Decimal): Decimal;
|
|
8
|
+
export declare function linearAxisIntervalStepFunction(segmentDelta: Decimal): Decimal;
|
|
9
|
+
export declare function getDivisibilityScore(input: Decimal): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Axis, AxisTickPositionsArray } from "highcharts";
|
|
2
|
+
import { IDataCell } from "../../types/view";
|
|
3
|
+
export declare function getQuarterlySeriesTickPositionerFunction(seriesLength: number, timeSeriesStartingPoint: Date): (this: Axis) => AxisTickPositionsArray;
|
|
4
|
+
export declare function getBiannualSeriesTickPositionerFunction(seriesLength: number, timeSeriesStartingPoint: Date): (this: Axis) => AxisTickPositionsArray;
|
|
5
|
+
export declare function getLinearAxisTickPositionerFunction(series: IDataCell[][]): (this: Axis) => AxisTickPositionsArray;
|
|
6
|
+
export declare function getLinearSumAxisTickPositionerFunction(series: IDataCell[][]): (this: Axis) => AxisTickPositionsArray;
|
|
7
|
+
export declare function getOrdinalAxisTickPositionerFunction(seriesLength: number, maxLabelLen: number): (this: Axis) => AxisTickPositionsArray;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ETimeVariableInterval } from "../../types/queryVisualizationResponse";
|
|
2
|
+
import { PlotSeriesOptions, XAxisOptions } from "highcharts";
|
|
3
|
+
import { View } from "../../types/view";
|
|
4
|
+
export declare function getTimeSeriesOptions(interval: ETimeVariableInterval, startingPoint: string | null | undefined): PlotSeriesOptions | undefined;
|
|
5
|
+
export declare function getXAxisOptions(view: View, locale: string): XAxisOptions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IVariableMeta } from "../types/queryVisualizationResponse";
|
|
2
|
+
import { TVariableSelections } from "../types/variableSelections";
|
|
3
|
+
type TNullableVariableSelections = TVariableSelections | null | undefined;
|
|
4
|
+
export declare const extractSelectableVariableValues: (selectableVariableCodes: string[], metaData: IVariableMeta[], defaultSelectableVariableCodes: TNullableVariableSelections, selectedValueCodes: TNullableVariableSelections) => {
|
|
5
|
+
[key: string]: string[];
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TTranslations, TArrayTranslations, TTranslationPackage } from './translationTypes';
|
|
2
|
+
export { TTranslationPackage } from './translationTypes';
|
|
3
|
+
export declare const Translations: TTranslations;
|
|
4
|
+
export declare const ArrayTranslations: TArrayTranslations;
|
|
5
|
+
export declare const GetAllLanguages: () => string[];
|
|
6
|
+
export declare function AddTranslations(newTranslations: TTranslationPackage): void;
|
|
7
|
+
export default Translations;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TTranslations, TArrayTranslations, TTranslationPackage } from './translationTypes';
|
|
2
|
+
export declare class TranslationManager {
|
|
3
|
+
Translations: TTranslations;
|
|
4
|
+
ArrayTranslations: TArrayTranslations;
|
|
5
|
+
constructor();
|
|
6
|
+
GetAllLanguages: () => string[];
|
|
7
|
+
AddTranslations(newTranslations: TTranslationPackage): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const cartesianProduct: <T>(allEntries: T[][]) => T[][];
|
|
2
|
+
type TNestedScalarArray = TNestedScalarArray[] | string[] | number[];
|
|
3
|
+
export declare const compareScalarArrays: (a: TNestedScalarArray, b: TNestedScalarArray) => boolean;
|
|
4
|
+
export declare function onlyUnique<T>(value: T, index: number, array: T[]): boolean;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDataCell, View } from "../types/view";
|
|
2
|
+
export declare const ASCENDING = "ascending";
|
|
3
|
+
export declare const DESCENDING = "descending";
|
|
4
|
+
export declare const SUM = "sum";
|
|
5
|
+
export declare const NO_SORTING = "no_sorting";
|
|
6
|
+
export declare const ASCENDING_SORTING_FUNC: (a: IDataCell, b: IDataCell) => number;
|
|
7
|
+
export declare const DESCENDING_SORTING_FUNC: (a: IDataCell, b: IDataCell) => number;
|
|
8
|
+
export declare function sortViewBasedOnSeries(view: View, referenceSeriesIndex: number, sortingFunc: (a: IDataCell, b: IDataCell) => number): View;
|
|
9
|
+
export declare function sortViewBasedOnSeriesRelative(originalWiew: View, relativeView: View, referenceSeriesIndex: number, sortingFunc: (a: IDataCell, b: IDataCell) => number): View;
|
|
10
|
+
export declare function sortViewBasedOnSum(view: View, sortingFunc: (a: IDataCell, b: IDataCell) => number): View;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IQueryVisualizationResponse } from "../types";
|
|
2
|
+
import { TMultiLanguageString } from "../types/queryVisualizationResponse";
|
|
3
|
+
import { IDataSeries, TSingleSelections, View } from "../types/view";
|
|
4
|
+
import { TVariableSelections } from "../types/variableSelections";
|
|
5
|
+
export declare function convertPxGrafResponseToView(responseObj: IQueryVisualizationResponse, selectedValueCodes: TVariableSelections): View;
|
|
6
|
+
export declare function convertToRelative(input: View): View;
|
|
7
|
+
export declare function buildSeries(responseObj: IQueryVisualizationResponse, selectedValueCodes: TSingleSelections): {
|
|
8
|
+
columnNameGroups: TMultiLanguageString[][];
|
|
9
|
+
series: IDataSeries[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as Highcharts from "highcharts";
|
|
2
|
+
import { IQueryVisualizationResponse } from "../types";
|
|
3
|
+
import { TVariableSelections } from "../types/variableSelections";
|
|
4
|
+
export declare const drawChart: (container: string, pxGraphData: IQueryVisualizationResponse, locale: string, selectedValueCodes?: TVariableSelections | null) => Highcharts.Chart;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultTheme: (locale: string) => Highcharts.Options;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { View } from "../types/view";
|
|
2
|
+
export declare function renderHtmlTable(view: View, locale: string, showTitles: boolean, showUnits: boolean, showSources: boolean, containerId: string, footnote?: string): void;
|
|
3
|
+
export declare function generateTable(view: View, locale: string): HTMLTableElement;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IDataCell } from "../types/view";
|
|
2
|
+
export declare function formatNumericValue(dataCell: IDataCell, locale: string, addThousandSeparator?: boolean): string;
|
|
3
|
+
export declare function formatMissingData(missingCode: number | undefined, locale: string, htmlTable?: boolean): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { View } from "../types/view";
|
|
2
|
+
export declare const generateExcel: (view: View, locale: string) => any;
|
|
3
|
+
export declare const buildStringTableForExcel: (view: View, locale: string) => (string | null)[][];
|
|
4
|
+
export declare const viewToDownloadXLSOption: (view: View, locale: string) => {
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IQueryVisualizationResponse, EVisualizationType, TVisualizationType, ETimeVariableInterval, TTimeVariableInterval, EVariableType, TVariableType } from './queryVisualizationResponse';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export interface IQueryVisualizationResponse {
|
|
2
|
+
tableReference: ITableReference;
|
|
3
|
+
data: (number | null)[];
|
|
4
|
+
dataNotes: {
|
|
5
|
+
[key: number]: TMultiLanguageString;
|
|
6
|
+
};
|
|
7
|
+
missingDataInfo: {
|
|
8
|
+
[key: number]: number;
|
|
9
|
+
};
|
|
10
|
+
metaData: IVariableMeta[];
|
|
11
|
+
selectableVariableCodes: string[];
|
|
12
|
+
rowVariableCodes: string[];
|
|
13
|
+
columnVariableCodes: string[];
|
|
14
|
+
header: TMultiLanguageString;
|
|
15
|
+
visualizationSettings: IVisualizationSettings;
|
|
16
|
+
}
|
|
17
|
+
export interface ITableReference {
|
|
18
|
+
name: string;
|
|
19
|
+
hierarchy: string[];
|
|
20
|
+
}
|
|
21
|
+
export type TVisualizationType = 'VerticalBarChart' | 'GroupVerticalBarChart' | 'StackedVerticalBarChart' | 'PercentVerticalBarChart' | 'HorizontalBarChart' | 'GroupHorizontalBarChart' | 'StackedHorizontalBarChart' | 'PercentHorizontalBarChart' | 'PyramidChart' | 'PieChart' | 'LineChart' | 'ScatterPlot' | 'Table';
|
|
22
|
+
export declare enum EVisualizationType {
|
|
23
|
+
VerticalBarChart = "VerticalBarChart",
|
|
24
|
+
GroupVerticalBarChart = "GroupVerticalBarChart",
|
|
25
|
+
StackedVerticalBarChart = "StackedVerticalBarChart",
|
|
26
|
+
PercentVerticalBarChart = "PercentVerticalBarChart",
|
|
27
|
+
HorizontalBarChart = "HorizontalBarChart",
|
|
28
|
+
GroupHorizontalBarChart = "GroupHorizontalBarChart",
|
|
29
|
+
StackedHorizontalBarChart = "StackedHorizontalBarChart",
|
|
30
|
+
PercentHorizontalBarChart = "PercentHorizontalBarChart",
|
|
31
|
+
PyramidChart = "PyramidChart",
|
|
32
|
+
PieChart = "PieChart",
|
|
33
|
+
LineChart = "LineChart",
|
|
34
|
+
ScatterPlot = "ScatterPlot",
|
|
35
|
+
Table = "Table"
|
|
36
|
+
}
|
|
37
|
+
export type TVariableType = 'N' | 'T' | 'P' | 'G' | 'C' | 'F';
|
|
38
|
+
export declare enum EVariableType {
|
|
39
|
+
Unknown = "N",
|
|
40
|
+
Time = "T",
|
|
41
|
+
Ordinal = "P",
|
|
42
|
+
Geological = "G",
|
|
43
|
+
Content = "C",
|
|
44
|
+
OtherClassificatory = "F"
|
|
45
|
+
}
|
|
46
|
+
export type TTimeVariableInterval = 'Week' | 'Month' | 'Quarter' | 'HalfYear' | 'Year' | 'Decade' | 'Irregular';
|
|
47
|
+
export declare enum ETimeVariableInterval {
|
|
48
|
+
Week = "Week",
|
|
49
|
+
Month = "Month",
|
|
50
|
+
Quarter = "Quarter",
|
|
51
|
+
HalfYear = "HalfYear",
|
|
52
|
+
Year = "Year",
|
|
53
|
+
Decade = "Decade",
|
|
54
|
+
Irregular = "Irregular"
|
|
55
|
+
}
|
|
56
|
+
export type TMultiLanguageString = {
|
|
57
|
+
[key: string]: string;
|
|
58
|
+
};
|
|
59
|
+
export type TMultiLanguageStringArray = {
|
|
60
|
+
[key: string]: string[];
|
|
61
|
+
};
|
|
62
|
+
export interface IVariableMeta {
|
|
63
|
+
code: string;
|
|
64
|
+
name: TMultiLanguageString;
|
|
65
|
+
note: TMultiLanguageString | null;
|
|
66
|
+
type: EVariableType;
|
|
67
|
+
values: IVariableValueMeta[];
|
|
68
|
+
}
|
|
69
|
+
export interface IContentComponent {
|
|
70
|
+
unit: TMultiLanguageString;
|
|
71
|
+
source: TMultiLanguageString;
|
|
72
|
+
numberOfDecimals: number;
|
|
73
|
+
lastUpdated: string;
|
|
74
|
+
}
|
|
75
|
+
export interface IVariableValueMeta {
|
|
76
|
+
code: string;
|
|
77
|
+
name: TMultiLanguageString;
|
|
78
|
+
note: TMultiLanguageString | null;
|
|
79
|
+
isSum: boolean;
|
|
80
|
+
contentComponent: IContentComponent | null;
|
|
81
|
+
}
|
|
82
|
+
export interface IVisualizationSettings {
|
|
83
|
+
visualizationType: EVisualizationType;
|
|
84
|
+
defaultSelectableVariableCodes?: {
|
|
85
|
+
[key: string]: string[];
|
|
86
|
+
} | null;
|
|
87
|
+
multiselectableVariableCode?: string;
|
|
88
|
+
timeVariableIntervals: ETimeVariableInterval;
|
|
89
|
+
timeSeriesStartingPoint?: string;
|
|
90
|
+
cutValueAxis?: boolean;
|
|
91
|
+
showLastLabel?: boolean;
|
|
92
|
+
sorting?: string;
|
|
93
|
+
markerSize?: number;
|
|
94
|
+
cutYAxis?: boolean;
|
|
95
|
+
showDataPoints?: boolean;
|
|
96
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IVisualizationSettings, TMultiLanguageString } from "./queryVisualizationResponse";
|
|
2
|
+
export declare enum ESeriesType {
|
|
3
|
+
Time = 0,
|
|
4
|
+
Ordinal = 1,
|
|
5
|
+
Nominal = 2
|
|
6
|
+
}
|
|
7
|
+
export interface IUnitInfo {
|
|
8
|
+
name: TMultiLanguageString;
|
|
9
|
+
unit: TMultiLanguageString;
|
|
10
|
+
}
|
|
11
|
+
export interface View {
|
|
12
|
+
tableReferenceName: string;
|
|
13
|
+
header: TMultiLanguageString;
|
|
14
|
+
subheaderValues: TMultiLanguageString[];
|
|
15
|
+
units: IUnitInfo[];
|
|
16
|
+
sources: TMultiLanguageString[];
|
|
17
|
+
columnNameGroups: TMultiLanguageString[][];
|
|
18
|
+
series: IDataSeries[];
|
|
19
|
+
colVarNames: TMultiLanguageString[];
|
|
20
|
+
rowVarNames: TMultiLanguageString[];
|
|
21
|
+
selectableVarNames: TMultiLanguageString[];
|
|
22
|
+
visualizationSettings: IVisualizationSettings;
|
|
23
|
+
seriesType: ESeriesType;
|
|
24
|
+
}
|
|
25
|
+
export interface IDataCell {
|
|
26
|
+
value: number | null;
|
|
27
|
+
missingCode?: number;
|
|
28
|
+
precision: number;
|
|
29
|
+
preliminary: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface IDataSeries {
|
|
32
|
+
rowNameGroup: TMultiLanguageString[];
|
|
33
|
+
series: IDataCell[];
|
|
34
|
+
}
|
|
35
|
+
export type TSingleSelections = {
|
|
36
|
+
[key: string]: string;
|
|
37
|
+
};
|
|
38
|
+
export type TValueSelectionAmounts = {
|
|
39
|
+
[key: string]: number;
|
|
40
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, ErrorInfo, ReactNode } from "react";
|
|
2
|
+
interface IErrorBoundaryState {
|
|
3
|
+
hasError: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface IErrorBoundaryProps {
|
|
6
|
+
fallback: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare class ErrorBoundary extends Component<IErrorBoundaryProps, IErrorBoundaryState> {
|
|
10
|
+
constructor(props: IErrorBoundaryProps);
|
|
11
|
+
static getDerivedStateFromError(): {
|
|
12
|
+
hasError: boolean;
|
|
13
|
+
};
|
|
14
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
15
|
+
render(): ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import HighchartsReact from "highcharts-react-official";
|
|
3
|
+
import { View } from "../../../core/types/view";
|
|
4
|
+
import { TIcon } from "../../../core/types/icon";
|
|
5
|
+
export interface IBurgerMenuProps {
|
|
6
|
+
viewData: View;
|
|
7
|
+
currentChartRef?: HighchartsReact.RefObject | null;
|
|
8
|
+
locale: string;
|
|
9
|
+
tableToggle?: {
|
|
10
|
+
toggleHandler: () => void;
|
|
11
|
+
tableMode: boolean;
|
|
12
|
+
};
|
|
13
|
+
menuItemDefinitions?: (IFunctionalMenuItem | ILinkMenuItem)[];
|
|
14
|
+
menuIconInheritColor?: boolean;
|
|
15
|
+
exportWidth?: number;
|
|
16
|
+
exportHeight?: number;
|
|
17
|
+
}
|
|
18
|
+
interface IBaseMenuItem {
|
|
19
|
+
text: string;
|
|
20
|
+
prefixIcon?: TIcon | Exclude<React.ReactNode, string>;
|
|
21
|
+
suffixIcon?: TIcon | Exclude<React.ReactNode, string>;
|
|
22
|
+
}
|
|
23
|
+
export interface IFunctionalMenuItem extends IBaseMenuItem {
|
|
24
|
+
onClick: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface ILinkMenuItem extends IBaseMenuItem {
|
|
27
|
+
url: string;
|
|
28
|
+
isExternal?: boolean;
|
|
29
|
+
openNewTab?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function calculateExportDimensions(inputWidth: number | undefined, inputHeight: number | undefined): {
|
|
32
|
+
finalWidth: number;
|
|
33
|
+
finalHeight: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const BurgerMenu: React.FC<IBurgerMenuProps>;
|
|
36
|
+
export default BurgerMenu;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TIcon } from "../../../../core/types/icon";
|
|
3
|
+
export interface IMenuItemProps {
|
|
4
|
+
text: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
url?: string;
|
|
7
|
+
openNewTab?: boolean;
|
|
8
|
+
isExternal?: boolean;
|
|
9
|
+
prefixIcon?: TIcon | Exclude<React.ReactNode, string>;
|
|
10
|
+
suffixIcon?: TIcon | Exclude<React.ReactNode, string>;
|
|
11
|
+
locale: string;
|
|
12
|
+
bottomSeparator?: boolean;
|
|
13
|
+
isFirst?: boolean;
|
|
14
|
+
isLast?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const MenuItem: React.FC<IMenuItemProps>;
|
|
17
|
+
export default MenuItem;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IQueryVisualizationResponse } from "../../../core";
|
|
3
|
+
import { IFunctionalMenuItem, ILinkMenuItem } from "../burgerMenu/burgerMenu";
|
|
4
|
+
export interface IChartProps {
|
|
5
|
+
pxGraphData: IQueryVisualizationResponse;
|
|
6
|
+
locale: string;
|
|
7
|
+
selectedVariableCodes?: {
|
|
8
|
+
[key: string]: string[];
|
|
9
|
+
};
|
|
10
|
+
showContextMenu?: boolean;
|
|
11
|
+
menuItemDefinitions?: (IFunctionalMenuItem | ILinkMenuItem)[];
|
|
12
|
+
menuIconInheritColor?: boolean;
|
|
13
|
+
showTableTitles?: boolean;
|
|
14
|
+
showTableUnits?: boolean;
|
|
15
|
+
showTableSources?: boolean;
|
|
16
|
+
footnote?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const Chart: React.FC<IChartProps>;
|
|
19
|
+
export default Chart;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './chart';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "../../../core/types/view";
|
|
3
|
+
export interface ITableViewProps {
|
|
4
|
+
view: View;
|
|
5
|
+
locale: string;
|
|
6
|
+
showTitles?: boolean;
|
|
7
|
+
showUnits?: boolean;
|
|
8
|
+
showSources?: boolean;
|
|
9
|
+
footnote?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const TableView: React.FC<ITableViewProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './globalStyle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Chart } from "./chart";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|