guru.nidi.graphviz.engine.Graphviz.render()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(418)

本文整理了Java中guru.nidi.graphviz.engine.Graphviz.render()方法的一些代码示例,展示了Graphviz.render()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graphviz.render()方法的具体详情如下:
包路径:guru.nidi.graphviz.engine.Graphviz
类名称:Graphviz
方法名:render

Graphviz.render介绍

暂无

代码示例

代码示例来源:origin: schemacrawler/SchemaCrawler

  1. Graphviz.fromString(dotSource).render(format).toFile(outputFile.toFile());

代码示例来源:origin: apache/oozie

  1. @Override
  2. public String call() throws Exception {
  3. final Graphviz graphviz = newGraphviz();
  4. return graphviz.render(Format.SVG).toString();
  5. }
  6. }

代码示例来源:origin: apache/oozie

  1. @Override
  2. public BufferedImage call() throws Exception {
  3. final Graphviz graphviz = newGraphviz();
  4. return graphviz.render(Format.PNG).toImage();
  5. }
  6. }

代码示例来源:origin: org.apache.oozie/oozie-core

  1. @Override
  2. public String call() throws Exception {
  3. final Graphviz graphviz = newGraphviz();
  4. return graphviz.render(Format.SVG).toString();
  5. }
  6. }

代码示例来源:origin: org.apache.oozie/oozie-core

  1. @Override
  2. public BufferedImage call() throws Exception {
  3. final Graphviz graphviz = newGraphviz();
  4. return graphviz.render(Format.PNG).toImage();
  5. }
  6. }

代码示例来源:origin: gradle.plugin.com.simonharrer/gradle-graphviz-plugin

  1. projectPath.relativize(targetPngPath).toString());
  2. System.out.println(message);
  3. Graphviz.fromFile(path.toFile()).render(Format.PNG).toFile(targetPngPath.toFile());
  4. } catch (IOException e) {
  5. throw new RuntimeException(e);

代码示例来源:origin: CESNET/perun

  1. @Override
  2. public void write(Object object) throws IllegalArgumentException, IOException, RpcException {
  3. if (object instanceof Graphviz) {
  4. ((Graphviz) object).render(Format.SVG).toOutputStream(outputStream);
  5. } else {
  6. writePerunException(new InternalErrorException("Received object was not Graphviz object."));
  7. }
  8. }

代码示例来源:origin: org.apache.oozie/oozie-fluent-job-api

  1. public static void graphToPng(final Graph graph, final String fileName) throws IOException {
  2. final MutableGraph mg = Parser.read(graphToDot(graph));
  3. mg.setName(fileName);
  4. Graphviz.fromGraph(mg)
  5. .width(PNG_WIDTH)
  6. .render(Format.PNG)
  7. .toFile(new File(PARENT_FOLDER_NAME, FilenameUtils.getName(fileName)));
  8. }

代码示例来源:origin: apache/oozie

  1. public static void graphToPng(final Graph graph, final String fileName) throws IOException {
  2. if (!isProperJDKVersion()) {
  3. System.err.println("JDK version is not correct, omitting generating PNG from graph.");
  4. return;
  5. }
  6. final MutableGraph mg = Parser.read(graphToDot(graph));
  7. mg.setName(fileName);
  8. try {
  9. Graphviz.fromGraph(mg)
  10. .width(PNG_WIDTH)
  11. .render(Format.PNG)
  12. .toFile(new File(PARENT_FOLDER_NAME, FilenameUtils.getName(fileName)));
  13. }
  14. catch (final GraphvizException e) {
  15. throw new GraphvizException(String.format("Java version is %s", System.getProperty("java.version")), e);
  16. }
  17. }

代码示例来源:origin: apache/oozie

  1. public static void workflowToPng(final Workflow workflow, final String fileName) throws IOException {
  2. if (!isProperJDKVersion()) {
  3. System.err.println("JDK version is not correct, omitting generating PNG from workflow.");
  4. return;
  5. }
  6. final MutableGraph mg = Parser.read(workflowToDot(workflow));
  7. mg.setName(fileName);
  8. try {
  9. Graphviz.fromGraph(mg)
  10. .width(PNG_WIDTH)
  11. .render(Format.PNG)
  12. .toFile(new File(PARENT_FOLDER_NAME, FilenameUtils.getName(fileName)));
  13. }
  14. catch (final GraphvizException e) {
  15. throw new GraphvizException(String.format("Java version is %s", System.getProperty("java.version")), e);
  16. }
  17. }

代码示例来源:origin: org.apache.oozie/oozie-fluent-job-api

  1. public static void workflowToPng(final Workflow workflow, final String fileName) throws IOException {
  2. final MutableGraph mg = Parser.read(workflowToDot(workflow));
  3. mg.setName(fileName);
  4. Graphviz.fromGraph(mg)
  5. .width(PNG_WIDTH)
  6. .render(Format.PNG)
  7. .toFile(new File(PARENT_FOLDER_NAME, FilenameUtils.getName(fileName)));
  8. }
  9. }

代码示例来源:origin: us.fatehi/schemacrawler

  1. Graphviz.fromString(dotSource).render(format).toFile(outputFile.toFile());

代码示例来源:origin: us.fatehi/schemacrawler-integrations

  1. Graphviz.fromString(dotSource).render(format).toFile(outputFile.toFile());

代码示例来源:origin: nidi3/graphviz-java

  1. private static String render(String raw) {
  2. final int pos = raw.indexOf("@@@");
  3. final Options options;
  4. final String src;
  5. if (pos < 0) {
  6. options = Options.create().format(SVG_STANDALONE);
  7. src = raw;
  8. } else {
  9. options = Options.fromJson(raw.substring(0, pos));
  10. src = raw.substring(pos + 3);
  11. }
  12. return Graphviz.fromString(src)
  13. .engine(options.engine)
  14. .totalMemory(options.totalMemory)
  15. .yInvert(options.yInvert)
  16. .render(options.format).toString();
  17. }

代码示例来源:origin: com.simiacryptus/mindseye-test

  1. log.eval(() -> {
  2. return Graphviz.fromGraph(TestUtil.toGraph(network))
  3. .height(400).width(600).render(Format.PNG).toImage();
  4. });

代码示例来源:origin: com.simiacryptus/mindseye-labs

  1. log.eval(() -> {
  2. return Graphviz.fromGraph(TestUtil.toGraph(network))
  3. .height(400).width(600).render(Format.PNG).toImage();
  4. });

代码示例来源:origin: com.simiacryptus/mindseye

  1. log.eval(() -> {
  2. return Graphviz.fromGraph(TestUtil.toGraph(network))
  3. .height(400).width(600).render(Format.PNG).toImage();
  4. });

代码示例来源:origin: nidi3/graphviz-java

  1. public static void createFontTest(String name, double adjust, File output) throws IOException {
  2. final Node width = node("If text is too narrow, increase fontAdjust. If it's too wide, decrease it.");
  3. final Node center = node(Label.html("A very long node label that should be centered inside the border<br/>"
  4. + "If text is too much left, increase fontAdjust.<br/>"
  5. + "If it's too much right, decrease it."));
  6. Graphviz.fromGraph(graph()
  7. .nodeAttr().with(Font.name(name), Shape.RECTANGLE)
  8. .with(width.link(center)))
  9. .fontAdjust(adjust)
  10. .render(PNG)
  11. .toFile(output);
  12. }

代码示例来源:origin: com.simiacryptus/mindseye

  1. log.eval(() -> {
  2. return Graphviz.fromGraph(TestUtil.toGraph(fwdNetwork))
  3. .height(400).width(600).render(Format.PNG).toImage();
  4. });
  5. log.eval(() -> {
  6. return Graphviz.fromGraph(TestUtil.toGraph(revNetwork))
  7. .height(400).width(600).render(Format.PNG).toImage();
  8. });
  9. log.eval(() -> {
  10. return Graphviz.fromGraph(TestUtil.toGraph(supervisedNetwork))
  11. .height(400).width(600).render(Format.PNG).toImage();
  12. });

代码示例来源:origin: com.simiacryptus/mindseye-labs

  1. log.eval(() -> {
  2. return Graphviz.fromGraph(TestUtil.toGraph(fwdNetwork))
  3. .height(400).width(600).render(Format.PNG).toImage();
  4. });
  5. log.eval(() -> {
  6. return Graphviz.fromGraph(TestUtil.toGraph(revNetwork))
  7. .height(400).width(600).render(Format.PNG).toImage();
  8. });
  9. log.eval(() -> {
  10. return Graphviz.fromGraph(TestUtil.toGraph(supervisedNetwork))
  11. .height(400).width(600).render(Format.PNG).toImage();
  12. });

相关文章