Commit f80fe5d 1 parent a51a5e2 commit f80fe5d Copy full SHA for f80fe5d
File tree 3 files changed +6
-24
lines changed
3 files changed +6
-24
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import { Plugin , parseYaml } from 'obsidian'
2
2
import Renderer from 'renderer'
3
- import ChartsCreator from 'chartsCreator ' ;
3
+ import EchartsModal from 'modal ' ;
4
4
import { OptionsType } from './type' ;
5
5
import * as echarts from 'echarts'
6
6
@@ -12,7 +12,7 @@ export default class EchartsPlugin extends Plugin {
12
12
id : "echarts-create-charts" ,
13
13
name : "create echarts" ,
14
14
callback : ( ) => {
15
- const creator = new ChartsCreator ( this . app )
15
+ const creator = new EchartsModal ( this . app , "pie" )
16
16
creator . createPie ( )
17
17
} ,
18
18
} ) ;
Original file line number Diff line number Diff line change @@ -6,10 +6,9 @@ export default class EchartsModal extends Modal {
6
6
chartType : string
7
7
constructor ( app : App , chartType : string ) {
8
8
super ( app )
9
- this . chartType = 'pie'
9
+ this . chartType = chartType
10
10
}
11
-
12
- pieModal ( ) {
11
+ createPie ( ) {
13
12
let option = {
14
13
source : '' ,
15
14
}
@@ -33,13 +32,10 @@ export default class EchartsModal extends Modal {
33
32
this . close ( )
34
33
} )
35
34
} )
35
+ this . open ( )
36
36
}
37
37
38
- onOpen ( ) {
39
- if ( this . chartType === 'pie' ) {
40
- this . pieModal ( )
41
- }
42
- }
38
+
43
39
44
40
onClose ( ) {
45
41
let { contentEl } = this
You can’t perform that action at this time.
0 commit comments