import 'zone.js'; import 'reflect-metadata'; import { Component, enableProdMode, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { ViserModule } from 'viser-ng'; import * as $ from 'jquery'; const DataSet = require('@antv/data-set'); const label = [ 'value', { offset: 0, textStyle: { fill: '#fff', fontSize: '12', textAlign: 'center', shadowBlur: 2, shadowColor: 'rgba(0, 0, 0, .45)' }, }, ]; @Component({ selector: '#mount', template: `
` }) export class AppComponent { forceFit: boolean = true; height: number = 400; data = []; label = label; constructor() { $.getJSON('/assets/data/voronoi.json', (sourceData) => { const dv = new DataSet.View().source(sourceData); dv.transform({ type: 'diagram.voronoi', fields: ['x', 'y'], size: [800, 600], as: ['_x', '_y'], }); this.data = dv.rows; }); } } @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, ViserModule ], providers: [], bootstrap: [AppComponent] }) export default class AppModule { }