在Rgraphviz中设置子图属性

时间:2017-07-18 20:12:50

标签: r data-visualization graphviz

我试图在Rgraphviz中为子图设置填充颜色。在文档中,暗示您可以设置子图属性,您可以在其中设置子图是否为集群,如下所示:

vc <- as.list(rep("lightgreen", length(subgraphNames)))
names(vc) <- subgraphNames

plot(fG.iip.NEL, 'neato', subGList=subGList, nodeAttrs = list(fillcolor=vc))

不幸的是,以这种方式设置属性似乎对绘图没有任何影响。

因为我的子图包含20-30个节点(完整图形有250个节点),使用nodewise方法对它进行编码并不合理,您必须使用每个节点名称并将其设置为颜色。

编辑我目前的解决方法是:

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="BatchID" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
    <Columns>
        <asp:CommandField ShowSelectButton="True" />
        <asp:BoundField DataField="BatchID" HeaderText="BatchID" InsertVisible="False" ReadOnly="True" SortExpression="BatchID"  />
        <asp:BoundField DataField="Product" HeaderText="Product" SortExpression="Product" />
        <asp:BoundField DataField="BatchSize" HeaderText="BatchSize" SortExpression="BatchSize" />
        <asp:BoundField DataField="Priority" HeaderText="Priority" SortExpression="Priority" />
        <asp:BoundField DataField="StartReq" HeaderText="StartReq" SortExpression="StartReq" />
        <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
    </Columns>
</asp:GridView>

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="BatchID" Visible="False">
    <Columns>
        <asp:BoundField DataField="LotManufactID " HeaderText="LotManufactID" SortExpression="LotManufactID" />
        <asp:BoundField DataField="Ingredient " HeaderText="Ingredient" SortExpression="Ingredient" />
        <asp:BoundField DataField="Actual " HeaderText="Actual" SortExpression="Actual" />
        <asp:BoundField DataField="Target " HeaderText="Target" SortExpression="Target" />
        <asp:BoundField DataField="Minimum " HeaderText="Minimum" SortExpression="Minimum" />
        <asp:BoundField DataField="Maximum " HeaderText="Maximum" SortExpression="Maximum" />
        <asp:BoundField DataField="WeighinhDate  " HeaderText="WeighinhDate" SortExpression="WeighinhDate" />
        <asp:BoundField DataField="Status  " HeaderText="Status" SortExpression="Status" />
        <asp:BoundField DataField="IDBatchID " HeaderText="IDBatchID" SortExpression="IDBatchID" />
    </Columns>
</asp:GridView>

0 个答案:

没有答案