@axdspub/axiom-charts 0.0.7 → 0.0.10

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/.eslintrc.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "es2021": true
5
- },
6
- "extends": [
7
- "plugin:react/recommended",
8
- "standard-with-typescript"
9
- ],
10
- "overrides": [
11
- ],
12
- "parserOptions": {
13
- "ecmaVersion": "latest",
14
- "sourceType": "module",
15
- "project": ["./tsconfig.json"]
16
- },
17
- "plugins": [
18
- "react"
19
- ],
20
- "rules": {
21
- "ignoreIIFE": 0
22
- },
23
- "ignorePatterns": ["**/build/*","**/node_modules/*", "**/library/"]
24
- }
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true
5
+ },
6
+ "extends": [
7
+ "plugin:react/recommended",
8
+ "standard-with-typescript"
9
+ ],
10
+ "overrides": [
11
+ ],
12
+ "parserOptions": {
13
+ "ecmaVersion": "latest",
14
+ "sourceType": "module",
15
+ "project": ["./tsconfig.json"]
16
+ },
17
+ "plugins": [
18
+ "react"
19
+ ],
20
+ "rules": {
21
+ "ignoreIIFE": 0
22
+ },
23
+ "ignorePatterns": ["**/build/*","**/node_modules/*", "**/library/"]
24
+ }
package/.gitlab-ci.yml CHANGED
@@ -1,140 +1,140 @@
1
- stages:
2
- - build
3
- - test
4
- - push
5
- - clean
6
- - deploy
7
-
8
- build_image:
9
- stage: build
10
- script:
11
- - docker build -f Dockerfile -t $CI_PROJECT_NAME:$CI_PIPELINE_ID .
12
- - docker build -f Dockerfile.storybook -t $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID .
13
-
14
- test:
15
- stage: test
16
- image: $CI_PROJECT_NAME:$CI_PIPELINE_ID
17
- script:
18
- - test -e /usr/share/nginx/html/index.html
19
- - test -e /usr/share/nginx/html/asset-manifest.json
20
-
21
- test_storybook:
22
- stage: test
23
- image: $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID
24
- script:
25
- - test -e /usr/share/nginx/html/index.html
26
- - test -e /usr/share/nginx/html/stories.json
27
-
28
- push_latest:
29
- stage: push
30
- only:
31
- - main
32
- script:
33
- - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:latest
34
- - docker push registry.axiom/$CI_PROJECT_NAME:latest
35
-
36
- push_branch:
37
- stage: push
38
- only:
39
- - branches
40
- except:
41
- - main
42
- script:
43
- - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
44
- - docker push registry.axiom/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
45
-
46
- push_branch_storybook:
47
- stage: push
48
- only:
49
- - branches
50
- except:
51
- - main
52
- script:
53
- - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:$CI_COMMIT_REF_NAME
54
- - docker push registry.axiom/$CI_PROJECT_NAME-storybook:$CI_COMMIT_REF_NAME
55
-
56
- push_latest_storybook:
57
- stage: push
58
- only:
59
- - main
60
- script:
61
- - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:latest
62
- - docker push registry.axiom/$CI_PROJECT_NAME-storybook:latest
63
-
64
- push_tag:
65
- stage: push
66
- only:
67
- - tags
68
- script:
69
- - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:$CI_BUILD_TAG
70
- - docker push registry.axiom/$CI_PROJECT_NAME:$CI_BUILD_TAG
71
- - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:prod
72
- - docker push registry.axiom/$CI_PROJECT_NAME:prod
73
-
74
- push_tag_storybook:
75
- stage: push
76
- only:
77
- - tags
78
- script:
79
- - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:$CI_BUILD_TAG
80
- - docker push registry.axiom/$CI_PROJECT_NAME-storybook:$CI_BUILD_TAG
81
- - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:prod
82
- - docker push registry.axiom/$CI_PROJECT_NAME-storybook:prod
83
-
84
-
85
- clean_latest:
86
- stage: clean
87
- only:
88
- - main
89
- script:
90
- - docker rmi --no-prune $CI_PROJECT_NAME:$CI_PIPELINE_ID
91
- - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME:latest
92
-
93
- clean_latest_storybook:
94
- stage: clean
95
- only:
96
- - main
97
- script:
98
- - docker rmi --no-prune $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID
99
- - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME-storybook:latest
100
-
101
- clean_tag:
102
- stage: clean
103
- only:
104
- - tags
105
- script:
106
- - docker rmi --no-prune $CI_PROJECT_NAME:$CI_PIPELINE_ID
107
- - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME:$CI_BUILD_TAG
108
- - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME:prod
109
-
110
- clean_tag_storybook:
111
- stage: clean
112
- only:
113
- - tags
114
- script:
115
- - docker rmi --no-prune $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID
116
- - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME-storybook:$CI_BUILD_TAG
117
- - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME-storybook:prod
118
-
119
- deploy_app_and_storybook:
120
- stage: deploy
121
- only:
122
- - main
123
- script:
124
- - aps apps-prod axiom-charts-and-storybook
125
-
126
- # deploy_prod:
127
- # stage: deploy
128
- # environment: production
129
- # only:
130
- # - tags
131
- # script:
132
- # - docker run --rm registry.axiom/ansible aps apps-prod $CI_PROJECT_NAME -e $CI_PROJECT_NAME_version=$CI_BUILD_TAG --tags deploy
133
-
134
- # deploy_prod_storybook:
135
- # stage: deploy
136
- # environment: production
137
- # only:
138
- # - tags
139
- # script:
140
- # - docker run --rm registry.axiom/ansible aps apps-prod $CI_PROJECT_NAME-storybook -e $CI_PROJECT_NAME-storybook_version=$CI_BUILD_TAG --tags deploy
1
+ stages:
2
+ - build
3
+ - test
4
+ - push
5
+ - clean
6
+ - deploy
7
+
8
+ build_image:
9
+ stage: build
10
+ script:
11
+ - docker build -f Dockerfile -t $CI_PROJECT_NAME:$CI_PIPELINE_ID .
12
+ - docker build -f Dockerfile.storybook -t $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID .
13
+
14
+ test:
15
+ stage: test
16
+ image: $CI_PROJECT_NAME:$CI_PIPELINE_ID
17
+ script:
18
+ - test -e /usr/share/nginx/html/index.html
19
+ - test -e /usr/share/nginx/html/asset-manifest.json
20
+
21
+ test_storybook:
22
+ stage: test
23
+ image: $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID
24
+ script:
25
+ - test -e /usr/share/nginx/html/index.html
26
+ - test -e /usr/share/nginx/html/stories.json
27
+
28
+ push_latest:
29
+ stage: push
30
+ only:
31
+ - main
32
+ script:
33
+ - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:latest
34
+ - docker push registry.axiom/$CI_PROJECT_NAME:latest
35
+
36
+ push_branch:
37
+ stage: push
38
+ only:
39
+ - branches
40
+ except:
41
+ - main
42
+ script:
43
+ - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
44
+ - docker push registry.axiom/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
45
+
46
+ push_branch_storybook:
47
+ stage: push
48
+ only:
49
+ - branches
50
+ except:
51
+ - main
52
+ script:
53
+ - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:$CI_COMMIT_REF_NAME
54
+ - docker push registry.axiom/$CI_PROJECT_NAME-storybook:$CI_COMMIT_REF_NAME
55
+
56
+ push_latest_storybook:
57
+ stage: push
58
+ only:
59
+ - main
60
+ script:
61
+ - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:latest
62
+ - docker push registry.axiom/$CI_PROJECT_NAME-storybook:latest
63
+
64
+ push_tag:
65
+ stage: push
66
+ only:
67
+ - tags
68
+ script:
69
+ - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:$CI_BUILD_TAG
70
+ - docker push registry.axiom/$CI_PROJECT_NAME:$CI_BUILD_TAG
71
+ - docker tag $CI_PROJECT_NAME:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME:prod
72
+ - docker push registry.axiom/$CI_PROJECT_NAME:prod
73
+
74
+ push_tag_storybook:
75
+ stage: push
76
+ only:
77
+ - tags
78
+ script:
79
+ - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:$CI_BUILD_TAG
80
+ - docker push registry.axiom/$CI_PROJECT_NAME-storybook:$CI_BUILD_TAG
81
+ - docker tag $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID registry.axiom/$CI_PROJECT_NAME-storybook:prod
82
+ - docker push registry.axiom/$CI_PROJECT_NAME-storybook:prod
83
+
84
+
85
+ clean_latest:
86
+ stage: clean
87
+ only:
88
+ - main
89
+ script:
90
+ - docker rmi --no-prune $CI_PROJECT_NAME:$CI_PIPELINE_ID
91
+ - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME:latest
92
+
93
+ clean_latest_storybook:
94
+ stage: clean
95
+ only:
96
+ - main
97
+ script:
98
+ - docker rmi --no-prune $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID
99
+ - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME-storybook:latest
100
+
101
+ clean_tag:
102
+ stage: clean
103
+ only:
104
+ - tags
105
+ script:
106
+ - docker rmi --no-prune $CI_PROJECT_NAME:$CI_PIPELINE_ID
107
+ - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME:$CI_BUILD_TAG
108
+ - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME:prod
109
+
110
+ clean_tag_storybook:
111
+ stage: clean
112
+ only:
113
+ - tags
114
+ script:
115
+ - docker rmi --no-prune $CI_PROJECT_NAME-storybook:$CI_PIPELINE_ID
116
+ - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME-storybook:$CI_BUILD_TAG
117
+ - docker rmi --no-prune registry.axiom/$CI_PROJECT_NAME-storybook:prod
118
+
119
+ deploy_app_and_storybook:
120
+ stage: deploy
121
+ only:
122
+ - main
123
+ script:
124
+ - aps apps-prod axiom-charts-and-storybook
125
+
126
+ # deploy_prod:
127
+ # stage: deploy
128
+ # environment: production
129
+ # only:
130
+ # - tags
131
+ # script:
132
+ # - docker run --rm registry.axiom/ansible aps apps-prod $CI_PROJECT_NAME -e $CI_PROJECT_NAME_version=$CI_BUILD_TAG --tags deploy
133
+
134
+ # deploy_prod_storybook:
135
+ # stage: deploy
136
+ # environment: production
137
+ # only:
138
+ # - tags
139
+ # script:
140
+ # - docker run --rm registry.axiom/ansible aps apps-prod $CI_PROJECT_NAME-storybook -e $CI_PROJECT_NAME-storybook_version=$CI_BUILD_TAG --tags deploy
package/README.md CHANGED
@@ -1,49 +1,49 @@
1
- ## Storybook
2
-
3
- `npm run storybook`
4
-
5
- ## Local development
6
-
7
- Be sure yalc is installed:
8
-
9
- ``
10
-
11
- Then
12
-
13
- `yalc publish`
14
-
15
- To update linked projects
16
-
17
- `yalc push`
18
-
19
- In consuming project:
20
-
21
- `yalc add @axdspub/axiom-ui-data-services`
22
-
23
- then
24
-
25
- `yalc link @axdspub/axiom-ui-data-services`
26
-
27
-
28
- # Publish
29
-
30
- ```
31
- npm login --scope=@axdspub
32
- npm publish --dryrun
33
- ```
34
-
35
- If all looks good
36
-
37
- ```
38
- npm publish --access public
39
- ```
40
-
41
-
42
-
43
- # Usage
44
-
45
-
46
- # Todo
47
-
48
- Documentation
49
-
1
+ ## Storybook
2
+
3
+ `npm run storybook`
4
+
5
+ ## Local development
6
+
7
+ Be sure yalc is installed:
8
+
9
+ ``
10
+
11
+ Then
12
+
13
+ `yalc publish`
14
+
15
+ To update linked projects
16
+
17
+ `yalc push`
18
+
19
+ In consuming project:
20
+
21
+ `yalc add @axdspub/axiom-ui-data-services`
22
+
23
+ then
24
+
25
+ `yalc link @axdspub/axiom-ui-data-services`
26
+
27
+
28
+ # Publish
29
+
30
+ ```
31
+ npm login --scope=@axdspub
32
+ npm publish --dryrun
33
+ ```
34
+
35
+ If all looks good
36
+
37
+ ```
38
+ npm publish --access public
39
+ ```
40
+
41
+
42
+
43
+ # Usage
44
+
45
+
46
+ # Todo
47
+
48
+ Documentation
49
+
package/craco.config.js CHANGED
@@ -1,36 +1,36 @@
1
- const path = require('path')
2
- // someday, clean up the the FOUR! repeated declarations of aliases (others are is in tsconfig.paths.json => tsconfig.json and .storybook/main.ts)
3
- // https://stackoverflow.com/a/71892901
4
- console.log(path.resolve(__dirname, './src/'))
5
-
6
- module.exports = {
7
- webpack: {
8
- eslint: {
9
- enable: false
10
- },
11
- typescript: {
12
- enableTypeChecking: true
13
- },
14
- alias: {
15
- '@': path.resolve(__dirname, './src/')
16
- },
17
- configure: {
18
- ignoreWarnings: [/Failed to parse source map/],
19
- resolve: {
20
- fallback: {
21
- https: false,
22
- http: false,
23
- path: false,
24
- zlib: false
25
- }
26
- }
27
- }
28
- },
29
- jest: {
30
- configure: {
31
- verbose: true,
32
- moduleNameMapper: {}
33
- }
34
- },
35
- plugins: []
36
- }
1
+ const path = require('path')
2
+ // someday, clean up the the FOUR! repeated declarations of aliases (others are is in tsconfig.paths.json => tsconfig.json and .storybook/main.ts)
3
+ // https://stackoverflow.com/a/71892901
4
+ console.log(path.resolve(__dirname, './src/'))
5
+
6
+ module.exports = {
7
+ webpack: {
8
+ eslint: {
9
+ enable: false
10
+ },
11
+ typescript: {
12
+ enableTypeChecking: true
13
+ },
14
+ alias: {
15
+ '@': path.resolve(__dirname, './src/')
16
+ },
17
+ configure: {
18
+ ignoreWarnings: [/Failed to parse source map/],
19
+ resolve: {
20
+ fallback: {
21
+ https: false,
22
+ http: false,
23
+ path: false,
24
+ zlib: false
25
+ }
26
+ }
27
+ }
28
+ },
29
+ jest: {
30
+ configure: {
31
+ verbose: true,
32
+ moduleNameMapper: {}
33
+ }
34
+ },
35
+ plugins: []
36
+ }
@@ -1,18 +1,18 @@
1
- services:
2
- app:
3
- image: axiom-charts:latest
4
- build:
5
- context: .
6
- dockerfile: Dockerfile
7
- ports:
8
- - "8787:80"
9
- # profiles:
10
- # - app
11
-
12
- storybook:
13
- image: axiom-charts-storybook:latest
14
- build:
15
- context: .
16
- dockerfile: Dockerfile.storybook
17
- ports:
18
- - "8888:80"
1
+ services:
2
+ app:
3
+ image: axiom-charts:latest
4
+ build:
5
+ context: .
6
+ dockerfile: Dockerfile
7
+ ports:
8
+ - "8787:80"
9
+ # profiles:
10
+ # - app
11
+
12
+ storybook:
13
+ image: axiom-charts-storybook:latest
14
+ build:
15
+ context: .
16
+ dockerfile: Dockerfile.storybook
17
+ ports:
18
+ - "8888:80"
@@ -434,6 +434,7 @@ var ChartRoot = /** @class */ (function () {
434
434
  case 1:
435
435
  _a.sent();
436
436
  this.showYAxes(yAxes);
437
+ this.showYLabels(yAxes, this.plots);
437
438
  yAxesWidth = this.getYAxesWidth();
438
439
  chartWidth = this.getChartWidth();
439
440
  xRange = this.getXRange(chartWidth);
@@ -491,6 +492,8 @@ var ChartRoot = /** @class */ (function () {
491
492
  };
492
493
  ChartRoot.prototype.showYAxes = function (yAxes) {
493
494
  };
495
+ ChartRoot.prototype.showYLabels = function (yAxes, plots) {
496
+ };
494
497
  ChartRoot.prototype.showXAxes = function (xAxes) {
495
498
  };
496
499
  ChartRoot.prototype.draw = function () {
@@ -859,7 +862,7 @@ function styleInject(css, ref) {
859
862
  }
860
863
  }
861
864
 
862
- var css_248z = ".chart .axis .tick text{\r\n fill:#333;\r\n font-size:12px;\r\n}\r\n\r\n.chart .y-axis .radial-axis .tick text{\r\n stroke:#FFF;\r\n stroke-width:5px;\r\n paint-order: stroke;\r\n font-size:14px;\r\n fill:#000;\r\n\r\n}\r\n\r\n.chart .axis .tick line,\r\n.chart .axis .tick circle{\r\n stroke:#CCC;\r\n stroke-width:.5px;\r\n}";
865
+ var css_248z = ".chart .axis .tick text{\n fill:#333;\n font-size:12px;\n}\n\n.chart .y-axis .radial-axis .tick text{\n stroke:#FFF;\n stroke-width:5px;\n paint-order: stroke;\n font-size:14px;\n fill:#000;\n\n}\n\n.chart .axis .tick line,\n.chart .axis .tick circle{\n stroke:#CCC;\n stroke-width:.5px;\n}";
863
866
  styleInject(css_248z);
864
867
 
865
868
  var AxiomChart = /** @class */ (function (_super) {
@@ -945,6 +948,29 @@ var AxiomChart = /** @class */ (function (_super) {
945
948
  }
946
949
  });
947
950
  };
951
+ AxiomChart.prototype.showYLabels = function (axes, plots) {
952
+ var _a;
953
+ if (plots.length > 1) {
954
+ return;
955
+ }
956
+ if (plots[0].type !== EPlotTypes.line) {
957
+ return;
958
+ }
959
+ var chartElements = this.getChartElements();
960
+ var label = (_a = axes[0].plots[0].dimensions.y.label) !== null && _a !== void 0 ? _a : '';
961
+ if (chartElements === undefined) {
962
+ return undefined;
963
+ }
964
+ var svg = chartElements.svg;
965
+ var axisSelection = svg.select('.y-axis').size() > 0 ? svg.select('.y-axis') : svg.append('g').attr('class', 'y-axis axis');
966
+ axisSelection.append('text')
967
+ .attr('class', 'y-label')
968
+ .attr('text-anchor', 'end')
969
+ .attr('dy', '.75rem')
970
+ .attr('font-size', '.75rem')
971
+ .attr('transform', 'rotate(-90)')
972
+ .text(label);
973
+ };
948
974
  AxiomChart.prototype.getXAxisOffset = function (axis) {
949
975
  return __assign({ x: this.settings.margin.left, y: this.settings.height - this.settings.margin.bottom }, axis.offset);
950
976
  };