File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 18
18
</ style >
19
19
< body >
20
20
< ternary-plot side ="400 "> </ ternary-plot >
21
+ < button > show new data</ button >
21
22
</ body >
22
23
< script >
23
24
const element = document . querySelector ( 'ternary-plot' ) ;
24
- // Set data as a dynamic property.
25
- element . data = getRandomData ( 20 ) ;
25
+ // element.data = getRandomData(20);
26
+
27
+ const button = document . querySelector ( 'button' ) ;
28
+
29
+ button . addEventListener ( 'click' , event => {
30
+ element . data = getRandomData ( 20 ) ;
31
+ } ) ;
26
32
27
33
function getRandomData ( length ) {
28
34
return {
Original file line number Diff line number Diff line change 1
- import { html , define } from 'hybrids' ;
1
+ import { html , define , property } from 'hybrids' ;
2
2
import style from './style' ;
3
3
import {
4
4
width ,
@@ -113,6 +113,14 @@ function render({
113
113
}
114
114
115
115
export const TernaryPlot = {
116
+ data : property ( {
117
+ titles : {
118
+ bottom : '' ,
119
+ right : '' ,
120
+ left : ''
121
+ } ,
122
+ data : [ ]
123
+ } ) ,
116
124
side : 400 ,
117
125
numberOfTicks : 10 ,
118
126
tickLenght : 10 ,
You can’t perform that action at this time.
0 commit comments