有没有改变“bind”交互元素的格式(字体、颜色等)的方法?

huangapple go评论79阅读模式
英文:

Is there a way to change the formatting (font, color, etc.) of the interactive elements for "bind"?

问题

使用vega-lite中的bind属性将显示一个交互元素(例如滑块、下拉菜单、单选按钮等)。例如,在https://vega.github.io/vega-lite/docs/bind.html中,有一个示例显示默认字体中的绑定参数名称org_Origin和下拉菜单值。是否有办法更改此内容,例如将名称"org_Origin"的颜色设置为白色?

我尝试过对selectionconfig定义进行调整,以及可能从中继承的其他选项(titleheaderlegend),但未能找到有效方法。

英文:

Using the bind property in vega-lite will show an interactive element (e.g., a slider, dropdown, radio, etc.). For example, in https://vega.github.io/vega-lite/docs/bind.html, there is a sample showing the name of the bound parameter, org_Origin, and the dropdown values in the default font. Is there any way to change this, e.g., set the color of the name "org_Origin" to white?

I played around with the config definition for selection, as well as potential other options that it could possibly inherit from (title, header, legend), but was unable to find anything that worked.

答案1

得分: 0

你能通过 Deneb 应用 CSS 样式吗?

通过 CSS,你可以添加以下样式,例如:

(在线 CSS:.example .vega-bind select

.vega-bind select {
    max-width: 180px;
    font-size: 16px !important;
    color: blue !important;
    background-color: aliceblue !important;
    border-color: silver;
    border-radius: 3px !important;
    padding: 4px !important;
}
英文:

Are you able to apply a css style or this via deneb?

有没有改变“bind”交互元素的格式(字体、颜色等)的方法?

Via css you could add the following for example:

(Online css: .example .vega-bind select)

.vega-bind select {
    max-width: 180px;
    font-size: 16px !important;
    color: blue !important;
    background-color: aliceblue !important;
    border-color: silver;
    border-radius: 3px !important;
    padding: 4px !important;
}

huangapple
  • 本文由 发表于 2023年5月25日 01:03:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76325888.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定