0
我在瀏覽器上使用d3繪製了項目。我想根據他們的財產來突出其中的一些。例如,我有雜貨,其中肥皂元素的類型爲[for_bath (OR) for_cloth_wash]
。我想在所有肥皂和雜貨中選擇特定於for_bath
的那些元素,並將它們組合在同一個屏幕上。如何挑選具有特定屬性值的d3中的元素
怎麼樣?
此外,我的另一個疑問是document.getElementById()不能在d3的選擇代碼中工作。我是真實還是疏忽?
編輯
var data = {"soaps":{"lux":"bath", "cinthol":"bath", "rin","cloth_washing"},
"shoes":{"valentine":"teens", "bootie":"kids", "kuuch":"kids"}};
// Now I want to show all bath soaps highlighted, may be with a circle around them.
var svg = d3.select("svg")
.selectAll(".items")
.data(data).enter()
.append("circle")
// highlighting styles
;
在這裏,我要選擇浴皁,圓起來。
謝謝您花時間。我會用一些代碼來改進我的問題。 –