DGML - 将权重添加到 link
DGML - Add weight to link
如何在 DGML 文件中向边或 Link 添加权重或值?
<?xml version='1.0' encoding='utf-8'?>
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="a" Label="a" Size="10" />
<Node Id="b" Background="#FF008080" Label="b" />
<Node Id="c" Label="c" Start="2010-06-10" />
</Nodes>
<Links>
<Link Source="a" Target="b" />
<Link Source="a" Target="c" />
</Links>
<Properties>
<Property Id="Background" Label="Background" DataType="Brush" />
<Property Id="Label" Label="Label" DataType="String" />
<Property Id="Size" DataType="String" />
<Property Id="Start" DataType="DateTime" />
</Properties>
</DirectedGraph>
我希望能够为每个节点之间的线分配一个权重或值,以指定节点之间的强度。
您可以为每个 link 添加权重,方法是向每个 Link 来源添加一个带有值的标签字段。这些数字将显示在图表上的箭头旁边。
<Link Source="a" Target="b" Label="5" />
<Link Source="a" Target="c" Label="6" />
此外,可以通过创建类别组并将该组分配给每个节点来更改每个节点的背景颜色。
<Category Id="Orange" Background="Orange" />
<Category Id="Yellow" Background="Yellow" />
<Node Id="a" Category="Orange" />
<Node Id="b" Category="Yellow" />
这是一个使用 link 权重样式的示例:
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="Banana" UseManualLocation="True" />
<Node Id="Test" UseManualLocation="True" />
</Nodes>
<Links>
<Link Source="Test" Target="Banana" Priority="10"/>
<Link Source="Test" Target="Green" />
</Links>
<Properties>
<Property Id="Bounds" DataType="System.Windows.Rect" />
<Property Id="UseManualLocation" DataType="System.Boolean" />
</Properties>
<Styles>
<Style TargetType="Link">
<Setter Property="Weight" Expression="Priority" />
</Style>
</Styles>
</DirectedGraph>
如何在 DGML 文件中向边或 Link 添加权重或值?
<?xml version='1.0' encoding='utf-8'?>
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="a" Label="a" Size="10" />
<Node Id="b" Background="#FF008080" Label="b" />
<Node Id="c" Label="c" Start="2010-06-10" />
</Nodes>
<Links>
<Link Source="a" Target="b" />
<Link Source="a" Target="c" />
</Links>
<Properties>
<Property Id="Background" Label="Background" DataType="Brush" />
<Property Id="Label" Label="Label" DataType="String" />
<Property Id="Size" DataType="String" />
<Property Id="Start" DataType="DateTime" />
</Properties>
</DirectedGraph>
我希望能够为每个节点之间的线分配一个权重或值,以指定节点之间的强度。
您可以为每个 link 添加权重,方法是向每个 Link 来源添加一个带有值的标签字段。这些数字将显示在图表上的箭头旁边。
<Link Source="a" Target="b" Label="5" />
<Link Source="a" Target="c" Label="6" />
此外,可以通过创建类别组并将该组分配给每个节点来更改每个节点的背景颜色。
<Category Id="Orange" Background="Orange" />
<Category Id="Yellow" Background="Yellow" />
<Node Id="a" Category="Orange" />
<Node Id="b" Category="Yellow" />
这是一个使用 link 权重样式的示例:
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="Banana" UseManualLocation="True" />
<Node Id="Test" UseManualLocation="True" />
</Nodes>
<Links>
<Link Source="Test" Target="Banana" Priority="10"/>
<Link Source="Test" Target="Green" />
</Links>
<Properties>
<Property Id="Bounds" DataType="System.Windows.Rect" />
<Property Id="UseManualLocation" DataType="System.Boolean" />
</Properties>
<Styles>
<Style TargetType="Link">
<Setter Property="Weight" Expression="Priority" />
</Style>
</Styles>
</DirectedGraph>