如何使用 deneb 图表中的画笔过滤 power bi 中的其他视觉效果?
我的左侧有一个带有线条和条形标记的deneb图表,右侧有一个表格。
如果我逐一单击 2005 年至 2008 年的条形图(使用 ctrl 键选择多个条形图),它会过滤右侧的表格:
我现在想使用画笔来实现同样的事情:
这里是deneb规格:
{
"data": {
"name": "dataset"
},
"encoding": {
"x": {
"field": "year",
"type": "ordinal"
}
},
"layer": [
{
"mark": "line",
"encoding": {
"y": {
"field": "world_gdp",
"type": "quantitative"
}
}
},
{
"mark": {"type": "bar", "width": 10},
"encoding": {
"y": {
"value": 200
},
"y2": {
"value": 210
}
},
"params": [
{
"name": "brush_years",
"select": {
"type": "interval",
"encodings": [
"x"
]
}
}
]
}
]
}
csv是AI生成的:
year,world_gdp,name,description,country
2000,33.5,Human Genome Project,Completion of the first full sequence of the human genome,USA
2001,31.7,iPod invention,Launch of the first Apple iPod,USA
2002,34.9,Boeing 777-300ER,Introduction of the Boeing 777-300ER,USA
2003,38.7,Concorde retirement,End of the Concorde supersonic passenger flights,France/UK
2004,44.2,Facebook launch,Launch of the social networking platform Facebook,USA
2005,50.6,Deep Impact mission,NASA's Deep Impact mission collides with comet Tempel 1,USA
2006,55.4,Dwarf planet definition,Pluto reclassified as a dwarf planet by the IAU,International
2007,65.6,iPhone release,Introduction of the first Apple iPhone,USA
2008,73.1,Large Hadron Collider,First operation of the Large Hadron Collider,Switzerland
2009,60.9,Wolf-Rayet Star discovery,Discovery of the largest known star in the Milky Way,Chile
2010,66.2,Graphene,Andre Geim and Konstantin Novoselov awarded the Nobel Prize for Graphene,UK
2011,73.3,Curiosity rover,Launch of NASA's Curiosity Mars rover,USA
2012,76.3,Higgs boson discovery,Confirmation of the existence of the Higgs boson particle,Switzerland
2013,80.7,COSMOS TV series revival,Reboot of the scientific documentary series COSMOS,USA
2014,83.8,CRISPR-Cas9,CRISPR-Cas9 gene-editing technology gains prominence,USA
2015,77.8,Gravitational waves detection,First detection of gravitational waves by LIGO,USA
2016,79.6,Proxima b discovery,Discovery of potentially habitable exoplanet Proxima b,Chile
2017,87.3,First image of a black hole,First-ever image of a black hole captured,International
2018,88.2,AI defeat at Go,AI defeats top human player in the game of Go,USA/China
2019,86.7,Quantum supremacy,Google's claim of quantum supremacy,USA
2020,86.4,COVID-19 vaccines,Development and rollout of the first COVID-19 vaccines,Global
2021,87.6,James Webb Space Telescope,Launch of the James Webb Space Telescope,USA/Europe
2022,85.9,Human genome fully sequenced,Completion of the first fully sequenced human genome,USA
2023,84.5,Artemis I mission,Uncrewed mission to test NASA's Artemis I spacecraft around the moon,USA
这是 Deneb 和 Vega-lite 的已知问题。请参阅https://github.com/deneb-viz/deneb/issues/223
解决方法是使用 Vega 而不是 Vega-lite。一个例子在这里:https://oneException.dev/news/1371652/deneb-s-cross-filter-brush-with-vega