首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >图形流FileSinkSVG2

图形流FileSinkSVG2
EN

Stack Overflow用户
提问于 2020-03-02 03:57:12
回答 1查看 89关注 0票数 1

我正在使用graphstream创建一个图形,并使用FileSinkSVG2将结果写入svg文件。效果很好。唯一的问题是,根据css定义,边缘末端的箭头没有显示出来。有什么建议吗?这是我的代码。

代码语言:javascript
复制
        System.setProperty("gs.ui.renderer", "org.graphstream.ui.j2dviewer.J2DGraphRenderer");          

        String path = "C:\\test.svg";
        Graph graph = new MultiGraph("GraphStream");

        graph.addAttribute("ui.stylesheet", "url('https://www.test.de/graph.css')");

        Layout layout = new HierarchicalLayout();

        graph.addSink(layout);
        layout.addAttributeSink(graph);

        setGraphValues(resultMap, graph);

        layout.compute();

        while (layout.getStabilization() < 1) {
            layout.compute();
        }           

        FileSinkSVG3 svg = new FileSinkSVG3();

        try {

            svg.writeAll(graph, path);

        } catch (IOException ex) {
            logger.info(ex.getMessage(), ex);
           return;
        }

CSS-文件:

代码语言:javascript
复制
graph {
    fill-color: white;
}

node {
    size: 100px, 50px;
    shape: rounded-box;    
    fill-color: white;
    stroke-mode: plain;
    stroke-color: red;
    text-visibility-mode:normal;
    text-color:black;
    text-background-color:white;
    text-style:normal;
    text-alignment:center;
    text-size:18px;
}


edge {
arrow-shape:arrow;
arrow-size: 3px, 2px; 
shape: line;
size: 2px;
fill-color: red;

}
EN

回答 1

Stack Overflow用户

发布于 2020-03-11 00:00:43

乍一看,FileSinkSVG2似乎不支持自定义边缘,包括箭头和形状。您可以在github中打开一个问题,或者在pull request中提出您自己的实现。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60479210

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档