|
80 | 80 | */
|
81 | 81 | this.init = async () => {
|
82 | 82 |
|
| 83 | + // set shortcut to help functions |
| 84 | + $ = self.ccm.helper; |
| 85 | + |
83 | 86 | // Is config given via LightDOM (inner HTML of Custom Element)?
|
84 | 87 | // Then use it with higher priority
|
85 | 88 | if ( self.inner && self.inner.innerHTML.trim() ){
|
|
94 | 97 |
|
95 | 98 | };
|
96 | 99 |
|
97 |
| - /** |
98 |
| - * is called once after the initialization and is then deleted |
99 |
| - */ |
100 |
| - this.ready = async () => { |
101 |
| - |
102 |
| - // set shortcut to help functions |
103 |
| - $ = self.ccm.helper; |
104 |
| - |
105 |
| - }; |
106 |
| - |
107 | 100 | /**
|
108 | 101 | * starts the instance
|
109 | 102 | */
|
|
112 | 105 | // has logger instance? => log 'start' event
|
113 | 106 | self.logger && self.logger.log( 'start' );
|
114 | 107 |
|
| 108 | + // Default values |
| 109 | + self.html.main = $.integrate( self.html.main, { |
| 110 | + tag: 'svg', |
| 111 | + width:"100", |
| 112 | + height:"100", |
| 113 | + inner: [] |
| 114 | + } ); |
| 115 | + |
115 | 116 | const dimensions = Object.keys( self.data );
|
116 | 117 | const dim_count = dimensions.length;
|
117 |
| - let list = self.html.main.inner; |
| 118 | + const list = self.html.main.inner; |
118 | 119 |
|
119 | 120 | dimensions.map( (dim, index) => {
|
120 | 121 | const width = parseFloat( self.html.main.width ) / dim_count;
|
|
129 | 130 | height: self.data[ dim ],
|
130 | 131 | inner: { tag: 'title', inner: dim + ': ' + self.data[ dim ] }
|
131 | 132 | };
|
132 |
| - list.push( $.integrate(rect, $.integrate( self.styles, self.styles[ dim ])) ); |
| 133 | + list.push( $.integrate(rect, $.integrate( self.styles[ dim ], self.styles ) ) ); |
133 | 134 | list.push( $.clone( $.integrate( { tag:'text',
|
134 | 135 | x: index * width + 0.5 * width,
|
135 | 136 | y: height - 10,
|
|
0 commit comments