繁体   English   中英

Vega-Lite - 如何 plot 箭头?

[英]Vega-Lite - How to plot an arrow?

我正在尝试生成有向图的 plot 。 因此,我想 plot 从一个节点到另一个节点的箭头。 是否可以在 Vega-Lite 上执行此操作? 如果是,那又如何?

Vega-Lite 不支持线段上的箭头。 您可以在此处查看开放功能请求: https://github.com/vega/vega-lite/issues/4270

对于某些应用程序,可能适合使用 unicode 箭头注释图表; 这是一个简短的示例( 在编辑器中打开):

{
  "data": {
    "values": [{"x": 1, "y": 2}, {"x": 2, "y": 4}]
  },
  "mark": {"type": "text", "angle": -45, "dx": -20, "fontSize": 35},
  "encoding": {
    "text": {"value": "➟"},
    "x": {"field": "x", "type": "quantitative"},
    "y": {"field": "y", "type": "quantitative"}
  }
}

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM