相关疑难解决方法(0)

D3.js V4和Angular不会发生节点转换

我在D3.js V.4.12中使用了Angular Typescript,尤其是在使用Tidy Radial Tree表示产品时。

初始步骤

与一起ng-cli,我安装npm install --save d3并创建了一个组件来显示信息。

可视化效果如下所示:

d3产品整洁树

各个组件如下:

treediag.component.ts

import { Component, OnInit, ViewEncapsulation} from '@angular/core';
import * as d3 from 'd3';
import { ont, ont_highchair } from '../fd-ontology/ontology';
import { recursionParse, ontNode } from './model/recursion';
export class leaf {
  name: string;
  url: string;
  color: string;
  children: leaf[] = [];
}

@Component({
  selector: 'app-treediag',
  templateUrl: './treediag.component.html',
  styleUrls: ['./treediag.component.css'],
  encapsulation: ViewEncapsulation.None
})

export class TreediagComponent implements OnInit …
Run Code Online (Sandbox Code Playgroud)

d3.js typescript angular

3
推荐指数
1
解决办法
909
查看次数

标签 统计

angular ×1

d3.js ×1

typescript ×1