我正在使用D3.js. 我想找到一个等同于这个CSS类的SVG,如果文本流出其包含的div,它会添加省略号:
.ai-ellipsis {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-moz-binding: url(<q>assets/xml/ellipsis.xml#ellipsis</q>);
}
Run Code Online (Sandbox Code Playgroud)
这是我的SVG:
<g class="bar" transform="translate(0,39)">
<text class="label" x="-3" y="6.5" dy=".35em" text-anchor="start">Construction</text>
<rect height="13" width="123"></rect>
</g>
Run Code Online (Sandbox Code Playgroud)
它的生成如下:
barEnter.append("text").attr("class", "label")
.attr("x", -3).attr("y", function() { return y.rangeBand() / 2})
.attr("dy", ".35em").attr("text-anchor", "start")
.text(function(d) {
return d.Name;
});
Run Code Online (Sandbox Code Playgroud)
目前,文本溢出并与rect元素重叠.
有什么方法可以说"如果文字超过一定宽度,裁剪它并添加省略号"?
context.getTheme.obtainStyledAttributes()
和之间有什么区别context.obtainStyledAttributes()?
主题是我的应用程序风格?
我无法在此行中解决米斯拉规则11.6警告:
uint32_t * delay = (uint32_t *)0x40086D0C ;
Run Code Online (Sandbox Code Playgroud)
[ 仅供参考: typedef long unsigned int uint32_t;]
PC-Lint:注释923:从int转换为指针[MISRA 2012 Rule 11.6,必填]
我做了什么:
您能否分享有关我的问题的有用想法?我们将不胜感激。
最近,我学会了" 回溯 "功能的存在.此函数允许在某些情况下检索在没有调试信息的情况下编译的ELF运行程序的callstack.
它对我来说是完美的(我不能在生产程序中插入调试符号),但是对于"回溯"工作,有(大致)两个条件:
我担心的是,如果我满足这两个条件,我的程序将会变慢(因为编译器无法优化非静态函数,因为他优化了静态函数?).据我所知,使用-rdynamic添加额外信息不会影响程序的性能:它只是给ELF二进制文件增加了一点重量.
所以这是我的问题:
当所有静态函数变为非静态函数时,运行性能的影响是什么?
因此,在查看大规模的互联网后,我无法找到答案.
说我有这段代码:
if(P4IN & GPIO_PIN1?0:1){
if (state==1){
state = 0;
//Wait for this state to pass -- ends up saving the current state on button press.
while (counter < 10000){
counter++;
}
}
else{
state = 1;
while (counter < 10000){
counter++;
}
}
}
Run Code Online (Sandbox Code Playgroud)
我怎么会重写这个,所以if(P4IN & GPIO_PIN1?0:1)不是这样写的.我不介意创建额外的if/else条件或扩展此代码块(用于MSP432)
谢谢你的时间.