Skip to content

Commit 1f9482f

Browse files
committed
chore: update to 13 and run migrations
1 parent 357c6cc commit 1f9482f

22 files changed

+6487
-15942
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
!.vscode/extensions.json
2626

2727
# misc
28+
/.angular/cache
2829
/.sass-cache
2930
/connect.lock
3031
/coverage

README.md

+46-31
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Use with TypeScript/JavaScript:
2828

2929
```typescript
3030
import { plot, Plot } from 'nodeplotlib';
31-
const data: Plot[] = [{x: [1, 3, 4, 5], y: [3, 12, 1, 4], type: 'scatter'}];
31+
const data: Plot[] = [{ x: [1, 3, 4, 5], y: [3, 12, 1, 4], type: 'scatter' }];
3232
plot(data);
3333
```
3434

@@ -50,11 +50,13 @@ With the stack function the user is able to print multiple charts on one page.
5050
```typescript
5151
import { plot, stack, clear, Plot } from 'nodeplotlib';
5252

53-
const data: Plot[] = [{
54-
x: [ 1, 3, 4, 6, 7],
55-
y: [ 2, 4, 6, 8, 9],
56-
type: 'scatter'
57-
}];
53+
const data: Plot[] = [
54+
{
55+
x: [1, 3, 4, 6, 7],
56+
y: [2, 4, 6, 8, 9],
57+
type: 'scatter',
58+
},
59+
];
5860

5961
stack(data);
6062
stack(data);
@@ -84,29 +86,40 @@ In this section there are some examples to getting started. See the full plotly
8486
#### Line Plots
8587

8688
```typescript
87-
const trace1: Plot = {x: [1, 2], y: [1, 2], type: 'scatter'};
88-
const trace2: Plot = {x: [3, 4], y: [9, 16], type: 'scatter'};
89+
const trace1: Plot = { x: [1, 2], y: [1, 2], type: 'scatter' };
90+
const trace2: Plot = { x: [3, 4], y: [9, 16], type: 'scatter' };
8991
plot([trace1, trace2]);
9092
```
9193

9294
#### Bar Charts
9395

9496
```typescript
95-
const trace: Plot = {x: [1, 2], y: [1, 2], type: 'bar'};
97+
const trace: Plot = { x: [1, 2], y: [1, 2], type: 'bar' };
9698
plot([trace]);
9799
```
98100

99101
#### 3D Line Plots
100102

101103
```typescript
102-
const trace: Plot = {x: [9, 8, 5, 1], y: [1, 2, 4, 8], z: [11, 8, 15, 3], type: 'scatter3d'};
104+
const trace: Plot = {
105+
x: [9, 8, 5, 1],
106+
y: [1, 2, 4, 8],
107+
z: [11, 8, 15, 3],
108+
type: 'scatter3d',
109+
};
103110
plot([trace]);
104111
```
105112

106113
#### 3D Surface Plots
107114

108115
```typescript
109-
const trace: Plot = {colorscale: 'Viridis', z: [[3, 5, 7, 9], [21, 13, 8, 5]]};
116+
const trace: Plot = {
117+
colorscale: 'Viridis',
118+
z: [
119+
[3, 5, 7, 9],
120+
[21, 13, 8, 5],
121+
],
122+
};
110123
plot([trace]);
111124
```
112125

@@ -116,40 +129,42 @@ In order to style the plot, one is able to pass in the `layout` parameter, which
116129
is typeof `Partial<Layout>` from plotly's `Layout`. See the full layout documentation
117130
[here](https://plot.ly/javascript/#layout-options).
118131

119-
With this parameter one is able to define styles like *title*, *axis labels*,
120-
*subplots* and many more.
132+
With this parameter one is able to define styles like _title_, _axis labels_,
133+
_subplots_ and many more.
121134

122135
```typescript
123-
const data: Plot[] = [{
124-
type: 'scatterpolar',
125-
r: [1.5, 10, 39, 31, 15, 1.5],
126-
theta: ['A','B','C', 'D', 'E', 'A'],
127-
fill: 'toself',
128-
name: 'Group B'
129-
}];
136+
const data: Plot[] = [
137+
{
138+
type: 'scatterpolar',
139+
r: [1.5, 10, 39, 31, 15, 1.5],
140+
theta: ['A', 'B', 'C', 'D', 'E', 'A'],
141+
fill: 'toself',
142+
name: 'Group B',
143+
},
144+
];
130145

131146
const layout: Layout = {
132147
polar: {
133148
radialaxis: {
134149
visible: true,
135-
range: [0, 50]
136-
}
137-
}
150+
range: [0, 50],
151+
},
152+
},
138153
};
139154

140155
plot(data, layout);
141156
```
142157

143158
## Plot types
144159

145-
| Simple charts | Advanced charts | 3D Plots |
146-
| -------------------------- | --------------------------- | ------------------ |
147-
| Scatter | 2d density plots | Scatter |
148-
| Line | Histograms | Surface |
149-
| Bar | Box-plots | Lines |
150-
| Pie charts | Contour plots | |
151-
| Sankey diagrams | Heatmaps | |
152-
| Tables | Radar charts | |
160+
| Simple charts | Advanced charts | 3D Plots |
161+
| --------------- | ---------------- | -------- |
162+
| Scatter | 2d density plots | Scatter |
163+
| Line | Histograms | Surface |
164+
| Bar | Box-plots | Lines |
165+
| Pie charts | Contour plots | |
166+
| Sankey diagrams | Heatmaps | |
167+
| Tables | Radar charts | |
153168

154169
## Behind the scenes
155170

angular.json

+2-36
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@
137137
"outputPath": "dist/apps/nodeplotlib",
138138
"main": "apps/nodeplotlib/src/main.ts",
139139
"tsConfig": "apps/nodeplotlib/tsconfig.app.json",
140-
"assets": [
141-
"apps/nodeplotlib/src/package.json"
142-
],
140+
"assets": ["apps/nodeplotlib/src/package.json"],
143141
"externalDendencies": "none",
144142
"webpackConfig": "apps/nodeplotlib/webpack.config.js"
145143
},
@@ -299,37 +297,5 @@
299297
}
300298
}
301299
}
302-
},
303-
"cli": {
304-
"defaultCollection": "@nrwl/angular",
305-
"packageManager": "npm"
306-
},
307-
"schematics": {
308-
"@nrwl/angular": {
309-
"application": {
310-
"linter": "eslint"
311-
},
312-
"library": {
313-
"linter": "eslint"
314-
},
315-
"storybook-configuration": {
316-
"linter": "eslint"
317-
}
318-
},
319-
"@nrwl/angular:application": {
320-
"style": "css",
321-
"linter": "eslint",
322-
"unitTestRunner": "jest",
323-
"e2eTestRunner": "cypress"
324-
},
325-
"@nrwl/angular:library": {
326-
"style": "css",
327-
"linter": "eslint",
328-
"unitTestRunner": "jest"
329-
},
330-
"@nrwl/angular:component": {
331-
"style": "css"
332-
}
333-
},
334-
"defaultProject": "web"
300+
}
335301
}

apps/dev-server/tsconfig.app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"emitDecoratorMetadata": true,
88
"target": "es2015"
99
},
10-
"exclude": ["**/*.spec.ts"],
10+
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
1111
"include": ["**/*.ts"]
1212
}

apps/dev-server/tsconfig.spec.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["**/*.spec.ts", "**/*.d.ts"]
8+
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]
99
}

apps/nodeplotlib/src/main.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { Observable } from 'rxjs';
44

55
export type Plot = Partial<PlotData>;
66
export type Layout = Partial<PlotlyLayout>;
7-
export function plot(plot: Plot[] | Observable<Plot[]>, layout?: Layout): void
7+
export function plot(plot: Plot[] | Observable<Plot[]>, layout?: Layout): void;

apps/nodeplotlib/tsconfig.app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"module": "commonjs",
66
"types": ["node"]
77
},
8-
"exclude": ["**/*.spec.ts"],
8+
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
99
"include": ["**/*.ts"]
1010
}

apps/nodeplotlib/tsconfig.spec.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["**/*.spec.ts", "**/*.d.ts"]
8+
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]
99
}

apps/nodeplotlib/webpack.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
const CopyPlugin = require("copy-webpack-plugin");
1+
const CopyPlugin = require('copy-webpack-plugin');
22

33
module.exports = (x) => ({
44
...x,
55
plugins: [
66
...x.plugins,
77
new CopyPlugin({
88
patterns: [
9-
{ from: "dist/apps/web", to: "web" },
10-
{ from: "apps/nodeplotlib/src/main.d.ts", to: "" },
11-
{ from: "LICENSE", to: "" },
9+
{ from: 'dist/apps/web', to: 'web' },
10+
{ from: 'apps/nodeplotlib/src/main.d.ts', to: '' },
11+
{ from: 'LICENSE', to: '' },
1212
],
1313
}),
1414
],

apps/web/jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ module.exports = {
1010
},
1111
coverageDirectory: '../../coverage/apps/web',
1212
transform: {
13-
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
13+
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
1414
},
15+
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
1516
snapshotSerializers: [
1617
'jest-preset-angular/build/serializers/no-ng-attributes',
1718
'jest-preset-angular/build/serializers/ng-snapshot',

apps/web/src/custom-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Custom Theming for Angular Material
22
// For more information: https://material.angular.io/guide/theming
3-
@use '~@angular/material' as mat;
3+
@use '@angular/material' as mat;
44
// Plus imports for other components in your app.
55

66
// Include the common styles for Angular Material. We include this here so that you only

apps/web/src/polyfills.ts

-12
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@
1818
* BROWSER POLYFILLS
1919
*/
2020

21-
/**
22-
* IE11 requires the following for NgClass support on SVG elements
23-
*/
24-
// import 'classlist.js'; // Run `npm install --save classlist.js`.
25-
26-
/**
27-
* Web Animations `@angular/platform-browser/animations`
28-
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
29-
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
30-
*/
31-
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
32-
3321
/**
3422
* By default, zone.js will patch all possible macroTask and DomEvents
3523
* user can disable parts of macroTask/DomEvents patch by setting following flags

apps/web/src/test-setup.ts

+13
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
11
import 'jest-preset-angular/setup-jest';
2+
3+
import { getTestBed } from '@angular/core/testing';
4+
import {
5+
BrowserDynamicTestingModule,
6+
platformBrowserDynamicTesting,
7+
} from '@angular/platform-browser-dynamic/testing';
8+
9+
getTestBed().resetTestEnvironment();
10+
getTestBed().initTestEnvironment(
11+
BrowserDynamicTestingModule,
12+
platformBrowserDynamicTesting(),
13+
{ teardown: { destroyAfterEach: false } }
14+
);

apps/web/tsconfig.spec.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"types": ["jest", "node"]
77
},
88
"files": ["src/test-setup.ts"],
9-
"include": ["**/*.spec.ts", "**/*.d.ts"]
9+
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]
1010
}

libs/core/tsconfig.lib.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"declaration": true,
77
"types": ["node"]
88
},
9-
"exclude": ["**/*.spec.ts"],
9+
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
1010
"include": ["**/*.ts"]
1111
}

libs/core/tsconfig.spec.json

+4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
},
88
"include": [
99
"**/*.spec.ts",
10+
"**/*.test.ts",
1011
"**/*.spec.tsx",
12+
"**/*.test.tsx",
1113
"**/*.spec.js",
14+
"**/*.test.js",
1215
"**/*.spec.jsx",
16+
"**/*.test.jsx",
1317
"**/*.d.ts"
1418
]
1519
}

libs/interfaces/tsconfig.lib.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"declaration": true,
77
"types": ["node"]
88
},
9-
"exclude": ["**/*.spec.ts"],
9+
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
1010
"include": ["**/*.ts"]
1111
}

libs/interfaces/tsconfig.spec.json

+4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
},
88
"include": [
99
"**/*.spec.ts",
10+
"**/*.test.ts",
1011
"**/*.spec.tsx",
12+
"**/*.test.tsx",
1113
"**/*.spec.js",
14+
"**/*.test.js",
1215
"**/*.spec.jsx",
16+
"**/*.test.jsx",
1317
"**/*.d.ts"
1418
]
1519
}

nx.json

+2-23
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"default": {
1515
"runner": "@nrwl/workspace/tasks-runners/default",
1616
"options": {
17-
"cacheableOperations": ["build", "lint", "test", "e2e"]
17+
"cacheableOperations": ["build", "lint", "test", "e2e"],
18+
"parallel": 1
1819
}
1920
}
2021
},
@@ -25,27 +26,5 @@
2526
"projects": "dependencies"
2627
}
2728
]
28-
},
29-
"projects": {
30-
"core": {
31-
"tags": []
32-
},
33-
"dev-server": {
34-
"tags": ["type:app"]
35-
},
36-
"interfaces": {
37-
"tags": ["type:util", "scope:shared"]
38-
},
39-
"nodeplotlib": {
40-
"tags": [],
41-
"implicitDependencies": ["web"]
42-
},
43-
"web": {
44-
"tags": []
45-
},
46-
"web-e2e": {
47-
"tags": [],
48-
"implicitDependencies": ["web"]
49-
}
5029
}
5130
}

0 commit comments

Comments
 (0)