| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8081395 commit 95eda73
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | * @Description: | |
| 3 | 3 | * @Date: 2020-05-07 11:57:49 | |
| 4 | 4 | * @LastEditors: tanmh | |
| 5 | - * @LastEditTime: 2020-12-01 17:49:55 | ||
| 5 | + * @LastEditTime: 2020-12-02 09:55:59 | ||
| 6 | 6 | --> | |
| 7 | 7 | # NgxG2plot | |
| 8 | 8 | ||
@@ -167,6 +167,7 @@ See the official documentation for all methods of charting: https://g2plot.antv. | |||
| 167 | 167 | -|-|-|- | |
| 168 | 168 | starkG2plotArea | Area - 面积图 | g2plotArea | G2plotAreaModule | |
| 169 | 169 | starkG2plotBar | Bar - 基础条形图 | g2plotBar | G2plotBarModule | |
| 170 | + starkG2plotBidirectionalBar | BidirectionalBar - 对称条形图 | g2plotBidirectionalBar | G2plotBidirectionalBarModule | ||
| 170 | 171 | starkG2plotBox | Box - 箱图 | g2plotBox | G2plotBoxModule | |
| 171 | 172 | starkG2plotBullet | Bullet - 子弹图 | g2plotBullet | G2plotBulletModule | |
| 172 | 173 | starkG2plotColumn | Column - 柱状图 | g2plotColumn | G2plotColumnModule | |
@@ -178,13 +179,20 @@ starkG2plotHistogram | Histogram - 直方图 | g2plotHistogram | G2plotHistogra | |||
| 178 | 179 | starkG2plotLine | Line - 折线图 | g2plotLine | G2plotLineModule | |
| 179 | 180 | starkG2plotLiquid | Liquid - 水波图 | g2plotLiquid | G2plotLiquidModule | |
| 180 | 181 | starkG2plotPie | Pie - 饼图 | g2plotPie | G2plotPieModule | |
| 182 | + starkG2plotRadialBar | RadialBar - 玉珏图 | g2plotRadialBar | G2plotRadialBarModule | ||
| 181 | 183 | starkG2plotRadar | Radar - 雷达图 | g2plotRadar | G2plotRadarModule | |
| 182 | 184 | starkG2plotRose | Rose - 玫瑰图 | g2plotRose | G2plotRoseModule | |
| 183 | 185 | starkG2plotScatter | Scatter - 散点图 | g2plotScatter | G2plotScatterModule | |
| 186 | + starkG2plotStock | Stock - 股票图 | g2plotStock | G2plotStockModule | ||
| 187 | + starkG2plotSunburst | Sunburst - 旭日图图 | g2plotSunburst | G2plotSunburstModule | ||
| 184 | 188 | starkG2plotTinyColumn | TinyColumn - 迷你图 | g2plotTinyColumn | G2plotTinyColumnModule | |
| 185 | 189 | starkG2plotWaterfall | Waterfall - 瀑布图 | g2plotWaterfall | G2plotWaterfallModule | |
| 186 | 190 | starkG2plotWordCloud | WordCloud - 词云 | g2plotWordCloud | G2plotWordCloudModule | |
| 187 | 191 | ||
| 192 | + ### 关于命名 | ||
| 193 | + | ||
| 194 | + 指令名为 `starkG2plot` + `官方图表名称`, exportAs导出为`g2plot` + `官方图表名称`, Module为 `G2plot` + `官方图表名称` + `Module` | ||
| 195 | + | ||
| 188 | 196 | ## g2plot官方文档地址 -- G2plot official document address | |
| 189 | 197 | https://g2plot.antv.vision/zh/docs/manual/introduction | |
| 190 | 198 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -147,12 +147,13 @@ If you need to get the current diagram instance and all its properties and metho | |||
| 147 | 147 | ||
| 148 | 148 | See the official documentation for all methods of charting: https://g2plot.antv.vision/zh/docs/manual/plot-api | |
| 149 | 149 | ||
| 150 | - ## 所有指令列表 -- All Directive | ||
| 150 | + ## 所有指令列表 -- All Directive | ||
| 151 | 151 | ||
| 152 | 152 | 指令名/Directive | 图表名 | exportAs | Module | |
| 153 | 153 | -|-|-|- | |
| 154 | 154 | starkG2plotArea | Area - 面积图 | g2plotArea | G2plotAreaModule | |
| 155 | 155 | starkG2plotBar | Bar - 基础条形图 | g2plotBar | G2plotBarModule | |
| 156 | + starkG2plotBidirectionalBar | BidirectionalBar - 对称条形图 | g2plotBidirectionalBar | G2plotBidirectionalBarModule | ||
| 156 | 157 | starkG2plotBox | Box - 箱图 | g2plotBox | G2plotBoxModule | |
| 157 | 158 | starkG2plotBullet | Bullet - 子弹图 | g2plotBullet | G2plotBulletModule | |
| 158 | 159 | starkG2plotColumn | Column - 柱状图 | g2plotColumn | G2plotColumnModule | |
@@ -164,13 +165,19 @@ starkG2plotHistogram | Histogram - 直方图 | g2plotHistogram | G2plotHistogra | |||
| 164 | 165 | starkG2plotLine | Line - 折线图 | g2plotLine | G2plotLineModule | |
| 165 | 166 | starkG2plotLiquid | Liquid - 水波图 | g2plotLiquid | G2plotLiquidModule | |
| 166 | 167 | starkG2plotPie | Pie - 饼图 | g2plotPie | G2plotPieModule | |
| 168 | + starkG2plotRadialBar | RadialBar - 玉珏图 | g2plotRadialBar | G2plotRadialBarModule | ||
| 167 | 169 | starkG2plotRadar | Radar - 雷达图 | g2plotRadar | G2plotRadarModule | |
| 168 | 170 | starkG2plotRose | Rose - 玫瑰图 | g2plotRose | G2plotRoseModule | |
| 169 | 171 | starkG2plotScatter | Scatter - 散点图 | g2plotScatter | G2plotScatterModule | |
| 172 | + starkG2plotStock | Stock - 股票图 | g2plotStock | G2plotStockModule | ||
| 173 | + starkG2plotSunburst | Sunburst - 旭日图图 | g2plotSunburst | G2plotSunburstModule | ||
| 170 | 174 | starkG2plotTinyColumn | TinyColumn - 迷你图 | g2plotTinyColumn | G2plotTinyColumnModule | |
| 171 | 175 | starkG2plotWaterfall | Waterfall - 瀑布图 | g2plotWaterfall | G2plotWaterfallModule | |
| 172 | 176 | starkG2plotWordCloud | WordCloud - 词云 | g2plotWordCloud | G2plotWordCloudModule | |
| 173 | 177 | ||
| 178 | + ### 关于命名 | ||
| 179 | + | ||
| 180 | + 指令名为 `starkG2plot` + `官方图表名称`, exportAs导出为`g2plot` + `官方图表名称`, Module为 `G2plot` + `官方图表名称` + `Module` | ||
| 174 | 181 | ## g2plot官方文档地址 -- G2plot official document address | |
| 175 | 182 | https://g2plot.antv.vision/zh/docs/manual/introduction | |
| 176 | 183 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,14 @@ | |||
| 1 | + /* | ||
| 2 | + * @Description: | ||
| 3 | + * @Date: 2020-12-02 09:49:11 | ||
| 4 | + * @LastEditors: tanmh | ||
| 5 | + * @LastEditTime: 2020-12-02 09:54:42 | ||
| 6 | + */ | ||
| 7 | + import { G2plotBidirectionalBarDirective } from './g2plot-bidirectional-bar.directive'; | ||
| 8 | + | ||
| 9 | + describe('G2plotBidirectionalBarDirective', () => { | ||
| 10 | + it('should create an instance', () => { | ||
| 11 | + const directive = new G2plotBidirectionalBarDirective(); | ||
| 12 | + expect(directive).toBeTruthy(); | ||
| 13 | + }); | ||
| 14 | + }); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,52 @@ | |||
| 1 | + /* | ||
| 2 | + * @Description: BidirectionalBar图表指令 | ||
| 3 | + * @Date: 2020-11-27 10:07:48 | ||
| 4 | + * @LastEditors: tanmh | ||
| 5 | + * @LastEditTime: 2020-12-02 09:51:38 | ||
| 6 | + */ | ||
| 7 | + import { Directive, ElementRef, Input, AfterViewInit } from '@angular/core'; | ||
| 8 | + import { BidirectionalBar, BidirectionalBarOptions } from '@antv/g2plot'; | ||
| 9 | + @Directive({ | ||
| 10 | + selector: '[starkG2plotBidirectionalBar]', | ||
| 11 | + exportAs: 'g2plotBidirectionalBar' | ||
| 12 | + }) | ||
| 13 | + export class G2plotBidirectionalBarDirective implements AfterViewInit { | ||
| 14 | + | ||
| 15 | + @Input() options: BidirectionalBarOptions; | ||
| 16 | + | ||
| 17 | + public instance: BidirectionalBar; | ||
| 18 | + | ||
| 19 | + constructor( | ||
| 20 | + private elementRef: ElementRef | ||
| 21 | + ) { } | ||
| 22 | + | ||
| 23 | + ngAfterViewInit(): void { | ||
| 24 | + const hostElement = this.elementRef.nativeElement; | ||
| 25 | + this.instance = new BidirectionalBar(hostElement, this.options); | ||
| 26 | + this.instance.render(); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 通过这个方法,可以增量的更新图表配置 | ||
| 31 | + * @param options | ||
| 32 | + */ | ||
| 33 | + update(options: BidirectionalBarOptions): void { | ||
| 34 | + this.instance.update(options); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 通过这个方法,可以修改图表的数据,并自动重新渲染 | ||
| 39 | + * @param newData | ||
| 40 | + */ | ||
| 41 | + changeData(newData: Array<object>): void { | ||
| 42 | + this.instance.changeData(newData); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 完全销毁整个画布,回收所有资源,仅仅保留传入的 DOM container 容器 | ||
| 47 | + */ | ||
| 48 | + destroy(): void { | ||
| 49 | + this.instance.destroy(); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,17 @@ | |||
| 1 | + /* | ||
| 2 | + * @Description: | ||
| 3 | + * @Date: 2020-12-02 09:48:38 | ||
| 4 | + * @LastEditors: tanmh | ||
| 5 | + * @LastEditTime: 2020-12-02 09:55:29 | ||
| 6 | + */ | ||
| 7 | + import { NgModule } from '@angular/core'; | ||
| 8 | + import { CommonModule } from '@angular/common'; | ||
| 9 | + import { G2plotBidirectionalBarDirective } from './g2plot-bidirectional-bar.directive'; | ||
| 10 | + | ||
| 11 | + @NgModule({ | ||
| 12 | + declarations: [G2plotBidirectionalBarDirective], | ||
| 13 | + imports: [ | ||
| 14 | + CommonModule | ||
| 15 | + ] | ||
| 16 | + }) | ||
| 17 | + export class G2plotBidirectionalBarModule { } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + /* | ||
| 2 | + * @Description: | ||
| 3 | + * @Date: 2020-12-01 11:55:11 | ||
| 4 | + * @LastEditors: tanmh | ||
| 5 | + * @LastEditTime: 2020-12-01 11:56:33 | ||
| 6 | + */ | ||
| 7 | + export * from './public-api'; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + { | ||
| 2 | + "ngPackage": { | ||
| 3 | + "lib": { | ||
| 4 | + "entryFile": "public-api.ts" | ||
| 5 | + } | ||
| 6 | + } | ||
| 7 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + /* | ||
| 2 | + * @Description: | ||
| 3 | + * @Date: 2020-12-01 11:55:06 | ||
| 4 | + * @LastEditors: tanmh | ||
| 5 | + * @LastEditTime: 2020-12-02 09:52:13 | ||
| 6 | + */ | ||
| 7 | + export * from './g2plot-bidirectional-bar.module'; | ||
| 8 | + export * from './g2plot-bidirectional-bar.directive'; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | export * from './lib/g2plot-area/g2plot-area.module'; | |
| 2 | 2 | export * from './lib/g2plot-bar/g2plot-bar.module'; | |
| 3 | + export * from './lib/g2plot-bidirectional-bar/g2plot-bidirectional-bar.module'; | ||
| 3 | 4 | export * from './lib/g2plot-box/g2plot-box.module'; | |
| 4 | 5 | export * from './lib/g2plot-bullet/g2plot-bullet.module'; | |
| 5 | 6 | export * from './lib/g2plot-column/g2plot-column.module'; | |
@@ -24,6 +25,7 @@ export * from './lib/g2plot-word-cloud/g2plot-word-cloud.module'; | |||
| 24 | 25 | ||
| 25 | 26 | export * from './lib/g2plot-area/g2plot-area.directive'; | |
| 26 | 27 | export * from './lib/g2plot-bar/g2plot-bar.directive'; | |
| 28 | + export * from './lib/g2plot-bidirectional-bar/g2plot-bidirectional-bar.directive'; | ||
| 27 | 29 | export * from './lib/g2plot-box/g2plot-box.directive'; | |
| 28 | 30 | export * from './lib/g2plot-bullet/g2plot-bullet.directive'; | |
| 29 | 31 | export * from './lib/g2plot-column/g2plot-column.directive'; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments