将元素添加到组元素的顶部 [英] Adding an element to top of a group element

查看:112
本文介绍了将元素添加到组元素的顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用我的群组加入资料后,我想要将输入选项中的元素加入群组( g -element)在顶部/最高。默认是附加到底部。

After joning data with my group I would like the elements in the enter selection to be added to a group (g-element) on top/highest up. Default is to append to the bottom.

这是因为我想让对象在所有现成的可见对象下方显示。

The reason for this is that I want the object to visually appear below the all ready visible objects.

我知道我可以订购和排序,但我认为可能有一个更容易/更好的方法来做到这一点。我做了几个手动的事情只是为了后来发现Oooh,他们包括一个聪明的方式来做,EASILY。

I know I can order and sort but I thought there might be an easier/better way to do this. I have done several manual things only to later find out "Oooh, they included a smart way to do that, EASILY."

推荐答案

D3确实有 insert 方法: https:/ /github.com/mbostock/d3/wiki/Selections#wiki-insert

这篇关于将元素添加到组元素的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆