-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
1831 lines (1770 loc) · 76.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<title>2021 Node.js 开发者报告</title>
<meta charset="utf-8">
<!-- 引入 ECharts 文件 -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
<script src="https://gallerybox.echartsjs.com/dep/echarts/map/js/china.js"></script>
<script>
function setChart(id, idx = 1, title, list) {
const chart = echarts.init(document.getElementById(id));
const cols = Object.keys(list[0]).length - 1;
const getPie = (dimension) => ({
series: {
id: 'pie',
label: {
formatter: '{b} ({d}%)'
},
encode: {
value: dimension,
tooltip: dimension
}
}
});
chart.on('updateAxisPointer', function(event) {
var xAxisInfo = event.axesInfo[0];
if (xAxisInfo && xAxisInfo.axisIndex === 0) {
var dimension = xAxisInfo.value + 1;
chart.setOption(getPie(dimension));
}
});
chart.setOption({
legend: {},
tooltip: {
trigger: 'axis',
showContent: true,
formatter: (list) => {
const [item] = list;
if (list.length === 1 && item && item.value) {
return (item.value / 258 * 100).toFixed(2) + '%';
}
return list[0]['name'];
}
},
dataset: {
source: [
['product', ...Object.keys(list[0]).slice(0, cols)], ...(list.map(({
key
}) => key).map((key) => [key, ...((Object.entries(list.find((item) => item.key === key))).map(([_, n]) => n).slice(0, cols))]))
]
},
xAxis: [{
type: 'category'
}, {
type: 'value',
gridIndex: 1
}],
yAxis: [{
gridIndex: 0
}, {
gridIndex: 1,
type: 'category',
data: list.map(({
key
}) => key),
inverse: 1,
}],
grid: [{
top: '320px',
height: '250px',
width: '40%',
}, {
top: '40px',
height: '220px',
}],
title: [title],
series: [...Array(list.length).fill({
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}), {
stack: '全量',
xAxisIndex: 1,
yAxisIndex: 1,
type: 'bar',
data: list.map((item) => Object.entries(item).reduce((sum, [_, n]) => sum + (Number(n) || 0), 0))
}, {
type: 'pie',
id: 'pie',
radius: '20%',
center: ['75%', '460px'],
label: {
formatter: '{b}: {@2012} ({d}%)'
},
encode: {
itemName: 'product',
value: '2012',
tooltip: '2012'
}
}]
});
setTimeout(function() {
chart.setOption(getPie(idx));
chart.dispatchAction({
type: 'showTip',
seriesIndex: list.length,
dataIndex: 0
});
});
}
</script>
<style>
h3 { padding: 7px 0px; margin: 0px; font-weight: 700; font-size: 20px; line-height: 28px; }
h4 { padding: 7px 0px; margin: 0px; font-weight: 700; font-size: 16px; line-height: 24px; }
h3 a, h4 a { text-decoration: none; color: black; }
.list { list-style-type: disc; margin: 0px; padding-left: 23px; font-size: 14px; color: rgb(38, 38, 38); line-height: 1.74; letter-spacing: 0.05em; outline-style: none; overflow-wrap: break-word; }
.line { font-size: 14px; color: rgb(38, 38, 38); line-height: 1.74; letter-spacing: 0.05em; outline-style: none; overflow-wrap: break-word; margin: 0px; }
#header {
height: 55px;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 33;
border-bottom: 1px solid #eaeaea;
background: white;
color: var(--header-text-color);
}
#header-content {
width: 1000px;
margin: 15px auto 0;
}
#header-content a {
text-decoration: none;
color: black;
}
#header-content #logo {
font-weight: 400;
font-size: 1.2rem;
align-items: center;
}
#header-content span {
float: right;
padding-top: 5px;
margin-right: 20px;
}
#content {
padding-top: 55px;
width: 1000px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id='header'>
<div id='header-content'>
<a id='logo' href="https://github.com/NoderSurvey/">NoderSurvey</a>
<span><a href="./about.html">About us</a></span>
<span><a href="./index.html">Report</a></span>
<span><a href="https://github.com/NoderSurvey/reporters">Github</a></span>
</div>
</div>
<div id='content'>
<h1 id="年度报告">2021 年度报告</h1>
<div class="lake-content-editor-core lake-engine lake-typography-traditional" data-lake-element="root" data-selection-146296="%7B%22path%22%3A%5B%5B69%2C0%2C1%2C0%5D%2C%5B69%2C0%2C1%2C1%5D%5D%2C%22uuid%22%3A%22146296%22%2C%22active%22%3Atrue%7D">
<p class='line'><br></p>
<h3 id="受访者"><a href="#受访者"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 受访者</h3>
<h4 id="人物来源"><a href="#人物来源"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 人物来源</h4>
<p class='line'><br></p>
<p class='line'>本次调查问卷中,填写问卷的 <span>Node.js 开发者主要</span>年龄分布如下:</p>
<div id="main-years" style="width: 600px;height:400px; margin-top: 20px;"></div>
<script type="text/javascript">
echarts.init(document.getElementById('main-years')).setOption({
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c}'
},
legend: {
orient: 'vertical',
right: 0,
},
series: [
{
name: '姓名',
type: 'pie',
radius: '55%',
center: ['40%', '50%'],
data: [{
name: '<22 岁 (5.04%)',
value: 13
}, {
name: '22~24 岁 (18.22%)',
value: 47
}, {
name: '25~27 岁 (33.33%)',
value: 86,
selected: true
}, {
name: '28~32 岁 (33.72%)',
value: 87
}, {
name: '>32 岁 (9.67%)',
value: 25
}],
}
]
});
</script>
<p class='line'><br></p>
<h4 id="职业简历"><a href="#职业简历"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 职业简历</h4>
<p class='line'><br></p>
<ul lake-indent="0" class="list">
<li>典型的受访者来自两种公司,分别是百人左右的中小型公司,以及 5k 人以上的大公司。</li>
<li>他们通常是 7 人左右的团队内的前端或者全栈工程师。</li>
<li>相比去年,今年的后端工程师比率有较高提升(约 10%)。</li>
</ul>
<p class='line'><span data-card-type="inline" data-lake-card="image"><img data-role="image" src="https://img.alicdn.com/imgextra/i3/O1CN01VdnatA1G2oVT6ODr8_!!6000000000565-0-tps-800-520.jpg" class="image lake-drag-image" alt="image.png" title="image.png"></span></p>
<p class='line'><br></p>
<h3 id="工作内容"><a href="#工作内容"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 工作内容</h3>
<h4 id="应用场景"><a href="#应用场景"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 应用场景</h4>
<p class='line'><br></p>
<ul lake-indent="0" class="list">
<li>开发者使用 Node.js 一般用于 to B 业务。</li>
<li>大公司内会有更多的人使用 Node.js 开发内部运行系统 & 自动化工具。</li>
</ul>
<div id="canvas-company" style="width: 800px;height:800px; margin-top: 20px;"></div>
<script type="text/javascript">
const companyChart = echarts.init(document.getElementById('canvas-company'));
companyChart.on('updateAxisPointer', function(event) {
var xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
var dimension = xAxisInfo.value + 1;
companyChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b}: {@[' + dimension + ']} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: dimension,
tooltip: dimension
}
}
});
}
});
companyChart.setOption({
legend: {
orient: 'vertical',
left: 50,
top: 50,
},
tooltip: {
trigger: 'axis',
showContent: false
},
dataset: {
source: [
[ 'product', '1人', '2-10人', '11-50人', '51-500人', '501-1000人', '1001-5000人', '大于 5000人' ],
[ 'to c 应用', 2, 6, 21, 36, 13, 16, 39 ],
[ 'to b 应用', 1, 9, 22, 37, 9, 20, 53 ],
[ '内部运营系统', undefined, 8, 21, 32, 10, 19, 53 ],
[ '自动化工具', undefined, 1, 13, 21, 5, 17, 41 ],
[ '其他', 3, 1, 1, 7, 0, 2, 5 ]
]
},
xAxis: {
type: 'category'
},
yAxis: {
gridIndex: 0
},
grid: {
top: '55%'
},
series: [{
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'pie',
id: 'pie',
radius: '30%',
center: ['50%', '25%'],
label: {
formatter: '{b}: {@2012} ({d}%)'
},
encode: {
itemName: 'product',
value: '2012',
tooltip: '2012'
}
}]
});
setTimeout(function() {
companyChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b}: {@[' + 7 + ']} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: 7,
tooltip: 7
}
}
});
}, 10);
</script>
<h4 id="开发场景"><a href="#开发场景"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 开发场景</h4>
<p class='line'><br></p>
<ul lake-indent="0" class="list">
<li>2021 年整体而言有 81% (6%↓) 的开发者使用 Node.js 开发 Web API,有 41% (10%↓) 的人开发 CLI & 工具。</li>
<li>随着使用年限增加将 Node.js 作为服务端 API 的比率逐级下降而开发微服务 (7%↑) 和 CLI & 工具 (4%↑) 的场景逐渐增长。</li>
<li>1~3 年经验的开发者更愿意在 SSR 场景中使用 Node.js。</li>
</ul>
<div id="canvas-sence" style="width: 800px;height:800px; margin-top: 0px;"></div>
<script type="text/javascript">
const senceChart = echarts.init(document.getElementById('canvas-sence'));
senceChart.on('updateAxisPointer', function(event) {
var xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
var dimension = xAxisInfo.value + 1;
senceChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b}: {@[' + dimension + ']} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: dimension,
tooltip: dimension
}
}
});
}
});
senceChart.setOption({
legend: {
orient: 'vertical',
left: 50,
top: 50,
},
tooltip: {
trigger: 'axis',
showContent: false
},
dataset: {
source: [
[ 'product', '0~1 年', '1~3 年', '3~5 年', '5~10年' ],
[ 'Web API', 26, 60, 77, 46 ],
[ 'BFF 层', 7, 20, 35, 24 ],
[ 'Proxy 层', 4, 13, 27, 11 ],
[ 'CLI & 工具', 8, 27, 39, 33 ],
[ '定时任务', 2, 19, 30, 21 ],
[ 'SSR 应用', 2, 22, 25, 20 ],
[ '微服务', 4, 14, 31, 28 ],
[ '其他', 4, 5, 2, 2 ],
[ '代码片段', 0, 2, 6, 4 ]
]
},
xAxis: {
type: 'category'
},
yAxis: {
gridIndex: 0
},
grid: {
top: '55%'
},
series: [{
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'line',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'pie',
id: 'pie',
radius: '30%',
center: ['50%', '25%'],
label: {
formatter: '{b}: {@2012} ({d}%)'
},
encode: {
itemName: 'product',
value: '2012',
tooltip: '2012'
}
}]
});
setTimeout(function() {
senceChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b}: {@[' + 1 + ']} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: 1,
tooltip: 1
}
}
});
});
</script>
<p class='line'><br></p>
<h3 id="开发流程"><a href="#开发流程"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 开发流程</h3>
<h4 id="代码转译"><a href="#代码转译"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 代码转译</h4>
<ul lake-indent="0" class="list">
<li>去年 0~1 年的开发者有 45% 不转译,今年大部分开发者都会转译。</li>
<li>TypeScript 是最常用的转译语言。</li>
</ul>
<div id="canvas-trans" style="width: 800px;height:600px; margin-top: 0px;"></div>
<script type="text/javascript">
const transChart = echarts.init(document.getElementById('canvas-trans'));
transChart.on('updateAxisPointer', function(event) {
var xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
var dimension = xAxisInfo.value + 1;
transChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: dimension,
tooltip: dimension
}
}
});
}
});
transChart.setOption({
legend: {
orient: 'vertical',
left: 50,
top: 50,
},
tooltip: {
trigger: 'axis',
showContent: false
},
dataset: {
source: [
[ 'product', '0~1 年', '1~3 年', '3~5 年', '5~10年' ],
[ 'TypeScript', 19, 57, 72, 43 ],
[ 'Babel', 23, 42, 43, 20 ],
[ '不转译', 9, 15, 22, 8 ],
[ 'Dart', undefined, 4, 3, undefined ],
[ 'ClojureScript', undefined, undefined, 1, 2 ],
[ 'Haxe', undefined, 1, undefined, undefined ],
[ '其他', 0, 1, 0, 0 ]
]
},
xAxis: {
type: 'category'
},
yAxis: {
gridIndex: 0
},
grid: {
top: '55%'
},
series: [{
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'pie',
id: 'pie',
radius: '30%',
center: ['50%', '25%'],
label: {
formatter: '{b}: {@2012} ({d}%)'
},
encode: {
itemName: 'product',
value: '2012',
tooltip: '2012'
}
}]
});
setTimeout(function() {
transChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: 4,
tooltip: 4
}
}
});
}, 10);
</script>
<p class='line'><br></p>
<h4 id="代码检查"><a href="#代码检查"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 代码检查</h4>
<p class='line'><br></p>
<ul lake-indent="0" class="list">
<li>整体上有 88% 的 Node.js 开发者使用 ESLint。</li>
<li>8-20 人规模的团队 TSLint 的使用率最高。</li>
</ul>
<div id="canvas-linter" style="width: 800px;height:500px; margin-top: 0px;"></div>
<script type="text/javascript">
const linterChart = echarts.init(document.getElementById('canvas-linter'));
linterChart.on('updateAxisPointer', function(event) {
var xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
var dimension = xAxisInfo.value + 1;
linterChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: dimension,
tooltip: dimension
}
}
});
}
});
linterChart.setOption({
legend: {
orient: 'vertical',
left: 50,
top: 50,
},
tooltip: {
trigger: 'axis',
showContent: false
},
dataset: {
source: [
[ 'product', '1人', '2-7人', '8-12人', '13-20人', '21-40人', '40-100人', '大于100人' ],
[ 'ESLint', 22, 71, 36, 22, 25, 23, 29 ],
[ 'TSLint', 6, 27, 20, 13, 10, 11, 10 ],
[ 'JSDoc', 1, 7, 5, 5, undefined, 1, 3 ],
[ 'Standard', 2, 7, 3, 2, 3, 3, 3 ],
[ 'JSHint', undefined, 3, 2, undefined, 2, undefined, 2 ],
[ '其他', 4, 11, 1, 0, 1, 0, 2 ],
[ 'JSCS', undefined, undefined, 1, undefined, undefined, undefined, 1 ],
[ 'Flow', undefined, undefined, 1, undefined, undefined, undefined, 1 ]
]
},
xAxis: {
type: 'category'
},
yAxis: {
gridIndex: 0
},
grid: {
top: '55%'
},
series: [{
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'bar',
stack: '总量',
smooth: true,
seriesLayoutBy: 'row'
}, {
type: 'pie',
id: 'pie',
radius: '30%',
center: ['50%', '25%'],
label: {
formatter: '{b}: {@2012} ({d}%)'
},
encode: {
itemName: 'product',
value: '2012',
tooltip: '2012'
}
}]
});
setTimeout(function() {
linterChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b} ({d}%)'
},
center: ['60%', '25%'],
encode: {
value: 4,
tooltip: 4
}
}
});
}, 10);
</script>
<h4 id="配置方式"><a href="#配置方式"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 配置方式</h4>
<p class='line'><br></p>
<ul lake-indent="0" class="list">
<li>文件配置是最流行的配置方式。</li>
<li>虽然配置中心使用概率不高,不过公司规模越大则配置中心的使用概率越高。</li>
</ul>
<div id="canvas-cfg" style="width: 700px;height:300px; margin-top: 0px;"></div>
<script type="text/javascript">
const cfgChart = echarts.init(document.getElementById('canvas-cfg'));
cfgChart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: ([item]) => {
return (item.value / 258 * 100).toFixed(2) + '%';
}
},
grid: [{
top: 30,
bottom: 30,
left: 10,
containLabel: true
}],
xAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
yAxis: {
type: 'category',
data: [
'文件配置', '环境变量配置', '配置中心 (如 zookeeper 等)', '数据库配置'
],
inverse: true
},
series: [{
name: '数据',
type: 'bar',
color: '#60a0a8',
data: [ 182, 142, 82, 59 ]
}]
});
setTimeout(function(){
cfgChart.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: 0
});
}, 1000);
</script>
<p class='line'><br></p>
<h4 id="编辑器"><a href="#编辑器"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 编辑器</h4>
<p class='line'><br></p>
<ul lake-indent="0" class="list">
<li>VS Code 一骑绝尘,是 Node.js 开发者最喜爱开发工具</li>
</ul>
<p class='line'><br></p>
<div id="canvas-ide" style="width: 700px;height:400px; margin-top: 0px;"></div>
<script type="text/javascript">
const ideData = {
'VS Code': 231,
WebStorm: 60,
Vim: 27,
Sublime: 23,
'intellij IDEA': 21,
Emacs: 4,
Atom: 4,
Eclipse: 2,
'其他': 4,
};
tool = echarts.init(document.getElementById('canvas-ide'));
tool.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: ([item]) => {
return (item.value / 258 * 100).toFixed(2) + '%';
}
},
grid: [{
top: 30,
bottom: 50,
left: 10,
containLabel: true
}],
xAxis: {
type: 'value',
},
grid: [{
top: 0,
bottom: 0,
left: 10,
containLabel: true
}],
yAxis: {
type: 'category',
data: Object.keys(ideData),
inverse: true
},
series: [{
name: '数据',
type: 'bar',
color: '#91c7ae',
data: Object.keys(ideData).map((key) => ideData[key])
}]
});
setTimeout(function(){
tool.dispatchAction({
type: 'showTip',
seriesIndex:0, // 显示第几个series
dataIndex: 0 // 显示第几个数据
});
});
</script>
<h4 id="进程管理"><a href="#进程管理"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 进程管理</h4>
<p class='line'><br></p>
<ul lake-indent="0" class="list">
<li>K8s & Docker 已经十分流行了。</li>
<li>中型公司使用 PM2 的比例更高。</li>
<li>规模越小越乐于尝试 Serverless 的部署方式。</li>
</ul>
<p class='line'><br></p>
<div id="canvas-process" style="width: 1100px;height:650px; margin-top: 0px;"></div>
<script type="text/javascript">
setChart('canvas-process', 2, {
text: '不同规模公司使用的进程管理方式',
bottom: 0,
left: '50%',
textAlign: 'center'
}, [
{
'1人': 3,
'2-10人': 10,
'11-50人': 29,
'51-500人': 43,
'501-1000人': 15,
'1001-5000人': 22,
'大于 5000人': 31,
key: 'PM2'
},
{
'1人': 2,
'2-10人': 8,
'11-50人': 12,
'51-500人': 27,
'501-1000人': 6,
'1001-5000人': 22,
'大于 5000人': 39,
key: 'Docker'
},
{
'1人': 0,
'2-10人': 2,
'11-50人': 7,
'51-500人': 20,
'501-1000人': 7,
'1001-5000人': 16,
'大于 5000人': 29,
key: 'k8s'
},
{
'1人': 0,
'2-10人': 2,
'11-50人': 3,
'51-500人': 6,
'501-1000人': 0,
'1001-5000人': 1,
'大于 5000人': 19,
key: 'Serverless'
},
{
'1人': 1,
'2-10人': 1,
'11-50人': 3,
'51-500人': 4,
'501-1000人': 0,
'1001-5000人': 2,
'大于 5000人': 2,
key: 'supervisor (Node)'
},
{
'1人': 1,
'2-10人': 0,
'11-50人': 3,
'51-500人': 3,
'501-1000人': 1,
'1001-5000人': 0,
'大于 5000人': 4,
key: 'forever'
},
{
'1人': 0,
'2-10人': 0,
'11-50人': 1,
'51-500人': 1,
'501-1000人': 1,
'1001-5000人': 0,
'大于 5000人': 4,
key: '其他'
},
{
'1人': 0,
'2-10人': 0,
'11-50人': 0,
'51-500人': 0,
'501-1000人': 0,
'1001-5000人': 1,
'大于 5000人': 2,
key: 'Supervisord (Unix)'
},
{
'1人': 0,
'2-10人': 0,
'11-50人': 0,
'51-500人': 0,
'501-1000人': 0,
'1001-5000人': 0,
'大于 5000人': 1,
key: 'naught'
}
]
);
</script>
<p class='line'><br></p>
<h4 id="部署方式"><a href="#部署方式"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" class="anchor-icon"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a> 部署方式</h4>
<p class='line'><br></p>
<div id="canvas-os" style="width: 700px; height:150px; margin-top: 0px;"></div>
<script type="text/javascript">
const osData = {
'Docker 容器': 132,
'物理机': 96,
'虚拟机': 92,
'k8s 容器编排': 78,
'Serverless 平台': 48,
};
const osChart = echarts.init(document.getElementById('canvas-os'));
osChart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},