[D3] D3 and JSON
D3 Associative Array Utilities
-
d3.keys(object)
var margin = {"top": 20, "right": 20, "bottom": 30, "left": 50}; d3.keys(margin); // 回傳: ["top", "right", "bottom", "left"]
-
d3.values(object)
var margin = {"top": 20, "right": 20, "bottom": 30, "left": 50}; d3.values(margin); // 回傳: [20, 20, 30, 50]
-
d3.entries(object)
var margin = {"top": 20, "right": 20, "bottom": 30, "left": 50}; d3.entries(margin); // 回傳: [{"top": 20}, {"right": 20}, {"bottom": 30}, {"left": 50}]
您可在此處留言