本文整理匯總了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);
}