- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个带有焦点和上下文部分的区域图。上下文部分允许用户更改焦点部分中显示的时间段。
数据包括一段时间内的人口信息,包括性别。我希望能够在男性、女性和全部之间切换。我已经开始了这项工作,因为我正在获取我需要的数据并将其提供给图表。但是,当我单击另一个选项时,面积图不会退出,因此 Men/Women/All 的图表会堆叠在一起。
谁能帮我解开这个问题?
代码如下,这是一个 fiddle :https://jsfiddle.net/3wtrsegp/
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<style>
.brush rect.selection {
fill: none;
opacity: 1;
}
rect.handle{
fill: #666;
}
</style>
</head>
<body>
<div id="buttons">
<button id="All" class="button selected">All</button>
<button id="Men" class="button">Men</button>
<button id="Women" class="button">Women</button>
</div>
<div id='ptchart'></div>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>
var json = [
{
"date": "2020-01-02",
"gender": "Men",
"value": 4320
},
{
"date": "2020-01-02",
"gender": "Women",
"value": 984
},
{
"date": "2020-01-15",
"gender": "Men",
"value": 4624
},
{
"date": "2020-01-15",
"gender": "Women",
"value": 1005
},
{
"date": "2020-02-03",
"gender": "Men",
"value": 5488
},
{
"date": "2020-02-03",
"gender": "Women",
"value": 978
},
{
"date": "2020-02-18",
"gender": "Men",
"value": 5842
},
{
"date": "2020-02-18",
"gender": "Women",
"value": 1006
},
{
"date": "2020-03-02",
"gender": "Men",
"value": 6925
},
{
"date": "2020-03-02",
"gender": "Women",
"value": 1004
},
{
"date": "2020-03-16",
"gender": "Men",
"value": 6132
},
{
"date": "2020-03-16",
"gender": "Women",
"value": 948
},
{
"date": "2020-04-01",
"gender": "Men",
"value": 5852
},
{
"date": "2020-04-01",
"gender": "Women",
"value": 685
},
{
"date": "2020-04-15",
"gender": "Men",
"value": 8697
},
{
"date": "2020-04-15",
"gender": "Women",
"value": 497
},
{
"date": "2020-05-01",
"gender": "Men",
"value": 4547
},
{
"date": "2020-05-01",
"gender": "Women",
"value": 468
}
]
var margin = { top: 30, right: 210, bottom: 110, left: 50 },
margin2 = { top: 380, right: 200, bottom: 70, left: 50 },
width = 1000 - margin.left - margin.right,
height = 440 - margin.top - margin.bottom,
height2 = 490 - margin2.top - margin2.bottom;
var x = d3.scaleTime().range([0, width]),
x2 = d3.scaleTime().range([0, width]),
y = d3.scaleLinear().range([height, 0]),
y2 = d3.scaleLinear().range([height2, 0]);
var xAxis = d3.axisBottom(x).tickFormat(d3.timeFormat("%b %Y")).ticks(5),
xAxis2 = d3.axisBottom(x2).ticks(0).tickSize(0),
yAxis = d3.axisLeft(y);
var brush = d3.brushX()
.extent([[0, 0], [width, height2]])
.on("brush", brushed);
var svg = d3.select("#ptchart").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom);
svg.append("defs").append("clipPath")
.attr("id", "clip")
.append("rect")
.attr("width", width)
.attr("height", height);
var focus = svg.append("g")
.attr("class", "focus")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var context = svg.append("g")
.attr("class", "context")
.attr("transform", "translate(" + margin2.left + "," + margin2.top + ")");
const parseDate = d3.timeParse("%Y-%m-%d");
let data = json
updateChart(data)
d3.selectAll(".button").on("click", function () {
var section = d3.select(this).attr("id");
if (section == 'All') { data = json } else {
data = json.filter(d => d.gender == section)
}
updateChart(data);
})
updateChart(json);
function updateChart(selectedData) {
const data = d3.nest()
.key(d => d.date)
.rollup(v => d3.sum(v, d => d.value))
.entries(selectedData);
data.forEach((d) => {
d.date = parseDate(d.key);
d.value = +d.value;
})
x.domain(d3.extent(data, d => d.date));
y.domain([0, d3.max(data, d => d.value) + 500]);
x2.domain(x.domain());
y2.domain(y.domain());
var area = d3.area()
.x(function (d) { return x(d.date); })
.y0(height)
.y1(function (d) { return y(d.value); })
var line = d3.line()
.x(d => x(d.date))
.y(d => y(d.value))
// This is what the area looked like before I started to try and get the enter/update/exit pattern working:
// var area = focus.append("g");
// area.attr("clip-path", "url(#clip)");
// area.selectAll('path')
// .data([data])
// .enter().append("path")
// .attr("class", "area")
// .attr("d", area)
// .attr('fill', '#eeeeee')
var area = focus.append("g").selectAll('path')
.data([data])
area.enter().append("path")
.attr("class", "area")
.attr('fill', '#eeeeee')
area.transition()
.attr("d", area)
.attr("clip-path", "url(#clip)");
area.exit().remove()
var arealine = focus.append("g");
arealine.attr("clip-path", "url(#clip)");
arealine.selectAll('path')
.data([data])
.enter().append("path")
.attr("class", "line")
.attr("d", line)
.attr('fill', 'none')
.attr('stroke', '#333')
var capacityline = focus.append('g')
capacityline.selectAll('line')
.data(data)
.enter().append('line')
.attr('class', 'capacityline')
.attr('x1', 0)
.attr('y1', d => y(12500))
.attr('x2', width)
.attr('y2', d => y(12500))
.attr('stroke-width', '1px')
.attr('stroke', '#4D4E56')
.attr('stroke-dasharray', 4)
var stooltip = d3.select("body").append("div")
.attr("class", "tooltip");
svg.selectAll(".axis").remove();
focus.append("g")
.attr("class", "axis axis--x")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
focus.append("g")
.attr("class", "axis axis--y")
.call(yAxis);
var area2 = d3.area()
.x(d => x2(d.date))
.y0(height2)
.y1(d => y2(d.value))
var line2 = d3.line()
.x(d => x2(d.date))
.y(d => y2(d.value))
var area = context.append("g");
area.attr("clip-path", "url(#clip)");
area.selectAll('path')
.data([data])
.enter().append("path")
.attr("class", "area")
.attr("d", area2)
.attr('fill', '#eeeeee')
var arealine = context.append("g");
arealine.attr("clip-path", "url(#clip)");
arealine.selectAll('path')
.data([data])
.enter().append("path")
.attr("class", "line")
.attr("d", line2)
.attr('fill', 'none')
.attr('stroke', '#333')
context.append("g")
.attr("class", "axis axis--x")
.attr("transform", "translate(0," + height2 + ")")
.call(xAxis2);
context.append("g")
.attr("class", "brush")
.call(brush)
.call(brush.move, x.range());
}
function brushed() {
var area = d3.area()
.x(function (d) { return x(d.date); })
.y0(height)
.y1(function (d) { return y(d.value); })
var line = d3.line()
.x(function (d) { return x(d.date); })
.y(function (d) { return y(d.value); })
var selection = d3.event.selection;
x.domain(selection.map(x2.invert, x2));
focus.selectAll(".area")
.attr("d", area)
focus.selectAll(".line")
.attr("d", line)
focus.select(".axis--x").call(xAxis);
}
</script>
</body>
</html>
最佳答案
您的直接问题很容易错过:
您创建新父级的每次更新g
元素并在这些新的 g
上执行进入/更新/退出循环要素:
var area = focus.append("g").selectAll('path')
新追加的
g
上面的元素将是空的,因为它还没有子元素;因此,输入选择将为数据数组中的每个项目包含一个元素。因为您永远不会删除或重新选择旧的
g
元素,它们只是坐在那里,不受新选择和任何后续进入/更新/退出周期的影响。结果是每次我们运行更新函数时,我们只是对新数据进行分层。
g
元素应该附加在更新函数之外:它们不需要更新:有一个的地方仍然会有一个,并且父级的属性保持不变。父 g 元素独立于数据,它们只包含表示数据的子元素。我们应该在更新函数之外设置一次父 g 元素,以及所有其他需要设置一次的东西。然后我们可以使用这些父项来设置我们的进入/更新/退出周期,因为我们将在每次更新时选择相同父项中的元素(而不是每次更新都使用新的空父项)。
g
只需要附加一次并在调用更新函数之前附加它们的元素。我还使用了您的区域和线生成器,并将它们从更新功能中删除:它们在这里也不会改变。这也适用于工具提示 div 和轴本身:父 g 在更新函数之外附加一次,但更新函数在这些 g 元素上调用轴生成器。
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<style>
.brush rect.selection {
fill: none;
opacity: 1;
}
rect.handle{
fill: #666;
}
</style>
</head>
<body>
<div id="buttons">
<button id="All" class="button selected">All</button>
<button id="Men" class="button">Men</button>
<button id="Women" class="button">Women</button>
</div>
<div id='ptchart'></div>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>
var json = [
{
"date": "2020-01-02",
"gender": "Men",
"value": 4320
},
{
"date": "2020-01-02",
"gender": "Women",
"value": 984
},
{
"date": "2020-01-15",
"gender": "Men",
"value": 4624
},
{
"date": "2020-01-15",
"gender": "Women",
"value": 1005
},
{
"date": "2020-02-03",
"gender": "Men",
"value": 5488
},
{
"date": "2020-02-03",
"gender": "Women",
"value": 978
},
{
"date": "2020-02-18",
"gender": "Men",
"value": 5842
},
{
"date": "2020-02-18",
"gender": "Women",
"value": 1006
},
{
"date": "2020-03-02",
"gender": "Men",
"value": 6925
},
{
"date": "2020-03-02",
"gender": "Women",
"value": 1004
},
{
"date": "2020-03-16",
"gender": "Men",
"value": 6132
},
{
"date": "2020-03-16",
"gender": "Women",
"value": 948
},
{
"date": "2020-04-01",
"gender": "Men",
"value": 5852
},
{
"date": "2020-04-01",
"gender": "Women",
"value": 685
},
{
"date": "2020-04-15",
"gender": "Men",
"value": 8697
},
{
"date": "2020-04-15",
"gender": "Women",
"value": 497
},
{
"date": "2020-05-01",
"gender": "Men",
"value": 4547
},
{
"date": "2020-05-01",
"gender": "Women",
"value": 468
}
]
var margin = { top: 30, right: 210, bottom: 110, left: 50 },
width = 1000 - margin.left - margin.right,
height = 440 - margin.top - margin.bottom;
var x = d3.scaleTime().range([0, width]),
y = d3.scaleLinear().range([height, 0]);
var xAxis = d3.axisBottom(x).tickFormat(d3.timeFormat("%b %Y")).ticks(5),
yAxis = d3.axisLeft(y);
var svg = d3.select("#ptchart").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom);
svg.append("defs").append("clipPath")
.attr("id", "clip")
.append("rect")
.attr("width", width)
.attr("height", height);
// Add all the `g` parent elements now:
var focus = svg.append("g")
.attr("class", "focus")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var areaG = focus.append("g");
var lineG = focus.append("g")
.attr("clip-path", "url(#clip)");
var stooltip = d3.select("body").append("div")
.attr("class", "tooltip");
var xAxisG = focus.append("g")
.attr("class", "axis axis--x")
.attr("transform", "translate(0," + height + ")")
var yAxisG = focus.append("g")
.attr("class", "axis axis--y")
// area and line generators:
var area = d3.area()
.x(function (d) { return x(d.date); })
.y0(height)
.y1(function (d) { return y(d.value); })
var line = d3.line()
.x(function (d) { return x(d.date); })
.y(function (d) { return y(d.value); })
const parseDate = d3.timeParse("%Y-%m-%d");
let data = json
updateChart(data)
d3.selectAll(".button").on("click", function () {
var section = d3.select(this).attr("id");
if (section == 'All') { data = json } else {
data = json.filter(d => d.gender == section)
}
updateChart(data);
})
updateChart(json);
function updateChart(selectedData) {
// Manage data
const data = d3.nest()
.key(d => d.date)
.rollup(v => d3.sum(v, d => d.value))
.entries(selectedData);
data.forEach((d) => {
d.date = parseDate(d.key);
d.value = +d.value;
})
// Calculate new scale values:
x.domain(d3.extent(data, d => d.date));
y.domain([0, d3.max(data, d => d.value) + 500]);
// Main chart:
// Do the areas:
var areaPaths = areaG.selectAll('path')
.data([data])
areaPaths.enter().append("path")
.attr("class", "area")
.attr('fill', '#eeeeee')
areaPaths.transition()
.attr("d", area)
.attr("clip-path", "url(#clip)");
areaPaths.exit().remove()
// Do the lines:
var linePaths = lineG.selectAll('path')
.data([data]);
// Update/exit
linePaths.enter().append("path")
.merge(linePaths)
.attr("class", "line")
.attr("d", line)
.attr('fill', 'none')
.attr('stroke', '#333')
linePaths.exit().remove();
// Update the axes:
xAxisG.call(xAxis);
yAxisG.call(yAxis);
}
</script>
</body>
</html>
g
我们最初也可以附加一个子行。这样我们的更新函数更简洁,代码整体更简单(仅追加,此处没有显式输入/更新/退出),同时仍保留 D3 的功能和精神:
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<style>
.brush rect.selection {
fill: none;
opacity: 1;
}
rect.handle{
fill: #666;
}
</style>
</head>
<body>
<div id="buttons">
<button id="All" class="button selected">All</button>
<button id="Men" class="button">Men</button>
<button id="Women" class="button">Women</button>
</div>
<div id='ptchart'></div>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>
var json = [
{
"date": "2020-01-02",
"gender": "Men",
"value": 4320
},
{
"date": "2020-01-02",
"gender": "Women",
"value": 984
},
{
"date": "2020-01-15",
"gender": "Men",
"value": 4624
},
{
"date": "2020-01-15",
"gender": "Women",
"value": 1005
},
{
"date": "2020-02-03",
"gender": "Men",
"value": 5488
},
{
"date": "2020-02-03",
"gender": "Women",
"value": 978
},
{
"date": "2020-02-18",
"gender": "Men",
"value": 5842
},
{
"date": "2020-02-18",
"gender": "Women",
"value": 1006
},
{
"date": "2020-03-02",
"gender": "Men",
"value": 6925
},
{
"date": "2020-03-02",
"gender": "Women",
"value": 1004
},
{
"date": "2020-03-16",
"gender": "Men",
"value": 6132
},
{
"date": "2020-03-16",
"gender": "Women",
"value": 948
},
{
"date": "2020-04-01",
"gender": "Men",
"value": 5852
},
{
"date": "2020-04-01",
"gender": "Women",
"value": 685
},
{
"date": "2020-04-15",
"gender": "Men",
"value": 8697
},
{
"date": "2020-04-15",
"gender": "Women",
"value": 497
},
{
"date": "2020-05-01",
"gender": "Men",
"value": 4547
},
{
"date": "2020-05-01",
"gender": "Women",
"value": 468
}
]
var margin = { top: 30, right: 210, bottom: 110, left: 50 },
margin2 = { top: 380, right: 200, bottom: 70, left: 50 },
width = 1000 - margin.left - margin.right,
height = 440 - margin.top - margin.bottom,
height2 = 490 - margin2.top - margin2.bottom;
var x = d3.scaleTime().range([0, width]),
x2 = d3.scaleTime().range([0, width]),
y = d3.scaleLinear().range([height, 0]),
y2 = d3.scaleLinear().range([height2, 0]);
var xAxis = d3.axisBottom(x).tickFormat(d3.timeFormat("%b %Y")).ticks(5),
xAxis2 = d3.axisBottom(x2).ticks(12).tickSize(0),
yAxis = d3.axisLeft(y);
var brush = d3.brushX()
.extent([[0, 0], [width, height2]])
.on("brush", brushed);
var svg = d3.select("#ptchart").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom);
svg.append("defs").append("clipPath")
.attr("id", "clip")
.append("rect")
.attr("width", width)
.attr("height", height);
// Set up chart elements:
var focus = svg.append("g")
.attr("class", "focus")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
// Set up main chart elements:
var mainArea = focus.append("g")
.attr("clip-path", "url(#clip)")
.append("path")
.attr("class", "area")
.attr('fill', '#eeeeee')
var mainLine = focus.append("g")
.attr("clip-path", "url(#clip)")
.append("path")
.attr("class", "line")
.attr('fill', 'none')
.attr('stroke', '#333')
var capacityLine = focus.append("g")
.append("line")
.attr('class', 'capacityline')
.attr('stroke-width', '1px')
.attr('stroke', '#4D4E56')
.attr('stroke-dasharray', 4)
var xAxisG = focus.append("g")
.attr("class", "axis axis--x")
.attr("transform", "translate(0," + height + ")")
var yAxisG = focus.append("g")
.attr("class", "axis axis--y")
// Set up brushable chart elements:
var context = svg.append("g")
.attr("class", "context")
.attr("transform", "translate(" + margin2.left + "," + margin2.top + ")");
var brushableArea = context.append("g")
.attr("clip-path", "url(#clip)")
.append("path")
.attr("class", "area")
.attr('fill', '#eeeeee');
var brushableLine = context.append("g")
.attr("clip-path", "url(#clip)")
.append("path")
.attr("class", "line")
.attr('fill', 'none')
.attr('stroke', '#333')
var brushAxisG = context.append("g")
.attr("class", "axis axis--x")
.attr("transform", "translate(0," + height2 + ")")
var brushG = context.append("g")
.attr("class", "brush")
// Set up tooltip div:
var stooltip = d3.select("body").append("div")
.attr("class", "tooltip");
const parseDate = d3.timeParse("%Y-%m-%d");
// Area and line generators:
var area = d3.area()
.x(function (d) { return x(d.date); })
.y0(height)
.y1(function (d) { return y(d.value); })
var line = d3.line()
.x(d => x(d.date))
.y(d => y(d.value))
var area2 = d3.area()
.x(d => x2(d.date))
.y0(height2)
.y1(d => y2(d.value))
var line2 = d3.line()
.x(d => x2(d.date))
.y(d => y2(d.value))
updateChart(json)
d3.selectAll(".button").on("click", function () {
var section = d3.select(this).attr("id");
if (section == 'All') { data = json } else {
data = json.filter(d => d.gender == section)
}
updateChart(data);
})
function updateChart(selectedData) {
const data = d3.nest()
.key(d => d.date)
.rollup(v => d3.sum(v, d => d.value))
.entries(selectedData);
data.forEach((d) => {
d.date = parseDate(d.key);
d.value = +d.value;
})
// Update scales:
x.domain(d3.extent(data, d => d.date));
y.domain([0, d3.max(data, d => d.value) + 500]);
x2.domain(x.domain());
y2.domain(y.domain());
// Update axes:
xAxisG.call(xAxis);
yAxisG.call(yAxis);
// Update area and lines of main chart:
mainArea.datum(data)
.attr("d", area);
mainLine.datum(data)
.attr("d",line);
capacityLine.transition()
.attr('x1', 0)
.attr('y1', d => y(1000))
.attr('x2', width)
.attr('y2', d => y(1000))
// Update brushable area:
brushableArea.datum(data)
.attr("d", area2);
brushableLine.datum(data)
.attr("d", line2);
// Update brush axis:
brushAxisG.call(xAxis2);
// Update brush:
brushG.call(brush)
.call(brush.move, x.range());
}
function brushed() {
var selection = d3.event.selection;
x.domain(selection.map(x2.invert, x2));
focus.selectAll(".area")
.attr("d", area)
focus.selectAll(".line")
.attr("d", line)
focus.select(".axis--x").call(xAxis);
}
</script>
</body>
</html>
.datum()
它将提供的值绑定(bind)到所选元素:它相当于您使用
.data([data])
在您的原始代码中输入/更新/退出选择。
关于javascript - 如何为具有焦点和上下文的区域图实现 d3 的输入更新退出模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67426583/
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
我试图用这种形式简单地获取数字 28 integer+space+integer+integer+space+integer我试过这个正则表达式 \\s\\d\\d\\s 但我得到了两个数字11 和
最近一直在学习D语言。我一直对运行时感到困惑。 从我能收集到的关于它的信息中,(这不是很多)我知道它是一种有助于 D 的一些特性的运行时。像垃圾收集一样,它与您自己的程序一起运行。但是既然 D 是编译
想问一下这两个正则表达式有区别吗? \d\d\d 与 \d{3} 我已经在我的本地机器上使用 Java 和 Windows 操作系统对此进行了测试,两者都工作正常并且结果相同。但是,当在 linux
我正在学习 Go,而且我坚持使用 Go 之旅(exercise-stringer.go:https://tour.golang.org/methods/7)。 这是一些代码: type IPAddr
我在Java正则表达式中发现了一段令我困惑的代码: Pattern.compile( "J.*\\d[0-35-9]-\\d\\d-\\d\\d" ); 要编译的字符串是: String string
我在 ruby 代码上偶然发现了这个。我知道\d{4})\/(\d\d)\/(\d\d)\/(.*)/是什么意思,但是\1-\2-\3-\4 是什么意思? 最佳答案 \1-\2-\3-\4 是 b
我一直在努力解决这个问题,这让我很恼火。我了解 D 运行时库。它是什么,它做什么。我也明白你可以在没有它的情况下编译 D 应用程序。就像 XoMB 所做的那样。好吧,XoMB 定义了自己的运行时,但是
我有两个列表列表,子列表代表路径。我想找到所有路径。 List> pathList1 List> pathList2 当然是天真的解决方案: List> result = new ArrayList>
我需要使用 Regex 格式化一个字符串,该字符串包含数字、字母 a-z 和 A-Z,同时还包含破折号和空格。 从用户输入我有02-219 8 53 24 输出应该是022 198 53 24 我正在
目标是达到与this C++ example相同的效果: 避免创建临时文件。我曾尝试将 C++ 示例翻译为 D,但没有成功。我也尝试过不同的方法。 import std.datetime : benc
tl;dr:你好吗perfect forwarding在 D? 该链接有一个很好的解释,但例如,假设我有这个方法: void foo(T)(in int a, out int b, ref int c
有什么方法可以在 D 中使用abstract auto 函数吗? 如果我声明一个类如下: class MyClass { abstract auto foo(); } 我收到以下错误: mai
有没有人为内存中重叠的数组切片实现交集?算法在没有重叠时返回 []。 当 pretty-print (使用重叠缩进)内存中重叠的数组切片时,我想要这个。 最佳答案 如果您确定它们是数组,那么只需取 p
我已经开始学习 D,但我在使用 Andrei Alexandrescu 所著的 The D Programming Language 一书中提供的示例时遇到了一些麻烦。由于 int 和 ulong 类
如何创建一个不可变的类? 我的目标是创建一个实例始终不可变的类。现在我只是用不可变的方法和构造函数创建了一个“可变”类。我将其称为 mData,m 表示可变。然后我创建一个别名 alias immut
不久前我买了《The D Programming Language》。好书,很有教育意义。但是,我在尝试编译书中列出的语言功能时遇到了麻烦:扩展函数。 在这本书中,Andrei 写了任何可以像这样调用
我在 D http://www.digitalmars.com/d/2.0/lazy-evaluation.html 中找到了函数参数的惰性求值示例 我想知道如何在 D 中实现可能的无限数据结构,就像
这个问题在这里已经有了答案: 12 年前关闭。 Possible Duplicate: Could anyone explain these undefined behaviors (i = i++
当前是否可以跨模块扫描/查询/迭代具有某些属性的所有函数(或类)? 例如: source/packageA/something.d: @sillyWalk(10) void doSomething()
我是一名优秀的程序员,十分优秀!