@statisticsfinland/pxvisualizer 1.0.9 → 1.1.0-d.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.
@@ -1,4 +1,4 @@
1
- import { AxisLabelsFormatterCallbackFunction, DataLabelsFormatterCallbackFunction, FormatterCallbackFunction, Point, ScreenReaderFormatterCallbackFunction, Series, TooltipFormatterCallbackFunction } from "highcharts";
1
+ import { AxisLabelsFormatterCallbackFunction, DataLabelsFormatterCallbackFunction, FormatterCallbackFunction, Point, ScreenReaderFormatterCallbackFunction, Series, TooltipFormatterCallbackFunction, TooltipFormatterContextObject } from "highcharts";
2
2
  import { IUnitInfo, View } from "../../types/view";
3
3
  export declare function getToolTipFormatterFunction(view: View, locale: string): TooltipFormatterCallbackFunction;
4
4
  export declare function getScreenReaderFormatterCallbackFunction(view: View, locale: string): ScreenReaderFormatterCallbackFunction<Point>;
@@ -12,4 +12,5 @@ export declare const shortenStringValue: (value: string | number, limit?: number
12
12
  export declare function getScatterPlotScreenReaderFormatterCallbackFunction(view: View, locale: string): ScreenReaderFormatterCallbackFunction<Point>;
13
13
  export declare function getScatterPlotTooltipFormatterFunction(view: View, locale: string): TooltipFormatterCallbackFunction;
14
14
  export declare function getFormattedUnits(unitInfos: IUnitInfo[], locale: string): string;
15
+ export declare function getDataFormattedForChartType(view: View, point: TooltipFormatterContextObject | Point, locale: string, precision: number): string;
15
16
  export declare function parseScreenReaderFriendlyTimePeriods(value: string, locale: string): string;
@@ -0,0 +1,31 @@
1
+ import { IQueryVisualizationResponse } from "../types";
2
+ import { IVariableMeta, IVariableValueMeta, TMultiLanguageString } from "../types/queryVisualizationResponse";
3
+ import { TVariableSelections } from "../types/variableSelections";
4
+ import { IDataCell, IDataSeries } from "../types/view";
5
+ export declare class SeriesBuilder {
6
+ dataIndex: number;
7
+ dataLength: number;
8
+ private readonly responseObj;
9
+ private readonly coordinates;
10
+ private readonly lastIndices;
11
+ private readonly indices;
12
+ private readonly variableOrder;
13
+ private readonly lastCoordinateIndex;
14
+ private readonly reverseCumulativeProducts;
15
+ private readonly selectedViewContentVariableIndex;
16
+ private readonly selectedViewTimeVariableIndex;
17
+ private readonly selectedViewMeta;
18
+ private rowLength;
19
+ private rowAmount;
20
+ constructor(responseObj: IQueryVisualizationResponse, selectedValueCodes: TVariableSelections);
21
+ private initializeCoordinates;
22
+ getViewSeries(): IDataSeries[];
23
+ generateRowNameGroup(): TMultiLanguageString[];
24
+ next(): boolean;
25
+ createDataCell(): IDataCell;
26
+ getSelectedView(responseObj: IQueryVisualizationResponse, selectedValueCodes: TVariableSelections): IVariableMeta[];
27
+ getVariableOrder(): number[];
28
+ generateRCP(variableSizes: number[]): number[];
29
+ setCurrentIndex(): void;
30
+ getCurrentTimeValue(): IVariableValueMeta | undefined;
31
+ }
@@ -0,0 +1,4 @@
1
+ import { IVariableMeta, IVariableValueMeta } from "../types/queryVisualizationResponse";
2
+ import { TVariableSelections } from "../types/variableSelections";
3
+ export declare function getValuesForVariableInView(variable: IVariableMeta, selectedValueCodes: TVariableSelections): IVariableValueMeta[];
4
+ export declare function sortVariables(variables: IVariableMeta[], codes: string[]): IVariableMeta[];
@@ -1,10 +1,10 @@
1
1
  import { IQueryVisualizationResponse } from "../types";
2
2
  import { TMultiLanguageString } from "../types/queryVisualizationResponse";
3
- import { IDataSeries, TSingleSelections, View } from "../types/view";
3
+ import { IDataSeries, View } from "../types/view";
4
4
  import { TVariableSelections } from "../types/variableSelections";
5
5
  export declare function convertPxGrafResponseToView(responseObj: IQueryVisualizationResponse, selectedValueCodes: TVariableSelections): View;
6
6
  export declare function convertToRelative(input: View): View;
7
- export declare function buildSeries(responseObj: IQueryVisualizationResponse, selectedValueCodes: TSingleSelections): {
7
+ export declare function buildSeries(responseObj: IQueryVisualizationResponse, selectedValueCodes: TVariableSelections): {
8
8
  columnNameGroups: TMultiLanguageString[][];
9
9
  series: IDataSeries[];
10
10
  };
@@ -32,9 +32,6 @@ export interface IDataSeries {
32
32
  rowNameGroup: TMultiLanguageString[];
33
33
  series: IDataCell[];
34
34
  }
35
- export type TSingleSelections = {
36
- [key: string]: string;
37
- };
38
35
  export type TValueSelectionAmounts = {
39
36
  [key: string]: number;
40
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statisticsfinland/pxvisualizer",
3
- "version": "1.0.9",
3
+ "version": "1.1.0-d.0",
4
4
  "description": "Component library for visualizing PxGraf data",
5
5
  "main": "./dist/pxv.cjs",
6
6
  "jestSonar": {
@@ -46,28 +46,28 @@
46
46
  "author": "Statistics Finland",
47
47
  "license": "Apache-2.0",
48
48
  "devDependencies": {
49
- "@babel/core": "^7.24.5",
50
- "@storybook/addon-a11y": "^8.1.3",
49
+ "@babel/core": "^7.26.7",
50
+ "@storybook/addon-a11y": "^8.5.3",
51
51
  "@storybook/addon-actions": "^8.1.3",
52
- "@storybook/addon-essentials": "^8.1.3",
53
- "@storybook/addon-interactions": "^8.1.3",
54
- "@storybook/addon-links": "^8.1.3",
55
- "@storybook/addon-webpack5-compiler-swc": "^1.0.2",
52
+ "@storybook/addon-essentials": "^8.5.3",
53
+ "@storybook/addon-interactions": "^8.5.3",
54
+ "@storybook/addon-links": "^8.5.3",
55
+ "@storybook/addon-webpack5-compiler-swc": "^1.0.6",
56
56
  "@storybook/blocks": "^8.1.3",
57
57
  "@storybook/react": "^8.1.3",
58
- "@storybook/react-webpack5": "^8.1.3",
58
+ "@storybook/react-webpack5": "^8.5.3",
59
59
  "@storybook/test": "^8.1.3",
60
60
  "@testing-library/dom": "^9.3.4",
61
61
  "@testing-library/react": "^14.3.1",
62
62
  "@types/file-saver": "^2.0.7",
63
- "@types/jest": "^29.5.12",
64
- "@types/papaparse": "^5.3.14",
65
- "@types/react": "^18.3.2",
63
+ "@types/jest": "^29.5.14",
64
+ "@types/papaparse": "^5.3.15",
65
+ "@types/react": "^18.3.18",
66
66
  "@types/styled-components": "^5.1.34",
67
67
  "@types/uuid": "^9.0.8",
68
- "babel-loader": "^8.3.0",
68
+ "babel-loader": "^8.4.1",
69
69
  "clean-publish": "^4.4.0",
70
- "decimal.js": "^10.4.3",
70
+ "decimal.js": "^10.5.0",
71
71
  "highcharts": "^10.3.3",
72
72
  "highcharts-react-official": "^3.2.1",
73
73
  "jest": "^29.7.0",
@@ -76,23 +76,22 @@
76
76
  "jest-sonar-reporter": "^2.0.0",
77
77
  "jest-styled-components": "^7.2.0",
78
78
  "microbundle": "^0.15.1",
79
- "papaparse": "^5.4.1",
79
+ "papaparse": "^5.5.2",
80
80
  "react": "^18.3.1",
81
81
  "react-dom": "^18.3.1",
82
- "semver": "^7.6.2",
83
- "storybook": "^8.1.3",
82
+ "semver": "^7.7.0",
83
+ "storybook": "^8.5.3",
84
84
  "styled-components": "^5.3.11",
85
- "ts-jest": "^29.1.2",
85
+ "ts-jest": "^29.2.5",
86
86
  "ts-node": "^10.9.2",
87
87
  "typescript": "^4.9.5",
88
- "uuid": "^9.0.1"
88
+ "uuid": "^11.0.5"
89
89
  },
90
90
  "dependencies": {
91
- "decimal.js": "^10.4.3",
91
+ "decimal.js": "^10.5.0",
92
92
  "fflate": "^0.8.2",
93
93
  "highcharts": "^10.3.3",
94
- "highcharts-react-official": "^3.2.1",
95
- "uuid": "^9.0.1"
94
+ "highcharts-react-official": "^3.2.1"
96
95
  },
97
96
  "peerDependencies": {
98
97
  "react": "^18.2.0",