@axdspub/axiom-charts 0.0.3

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.
Files changed (78) hide show
  1. package/.dockerignore +4 -0
  2. package/.eslintrc.json +24 -0
  3. package/.gitlab-ci.yml +140 -0
  4. package/.yalc/@axdspub/axiom-ui-data-services/.dockerignore +4 -0
  5. package/.yalc/@axdspub/axiom-ui-data-services/.eslintrc.json +28 -0
  6. package/.yalc/@axdspub/axiom-ui-data-services/.gitlab-ci.yml +140 -0
  7. package/.yalc/@axdspub/axiom-ui-data-services/Dockerfile.storybook +33 -0
  8. package/.yalc/@axdspub/axiom-ui-data-services/craco.config.cjs +36 -0
  9. package/.yalc/@axdspub/axiom-ui-data-services/docker/nginx/conf.d/default.conf +46 -0
  10. package/.yalc/@axdspub/axiom-ui-data-services/docker-compose.yml +18 -0
  11. package/.yalc/@axdspub/axiom-ui-data-services/library/axiom-ui-data-services.d.ts +313 -0
  12. package/.yalc/@axdspub/axiom-ui-data-services/library/browser.js +18498 -0
  13. package/.yalc/@axdspub/axiom-ui-data-services/library/browser.js.map +1 -0
  14. package/.yalc/@axdspub/axiom-ui-data-services/library/cjs.js +18493 -0
  15. package/.yalc/@axdspub/axiom-ui-data-services/library/cjs.js.map +1 -0
  16. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/App.d.ts +4 -0
  17. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/App.d.ts.map +1 -0
  18. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/Components/JSON/VanillaJSONEditor.d.ts +8 -0
  19. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/Components/JSON/VanillaJSONEditor.d.ts.map +1 -0
  20. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/DataService.d.ts +34 -0
  21. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/DataService.d.ts.map +1 -0
  22. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/DataService.stories.d.ts +23 -0
  23. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/DataService.stories.d.ts.map +1 -0
  24. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/RequestItem.d.ts +27 -0
  25. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/RequestItem.d.ts.map +1 -0
  26. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/RequestItem.stories.d.ts +19 -0
  27. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/RequestItem.stories.d.ts.map +1 -0
  28. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/Types.d.ts +245 -0
  29. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/Types.d.ts.map +1 -0
  30. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/dataServiceHelpers.d.ts +12 -0
  31. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/dataServiceHelpers.d.ts.map +1 -0
  32. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/endpoints/index.d.ts +9 -0
  33. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/endpoints/index.d.ts.map +1 -0
  34. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/index.d.ts +2 -0
  35. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/index.d.ts.map +1 -0
  36. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/library.d.ts +6 -0
  37. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/library.d.ts.map +1 -0
  38. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/parsers/groupAndSum.d.ts +1 -0
  39. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/parsers/groupAndSum.d.ts.map +1 -0
  40. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/parsers/index.d.ts +13 -0
  41. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/parsers/index.d.ts.map +1 -0
  42. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/reportWebVitals.d.ts +4 -0
  43. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/reportWebVitals.d.ts.map +1 -0
  44. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/services.d.ts +11 -0
  45. package/.yalc/@axdspub/axiom-ui-data-services/library/dist/esm/types/services.d.ts.map +1 -0
  46. package/.yalc/@axdspub/axiom-ui-data-services/library/index.js +18488 -0
  47. package/.yalc/@axdspub/axiom-ui-data-services/library/index.js.map +1 -0
  48. package/.yalc/@axdspub/axiom-ui-data-services/package.json +72 -0
  49. package/.yalc/@axdspub/axiom-ui-data-services/rollup.config.mjs +54 -0
  50. package/.yalc/@axdspub/axiom-ui-data-services/tsconfig.json +45 -0
  51. package/.yalc/@axdspub/axiom-ui-data-services/tsconfig.paths.json +11 -0
  52. package/.yalc/@axdspub/axiom-ui-data-services/yalc.sig +1 -0
  53. package/Dockerfile.storybook +33 -0
  54. package/README.md +46 -0
  55. package/craco.config.js +36 -0
  56. package/docker/nginx/conf.d/default.conf +46 -0
  57. package/docker-compose.yml +18 -0
  58. package/library/Libraries/axiom/assets/browser-ff7df1e3.css +19 -0
  59. package/library/Libraries/axiom/assets/cjs-ff7df1e3.css +19 -0
  60. package/library/Libraries/axiom/assets/index-ff7df1e3.css +19 -0
  61. package/library/Libraries/axiom/browser.js +41130 -0
  62. package/library/Libraries/axiom/browser.js.map +1 -0
  63. package/library/Libraries/axiom/cjs.js +41129 -0
  64. package/library/Libraries/axiom/cjs.js.map +1 -0
  65. package/library/Libraries/axiom/index.js +41127 -0
  66. package/library/Libraries/axiom/index.js.map +1 -0
  67. package/library/axiom-charts.d.ts +195 -0
  68. package/library/browser.js +36339 -0
  69. package/library/browser.js.map +1 -0
  70. package/library/cjs.js +36337 -0
  71. package/library/cjs.js.map +1 -0
  72. package/library/index.js +36334 -0
  73. package/library/index.js.map +1 -0
  74. package/package.json +112 -0
  75. package/rollup.config.mjs +141 -0
  76. package/tsconfig.json +29 -0
  77. package/tsconfig.paths.json +11 -0
  78. package/yalc.lock +10 -0
@@ -0,0 +1,195 @@
1
+ import { IRequestItemProps, IDataResult, INumericDataAccessor, IRequestItemData, IRequestItemImplementation } from '@axdspub/axiom-ui-data-services';
2
+ import { ReactElement } from 'react';
3
+
4
+ interface IUnit {
5
+ code: string;
6
+ label: string;
7
+ }
8
+ interface IChartAxis {
9
+ label?: string;
10
+ unit?: IUnit;
11
+ plots: IPlot[];
12
+ key: string;
13
+ scale?: IChartScale;
14
+ offset?: {
15
+ x?: number;
16
+ y?: number;
17
+ };
18
+ }
19
+ declare enum EChartAxes {
20
+ x = "x",
21
+ y = "y",
22
+ z = "z",
23
+ color = "color"
24
+ }
25
+ interface IChartAxes {
26
+ [EChartAxes.x]?: IChartAxis;
27
+ [EChartAxes.y]?: IChartAxis;
28
+ [EChartAxes.z]?: IChartAxis;
29
+ [EChartAxes.color]?: IChartAxis;
30
+ }
31
+ type IChartDimensionParameter = string;
32
+ interface IPlotAxisSetting {
33
+ reverse?: boolean;
34
+ accessProperties?: Record<string, string>;
35
+ parameter?: IChartDimensionParameter;
36
+ }
37
+ type IPlotAxisSettings = Record<string, IPlotAxisSetting | undefined>;
38
+ type IChartDimensionDomain = Array<Date | number>;
39
+ type IChartDimensionAccessor = (row: any) => number | number[] | Record<string, number> | Date;
40
+ type INumericScale = (d: any) => number;
41
+ interface IChartScale {
42
+ range: INumericRange;
43
+ domain: IChartDimensionDomain;
44
+ }
45
+ type INumericRange = number[];
46
+ interface IChartDimension {
47
+ accessor?: IChartDimensionAccessor;
48
+ parameter?: IChartDimensionParameter;
49
+ domain?: IChartDimensionDomain;
50
+ range?: INumericRange;
51
+ scale?: IChartScale;
52
+ label?: string;
53
+ displayUnits?: IUnit;
54
+ sourceUnits?: IUnit;
55
+ axes?: IChartAxes;
56
+ property?: string;
57
+ properties?: string[];
58
+ }
59
+ type IChartDimensions = Record<string, IChartDimension>;
60
+ declare enum EPlotTypes {
61
+ line = "line",
62
+ area = "area",
63
+ scatter = "scatter",
64
+ box = "box",
65
+ bar = "bar",
66
+ stacked = "stacked",
67
+ anomaly = "anomaly",
68
+ curtain = "curtain",
69
+ curtain_anomaly = "curtain_anomaly",
70
+ seasonal = "seasonal",
71
+ radial = "radial",
72
+ pie = "pie"
73
+ }
74
+ interface IPlotStyle {
75
+ strokeWidth?: number;
76
+ strokeColor?: string;
77
+ strokeDash?: [number, number];
78
+ fill?: string;
79
+ radius?: number;
80
+ }
81
+ interface IPlot extends IRequestItemProps {
82
+ id: string;
83
+ type: EPlotTypes;
84
+ dimensions: IChartDimensions;
85
+ data?: IDataResult;
86
+ axes?: IChartAxes;
87
+ style?: IPlotStyle;
88
+ axisSettings?: IPlotAxisSettings;
89
+ }
90
+ interface IPlotImplementationProps extends IPlot {
91
+ chart: IChartImplementation;
92
+ }
93
+ type IPlotDataAccessors = {
94
+ [key in EChartAxes]?: INumericDataAccessor;
95
+ };
96
+ interface IPlotData extends IRequestItemData {
97
+ accessors: IPlotDataAccessors;
98
+ }
99
+ interface IPlotImplementation extends IPlotImplementationProps, IRequestItemImplementation {
100
+ chart: IChartImplementation;
101
+ draw: () => Promise<void>;
102
+ destroy: () => void;
103
+ getDomain: (axis: EChartAxes) => Promise<IChartDimensionDomain>;
104
+ getYDomain: () => Promise<IChartDimensionDomain>;
105
+ getAxisSetting: (axis: string) => IPlotAxisSetting;
106
+ runtime: any;
107
+ }
108
+ interface IPlotImplementationGroup {
109
+ plots: IPlotImplementation[];
110
+ reverse: boolean;
111
+ parameter: IChartDimensionParameter;
112
+ }
113
+ type IPlotImplementationGroups = Record<string, IPlotImplementationGroup>;
114
+ type IPlotTypes = {
115
+ [key in EPlotTypes]?: ((props: IPlotImplementationProps) => IPlotImplementation);
116
+ };
117
+ interface IChartLibrary {
118
+ Chart: (props: IChartImplementationProps) => IChartImplementation;
119
+ RadialChart: (props: IChartImplementationProps) => IChartImplementation;
120
+ }
121
+ interface IChartSettings {
122
+ margin: {
123
+ left: number;
124
+ right: number;
125
+ top: number;
126
+ bottom: number;
127
+ };
128
+ width: number | 'auto';
129
+ height: number;
130
+ layout?: 'radial' | 'timeseries' | undefined;
131
+ }
132
+ interface IChart {
133
+ settings: IChartSettings;
134
+ plots: IPlot[];
135
+ label?: string;
136
+ description?: string;
137
+ help?: string;
138
+ }
139
+ interface IChartImplementationProps extends IChart {
140
+ element?: HTMLElement;
141
+ }
142
+ interface IChartImplementation extends IChartImplementationProps {
143
+ init: (drawImmediately: boolean) => Promise<void>;
144
+ draw: () => Promise<void>;
145
+ destroy: () => void;
146
+ }
147
+
148
+ declare class ChartRoot implements IChartImplementation {
149
+ plots: IPlot[];
150
+ element?: HTMLElement;
151
+ settings: IChartSettings;
152
+ plotImplementations?: IPlotImplementation[];
153
+ runtime: {
154
+ prevWidth: number;
155
+ prevHeight: number;
156
+ xDomain?: IChartDimensionDomain;
157
+ yDomain?: IChartDimensionDomain;
158
+ axisGroups?: {
159
+ x: {
160
+ domain: IChartDimensionDomain;
161
+ };
162
+ y: {
163
+ domain: IChartDimensionDomain;
164
+ };
165
+ };
166
+ [index: string]: any;
167
+ };
168
+ constructor(props: IChartImplementationProps);
169
+ protected onError(e: Error): void;
170
+ onResize(prevWidth: number, prevHeight: number): void;
171
+ getWidth(): number;
172
+ onDraw(): void;
173
+ protected getDomainForPlotImplementations(plotImplementations: IPlotImplementation[], axis: EChartAxes): Promise<IChartDimensionDomain>;
174
+ protected reversePlotAxis(plot: IPlotImplementation, axis: string): boolean;
175
+ protected getDimensionAxisParam(plot: IPlotImplementation, axis: string): string;
176
+ protected getPlotImplementationGroups(plots: IPlotImplementation[], axis: string): IPlotImplementationGroups;
177
+ protected getXRange(chartWidth: number): [number, number];
178
+ protected getYRange(chartHeight: number): [number, number];
179
+ protected getChartWidth(): number;
180
+ protected getChartHeight(): number;
181
+ protected getYAxesWidth(): number;
182
+ init(drawImmediately?: boolean): Promise<void>;
183
+ showAxes(xGroup: Record<string, IPlotImplementation[]>, yGroup: Record<string, IPlotImplementation[]>): void;
184
+ showYAxes(yAxes: IChartAxis[]): void;
185
+ showXAxes(xAxes: IChartAxis[]): void;
186
+ draw(): Promise<void>;
187
+ destroy(): void;
188
+ createPlots(): IPlotImplementation[];
189
+ protected getPlotImplementationProps(plot: IPlot): IPlotImplementationProps;
190
+ protected createPlot(plot: IPlot): IPlotImplementation;
191
+ }
192
+
193
+ declare const AxiomChartComponent: (props: IChart) => ReactElement;
194
+
195
+ export { AxiomChartComponent as Chart, ChartRoot, EChartAxes, EPlotTypes, IChart, IChartAxes, IChartAxis, IChartDimension, IChartDimensionAccessor, IChartDimensionDomain, IChartDimensionParameter, IChartDimensions, IChartImplementation, IChartImplementationProps, IChartLibrary, IChartScale, IChartSettings, INumericRange, INumericScale, IPlot, IPlotAxisSetting, IPlotAxisSettings, IPlotData, IPlotDataAccessors, IPlotImplementation, IPlotImplementationGroup, IPlotImplementationGroups, IPlotImplementationProps, IPlotStyle, IPlotTypes };