-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
188 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
src/app/maturity/maturity.component.ts → ...esentation/maturity/maturity.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p>reporter works!</p> | ||
|
||
<component-markdown-reporter></component-markdown-reporter> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ReporterComponent } from './reporter.component'; | ||
|
||
describe('ReporterComponent', () => { | ||
let component: ReporterComponent; | ||
let fixture: ComponentFixture<ReporterComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ReporterComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ReporterComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-reporter', | ||
templateUrl: './reporter.component.html', | ||
styleUrls: ['./reporter.component.scss'] | ||
}) | ||
export class ReporterComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
src/app/shared/components/markdown-reporter/markdown-reporter.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="reporter" #reporter> | ||
|
||
</div> |
6 changes: 6 additions & 0 deletions
6
src/app/shared/components/markdown-reporter/markdown-reporter.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.reporter { | ||
width: auto; | ||
height: auto; | ||
min-width: 300px; | ||
min-height: 300px; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/shared/components/markdown-reporter/markdown-reporter.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MarkdownReporterComponent } from './markdown-reporter.component'; | ||
|
||
describe('MarkdownReporterComponent', () => { | ||
let component: MarkdownReporterComponent; | ||
let fixture: ComponentFixture<MarkdownReporterComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ MarkdownReporterComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MarkdownReporterComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
82 changes: 82 additions & 0 deletions
82
src/app/shared/components/markdown-reporter/markdown-reporter.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; | ||
import * as echarts from 'echarts'; | ||
|
||
@Component({ | ||
selector: 'component-markdown-reporter', | ||
templateUrl: './markdown-reporter.component.html', | ||
styleUrls: ['./markdown-reporter.component.scss'] | ||
}) | ||
export class MarkdownReporterComponent implements OnInit, AfterViewInit { | ||
@ViewChild('reporter', {}) reporter: ElementRef; | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
ngAfterViewInit(): void { | ||
const myChart = echarts.init(this.reporter.nativeElement); | ||
myChart.setOption({ | ||
backgroundColor: '#2c343c', | ||
|
||
title: { | ||
text: 'Customized Pie', | ||
left: 'center', | ||
top: 20, | ||
textStyle: { | ||
color: '#ccc' | ||
} | ||
}, | ||
|
||
tooltip: { | ||
trigger: 'item', | ||
formatter: '{a} <br/>{b} : {c} ({d}%)' | ||
}, | ||
visualMap: { | ||
show: false, | ||
min: 80, | ||
max: 600, | ||
inRange: { | ||
colorLightness: [0, 1] | ||
} | ||
}, | ||
series: [ | ||
{ | ||
name: '访问来源', | ||
type: 'pie', | ||
radius: '55%', | ||
center: ['50%', '50%'], | ||
data: [ | ||
{value: 335, name: '直接访问'}, | ||
{value: 310, name: '邮件营销'}, | ||
{value: 274, name: '联盟广告'}, | ||
{value: 235, name: '视频广告'}, | ||
{value: 400, name: '搜索引擎'} | ||
].sort((a, b) => a.value - b.value), | ||
roseType: 'radius', | ||
label: { | ||
color: 'rgba(255, 255, 255, 0.3)' | ||
}, | ||
labelLine: { | ||
lineStyle: { | ||
color: 'rgba(255, 255, 255, 0.3)' | ||
}, | ||
smooth: 0.2, | ||
length: 10, | ||
length2: 20 | ||
}, | ||
itemStyle: { | ||
color: '#c23531', | ||
shadowBlur: 200, | ||
shadowColor: 'rgba(0, 0, 0, 0.5)' | ||
}, | ||
|
||
animationType: 'scale', | ||
animationEasing: 'elasticOut', | ||
animationDelay: idx => Math.random() * 200 | ||
} | ||
] | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3048,6 +3048,13 @@ ecc-jsbn@~0.1.1: | |
jsbn "~0.1.0" | ||
safer-buffer "^2.1.0" | ||
|
||
echarts@^4.6.0: | ||
version "4.6.0" | ||
resolved "https://registry.yarnpkg.com/echarts/-/echarts-4.6.0.tgz#b5a47a1046cec93ceeef954f9ee54751340558ec" | ||
integrity sha512-xKkcr6v9UVOSF+PMuj7Ngt3bnzLwN1sSXWCvpvX+jYb3mePYsZnABq7wGkPac/m0nV653uGHXoHK8DCKCprdNg== | ||
dependencies: | ||
zrender "4.2.0" | ||
|
||
[email protected]: | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" | ||
|
@@ -8796,3 +8803,8 @@ zone.js@~0.10.2: | |
version "0.10.2" | ||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.10.2.tgz#67ca084b3116fc33fc40435e0d5ea40a207e392e" | ||
integrity sha512-UAYfiuvxLN4oyuqhJwd21Uxb4CNawrq6fPS/05Su5L4G+1TN+HVDJMUHNMobVQDFJRir2cLAODXwluaOKB7HFg== | ||
|
||
[email protected]: | ||
version "4.2.0" | ||
resolved "https://registry.yarnpkg.com/zrender/-/zrender-4.2.0.tgz#d001302e155f28de1f9fc7fcd5c254bad28471cf" | ||
integrity sha512-YJ9hxt5uFincYYU3KK31+Ce+B6PJmYYK0Q9fQ6jOUAoC/VHbe4kCKAPkxKeT7jGTxrK5wYu18R0TLGqj2zbEOA== |