aswi2021codebakers-gitlab/src/vega-analyze/testvega.js @ 9fa751ff
1 |
var view; |
---|---|
2 |
|
3 |
fetch('piechart.json') |
4 |
.then(res => res.json()) |
5 |
.then(spec => render(spec)) |
6 |
.catch(err => console.error(err)); |
7 |
|
8 |
function render(spec) { |
9 |
view = new vega.View(vega.parse(spec), { |
10 |
renderer: 'canvas', // renderer (canvas or svg) |
11 |
container: '#view', // parent DOM container |
12 |
hover: true // enable hover processing |
13 |
});
|
14 |
|
15 |
return view.runAsync(); |
16 |
}
|
17 |
|
18 |
|
19 |
|
- « Předchozí
- 1
- …
- 4
- 5
- 6
- Další »