本文整理汇总了TypeScript中vendor/d3.select函数的典型用法代码示例。如果您正苦于以下问题:TypeScript select函数的具体用法?TypeScript select怎么用?TypeScript select使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了select函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
.on('mouseover', (d, i, nodes) => {
d3.select(nodes[i]).select('circle').transition().duration(100).attr('r', 7);
this.createTooltip(d, i, d3.select(nodes[i]), xScale, yScale);
this.tooltipElm
.style('display', 'block')
.style('opacity', 0)
.transition()
.duration(200)
.style('opacity', this.tooltipOpacity);
})
示例2: constructor
constructor(pageModel:PageModel, width:number, height:number, target:HTMLElement) {
this.pageModel = pageModel;
this.width = width;
this.height = height;
this.target = target;
this.paddingTop = 35;
this.paddingBottom = 30;
this.tooltipElm = d3.select('div.tooltip');
this.tooltipOpacity = 0.9;
this.dataPointOpactity = 0.6;
this.dataPointTextSize = 11;
}
示例3: renderChart
renderChart(data:Array<DataPoint>, heading:string):void {
const [minVal, maxVal] = this.getValuesRange(data);
const frame = d3.select(this.target);
frame.select('h2.top').text(heading);
const svg = frame.select('svg');
this.height = Math.max(70 * data.length, 70 * 2);
svg.attr('height', this.height);
const xScale = d3.scaleLinear()
.domain([minVal, maxVal])
.range([0, this.width]);
const yScale = d3.scaleLinear()
.domain([0, data.length])
.range([this.paddingTop, this.getRealHeight()]);
this.makeAxes(svg, xScale);
this.renderLines(svg, data, xScale, yScale);
this.renderCircles(svg, data, xScale, yScale);
}