Skip to content

Commit 646b453

Browse files
committed
feat: github icon, mat-drawer, fix plot add
1 parent 2fe54ec commit 646b453

35 files changed

+365
-489
lines changed

angular.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,57 @@
11
{
22
"version": 1,
33
"projects": {
4+
"dev-server": {
5+
"root": "apps/dev-server",
6+
"sourceRoot": "apps/dev-server/src",
7+
"projectType": "application",
8+
"architect": {
9+
"build": {
10+
"builder": "@nrwl/node:build",
11+
"outputs": ["{options.outputPath}"],
12+
"options": {
13+
"outputPath": "dist/apps/dev-server",
14+
"main": "apps/dev-server/src/main.ts",
15+
"tsConfig": "apps/dev-server/tsconfig.app.json",
16+
"assets": ["apps/dev-server/src/assets"]
17+
},
18+
"configurations": {
19+
"production": {
20+
"optimization": true,
21+
"extractLicenses": true,
22+
"inspect": false,
23+
"fileReplacements": [
24+
{
25+
"replace": "apps/dev-server/src/environments/environment.ts",
26+
"with": "apps/dev-server/src/environments/environment.prod.ts"
27+
}
28+
]
29+
}
30+
}
31+
},
32+
"serve": {
33+
"builder": "@nrwl/node:execute",
34+
"options": {
35+
"buildTarget": "dev-server:build"
36+
}
37+
},
38+
"lint": {
39+
"builder": "@nrwl/linter:eslint",
40+
"outputs": ["{options.outputFile}"],
41+
"options": {
42+
"lintFilePatterns": ["apps/dev-server/**/*.ts"]
43+
}
44+
},
45+
"test": {
46+
"builder": "@nrwl/jest:jest",
47+
"outputs": ["coverage/apps/dev-server"],
48+
"options": {
49+
"jestConfig": "apps/dev-server/jest.config.js",
50+
"passWithNoTests": true
51+
}
52+
}
53+
}
54+
},
455
"interfaces": {
556
"root": "libs/interfaces",
657
"sourceRoot": "libs/interfaces/src",

apps/dev-server/.eslintrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

apps/dev-server/jest.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
displayName: 'dev-server',
3+
preset: '../../jest.preset.js',
4+
globals: {
5+
'ts-jest': {
6+
tsconfig: '<rootDir>/tsconfig.spec.json',
7+
},
8+
},
9+
testEnvironment: 'node',
10+
transform: {
11+
'^.+\\.[tj]s$': 'ts-jest',
12+
},
13+
moduleFileExtensions: ['ts', 'js', 'html'],
14+
coverageDirectory: '../../coverage/apps/dev-server',
15+
};

apps/dev-server/src/assets/.gitkeep

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true,
3+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: false,
3+
};

apps/dev-server/src/main.ts

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/**
2+
* This is not a production server yet!
3+
* This is only a minimal backend to get started.
4+
*/
5+
6+
import { Layout, Plot, plot, bootstrap } from 'nodeplotlib';
7+
import { PlotType } from 'plotly.js';
8+
9+
(async () => {
10+
await bootstrap(3333, false);
11+
12+
// bootstrap();
13+
const trace1: Plot = {
14+
x: [
15+
'2017-01-04',
16+
'2017-01-05',
17+
'2017-01-06',
18+
'2017-01-09',
19+
'2017-01-10',
20+
'2017-01-11',
21+
'2017-01-12',
22+
'2017-01-13',
23+
'2017-01-17',
24+
'2017-01-18',
25+
'2017-01-19',
26+
'2017-01-20',
27+
'2017-01-23',
28+
'2017-01-24',
29+
'2017-01-25',
30+
'2017-01-26',
31+
'2017-01-27',
32+
'2017-01-30',
33+
'2017-01-31',
34+
'2017-02-01',
35+
'2017-02-02',
36+
'2017-02-03',
37+
'2017-02-06',
38+
'2017-02-07',
39+
'2017-02-08',
40+
'2017-02-09',
41+
'2017-02-10',
42+
'2017-02-13',
43+
'2017-02-14',
44+
'2017-02-15',
45+
],
46+
close: [
47+
116.019997, 116.610001, 117.910004, 118.989998, 119.110001, 119.75,
48+
119.25, 119.040001, 120, 119.989998, 119.779999, 120, 120.080002,
49+
119.970001, 121.879997, 121.940002, 121.949997, 121.629997, 121.349998,
50+
128.75, 128.529999, 129.080002, 130.289993, 131.529999, 132.039993,
51+
132.419998, 132.119995, 133.289993, 135.020004, 135.509995,
52+
],
53+
decreasing: { line: { color: '#7F7F7F' } },
54+
high: [
55+
116.510002, 116.860001, 118.160004, 119.43, 119.379997, 119.93,
56+
119.300003, 119.620003, 120.239998, 120.5, 120.089996, 120.449997,
57+
120.809998, 120.099998, 122.099998, 122.440002, 122.349998, 121.629997,
58+
121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996,
59+
132.220001, 132.449997, 132.940002, 133.820007, 135.089996, 136.270004,
60+
],
61+
increasing: { line: { color: '#17BECF' } },
62+
line: { color: 'rgba(31,119,180,1)' },
63+
low: [
64+
115.75, 115.809998, 116.470001, 117.940002, 118.300003, 118.599998,
65+
118.209999, 118.809998, 118.220001, 119.709999, 119.370003, 119.730003,
66+
119.769997, 119.5, 120.279999, 121.599998, 121.599998, 120.660004,
67+
120.620003, 127.010002, 127.779999, 128.160004, 128.899994, 130.449997,
68+
131.220001, 131.119995, 132.050003, 132.75, 133.25, 134.619995,
69+
],
70+
open: [
71+
115.849998, 115.919998, 116.779999, 117.949997, 118.769997, 118.739998,
72+
118.900002, 119.110001, 118.339996, 120, 119.400002, 120.449997, 120,
73+
119.550003, 120.419998, 121.669998, 122.139999, 120.93, 121.150002,
74+
127.029999, 127.980003, 128.309998, 129.130005, 130.539993, 131.350006,
75+
131.649994, 132.460007, 133.080002, 133.470001, 135.520004,
76+
],
77+
type: 'candlestick' as PlotType,
78+
xaxis: 'x',
79+
yaxis: 'y',
80+
} as Plot;
81+
82+
const data = [trace1];
83+
84+
const layout = {
85+
dragmode: 'zoom',
86+
margin: {
87+
r: 10,
88+
t: 25,
89+
b: 40,
90+
l: 60,
91+
},
92+
showlegend: false,
93+
xaxis: {
94+
autorange: true,
95+
domain: [0, 1],
96+
range: ['2017-01-03 12:00', '2017-02-15 12:00'],
97+
rangeslider: { range: ['2017-01-03 12:00', '2017-02-15 12:00'] },
98+
title: 'Date',
99+
type: 'date',
100+
},
101+
yaxis: {
102+
autorange: true,
103+
domain: [0, 1],
104+
range: [114.609999778, 137.410004222],
105+
type: 'linear',
106+
},
107+
} as Layout;
108+
109+
plot(data, layout);
110+
})();

apps/dev-server/tsconfig.app.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["node"],
7+
"emitDecoratorMetadata": true,
8+
"target": "es2015"
9+
},
10+
"exclude": ["**/*.spec.ts"],
11+
"include": ["**/*.ts"]
12+
}

apps/dev-server/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"files": [],
4+
"include": [],
5+
"references": [
6+
{
7+
"path": "./tsconfig.app.json"
8+
},
9+
{
10+
"path": "./tsconfig.spec.json"
11+
}
12+
]
13+
}

apps/dev-server/tsconfig.spec.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["jest", "node"]
7+
},
8+
"include": ["**/*.spec.ts", "**/*.d.ts"]
9+
}

0 commit comments

Comments
 (0)