infobae-charts 0.0.15 → 0.0.17

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.

Potentially problematic release.


This version of infobae-charts might be problematic. Click here for more details.

@@ -0,0 +1,4 @@
1
+ import { ChartData, Data, Visualization } from '../types';
2
+ export declare const NEGATIVE_SERIES_KEYS: string[];
3
+ export declare const buildChartData: (data?: Data, visualization?: Visualization) => ChartData;
4
+ //# sourceMappingURL=chart-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-data.d.ts","sourceRoot":"","sources":["../../../../src/components/HorizontalBarChart/chart/chart-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAA8B,IAAI,EAAU,aAAa,EAAE,MAAM,UAAU,CAAC;AAGxG,eAAO,MAAM,oBAAoB,UAAe,CAAC;AAyDjD,eAAO,MAAM,cAAc,GAAI,OAAM,IAAS,EAAE,gBAAe,aAAkB,KAAG,SAuCnF,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { TooltipItem } from '../types';
2
+ export declare const BAR_ITEM_STYLE: {
3
+ borderColor: string;
4
+ borderRadius: number;
5
+ borderWidth: number;
6
+ };
7
+ export declare const BAR_WIDTH = 14;
8
+ export declare const BAR_GAP = "20%";
9
+ export declare const LAYOUT: {
10
+ ASPECT_RATIO: string;
11
+ AXIS_HEIGHT: number;
12
+ MAX_CATEGORIES_WITH_ASPECT_RATIO: number;
13
+ MIN_HEIGHT: number;
14
+ ROW_HEIGHT: number;
15
+ };
16
+ export declare const getChartSize: (categoriesCount?: number) => {
17
+ aspectRatio: string;
18
+ minHeight: string;
19
+ width: string;
20
+ height?: undefined;
21
+ } | {
22
+ height: string;
23
+ width: string;
24
+ aspectRatio?: undefined;
25
+ minHeight?: undefined;
26
+ } | {
27
+ minHeight: string;
28
+ width: string;
29
+ aspectRatio?: undefined;
30
+ height?: undefined;
31
+ };
32
+ export declare const BASE_CHART_OPTION: {
33
+ backgroundColor: string;
34
+ grid: {
35
+ bottom: string;
36
+ containLabel: boolean;
37
+ left: string;
38
+ right: string;
39
+ top: string;
40
+ };
41
+ textStyle: {
42
+ color: string;
43
+ fontFamily: string;
44
+ fontSize: number;
45
+ };
46
+ tooltip: {
47
+ backgroundColor: string;
48
+ borderColor: string;
49
+ borderRadius: number;
50
+ borderWidth: number;
51
+ extraCssText: string;
52
+ formatter: (params: TooltipItem[]) => string;
53
+ padding: number[];
54
+ show: boolean;
55
+ textStyle: {
56
+ color: string;
57
+ fontFamily: string;
58
+ fontSize: number;
59
+ };
60
+ trigger: string;
61
+ };
62
+ xAxis: {
63
+ axisLabel: {
64
+ fontSize: number;
65
+ };
66
+ axisLine: {
67
+ show: boolean;
68
+ };
69
+ axisTick: {
70
+ show: boolean;
71
+ };
72
+ splitLine: {
73
+ show: boolean;
74
+ };
75
+ tooltip: {
76
+ show: boolean;
77
+ };
78
+ type: string;
79
+ }[];
80
+ yAxis: {
81
+ axisLabel: {
82
+ fontSize: number;
83
+ interval: number;
84
+ };
85
+ axisLine: {
86
+ lineStyle: {
87
+ color: string;
88
+ type: string;
89
+ width: number;
90
+ };
91
+ onZero: boolean;
92
+ show: boolean;
93
+ };
94
+ axisTick: {
95
+ show: boolean;
96
+ };
97
+ splitLine: {
98
+ lineStyle: {
99
+ color: string;
100
+ type: string;
101
+ width: number;
102
+ };
103
+ show: boolean;
104
+ };
105
+ type: string;
106
+ z: number;
107
+ }[];
108
+ };
109
+ //# sourceMappingURL=chart-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-styles.d.ts","sourceRoot":"","sources":["../../../../src/components/HorizontalBarChart/chart/chart-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,eAAO,MAAM,cAAc;;;;CAI1B,CAAC;AAEF,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,OAAO,QAAQ,CAAC;AAE7B,eAAO,MAAM,MAAM;;;;;;CAMlB,CAAC;AAGF,eAAO,MAAM,YAAY,GAAI,wBAAmB;;;;;;;;;;;;;;;CAe/C,CAAC;AA2BF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;4BAzBI,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkF9C,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Data, Visualization } from '../types';
2
+ export interface HorizontalBarChartItemProps {
3
+ data?: Data;
4
+ visualization?: Visualization;
5
+ showLegend?: boolean;
6
+ }
7
+ export declare const HorizontalBarChartItem: ({ data, showLegend, visualization, }: HorizontalBarChartItemProps) => import("react").JSX.Element;
8
+ export default HorizontalBarChartItem;
9
+ //# sourceMappingURL=HorizontalBarChartItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HorizontalBarChartItem.d.ts","sourceRoot":"","sources":["../../../../src/components/HorizontalBarChart/children/HorizontalBarChartItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQ/C,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAUD,eAAO,MAAM,sBAAsB,GAAI,sCAIpC,2BAA2B,gCA4D7B,CAAA;AAED,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { ApiData } from './types';
2
+ export interface HorizontalBarChartProps {
3
+ data: ApiData;
4
+ }
5
+ export declare const HorizontalBarChart: ({ data: apiData }: HorizontalBarChartProps) => import("react").JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HorizontalBarChart/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,cAAc,CAAC;AAGtB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,kBAAkB,GAAI,mBAAwB,uBAAuB,gCAyEjF,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { ApiData } from '../types';
2
+ /**
3
+ * Mocks de testing manual.
4
+ * Para probar otro caso: cambiar ACTIVE_HORIZONTAL_BAR_CHART_MOCK en TestComponent.
5
+ */
6
+ export declare const HORIZONTAL_BAR_CHART_MOCKS: Record<string, ApiData>;
7
+ export type HorizontalBarChartMockKey = keyof typeof HORIZONTAL_BAR_CHART_MOCKS;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/HorizontalBarChart/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAWnC;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAUvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,0BAA0B,CAAC"}
@@ -0,0 +1,67 @@
1
+ export interface Metadata {
2
+ title?: string;
3
+ description?: string;
4
+ source?: string;
5
+ image?: string;
6
+ }
7
+ export type DataRow = Array<string | number | null>;
8
+ export interface Data {
9
+ columns?: Array<string | number>;
10
+ rows?: DataRow[];
11
+ }
12
+ export interface Bindings {
13
+ category?: string;
14
+ values?: Array<string | number>;
15
+ x?: string | Array<string | number>;
16
+ y?: string | Array<string | number>;
17
+ }
18
+ export interface Series {
19
+ key?: string | number;
20
+ color?: string;
21
+ image?: string;
22
+ }
23
+ export interface Settings {
24
+ showTitle?: boolean;
25
+ showDescription?: boolean;
26
+ showImage?: boolean;
27
+ showLegend?: boolean;
28
+ showChart?: boolean;
29
+ showSource?: boolean;
30
+ }
31
+ export interface Visualization {
32
+ type?: string;
33
+ bindings?: Bindings;
34
+ series?: Series[];
35
+ settings?: Settings;
36
+ }
37
+ export interface ApiData {
38
+ schemaVersion?: number;
39
+ metadata?: Metadata;
40
+ data?: Data;
41
+ visualization?: Visualization;
42
+ }
43
+ export interface TooltipItem {
44
+ name: string;
45
+ seriesName: string;
46
+ value: number;
47
+ marker: string;
48
+ }
49
+ export interface ChartDataItem {
50
+ itemStyle: Record<string, unknown>;
51
+ value: number;
52
+ }
53
+ export interface ChartSeries {
54
+ barGap: string;
55
+ barWidth: number;
56
+ data: ChartDataItem[];
57
+ label: {
58
+ show: boolean;
59
+ };
60
+ name: string;
61
+ type: 'bar';
62
+ }
63
+ export interface ChartData {
64
+ categories: string[];
65
+ series: ChartSeries[];
66
+ }
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/HorizontalBarChart/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;AAEpD,MAAM,WAAW,IAAI;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACpC,CAAC,C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