center * selected element *使用css而不破坏地图连续性:dc.js

时间:2015-10-15 14:12:39

标签: d3.js dc.js crossfilter

除了使用css之外,我还没有找到使用crossfilter,dc.js确定所选元素的方法。

我的目标是将所选元素集中在查看窗口中,以下代码实现了这一目标,但是,它通过将其从较大的地图上剥离并将其放置在中心 - 不< / strong>我想要的。

这是它的样子, 在选择之前:

enter image description here

选择后

enter image description here

这是执行此行为的代码:

    /*highlight selected country*/
    g.selected path {
        stroke: yellow;
        stroke-width: 2px;
        fill: #ff69b4;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

如何以更合理的方式实现这一点,使地图保持在一起,并且所选元素优雅地将自身重新定位到查看分区的中心?

0 个答案:

没有答案