链接两个D3图 [英] Link two D3 plots
问题描述
我试图链接两个D3绘图,以便选择右侧直方图的一部分,使一个特定的散点图显示在左侧。
这是我的尝试。
我当前的问题是为什么正确的图不渲染,我想回到如何创建和引用多个SVG标签在d3。 / p>
D3有这种类型的情况的SVG控件。
=https://github.com/mbostock/d3/wiki/SVG-Controls =nofollow> https://github.com/mbostock/d3/wiki/SVG-Controls
这里有两个很棒的例子:
http://bl.ocks.org/mbostock/4063663
http://bl.ocks.org/mbostock/1667367
I'm trying to link two D3 plots so that selecting part of the histogram on the right, causes a certain scatter plot to display on the left.
This is my attempt.
My current question is why the right plot isn't rendering, which I think goes back to how to create and refer to multiple SVG tags in d3.
D3 has SVG controls for this type of situation. What you are looking for is a brush with context.
Here are the API docs:
https://github.com/mbostock/d3/wiki/SVG-Controls
And here are two great examples:
http://bl.ocks.org/mbostock/4063663
http://bl.ocks.org/mbostock/1667367
这篇关于链接两个D3图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!