Git Product home page Git Product logo

vizservice's Introduction

VizService

O VizService é um microserviço capaz de produzir gráficos SVG a partir de diagramas descritos na linguagem Dot. Para isso, ele executa o aplicativo do GraphViz, passando o diagrama como parâmetro. O resultado obtido é repassado na resposta do método /svg.

O VisService requer que o GraphViz seja instalado na máquina. Em cada sistema operacional a instalação será feita de uma forma diferente. No caso do Mac OS X, podemos proceder da seguinte maneira:

  1. Instalar o MacPorts
  2. Executar:
ports install graphviz

O vizservice tem apenas 2 métodos:

  1. GET /test - Método de teste que não recebe nenhum parâmetro e produz um diagrama de exemplo
  2. POST /svg - Método que recebe um POST com Content-Type=text/vnd.graphviz e um body com uma string que representa o Dot e produz um gráfico no formato SVG
curl -X POST \
  http://localhost:8080/vizservice/svg \
  -H 'cache-control: no-cache' \
  -H 'content-type: text/vnd.graphviz' \
  -H 'postman-token: ae7de52a-45d0-f14b-b6b5-5edf32a06cca' \
  -d 'digraph "" { graph[ratio="0.4" tooltip="Documentos Relacionados" color="#e2eaee" bgcolor="#e2eaee" URL="javascript: bigmapRelacaoDocs();"]; node[fillcolor=white  style=filled]; edge[penwidth=2];  "OTZZ-MEM-2018/00002-A"[shape="rectangle"][label="MEM2-A"][color="red"][URL="exibir?sigla=OTZZ-MEM-2018/00002-A" penwidth=2][tooltip="OTZZ-MEM-2018/00002-A"]; "OTZZ-RHU-2018/00001-V01"[shape="rectangle"][label="RHU1-V01"][URL="exibir?sigla=OTZZ-RHU-2018/00001-V01" penwidth=2][tooltip="OTZZ-RHU-2018/00001-V01"]; "OTZZ-MEM-2018/00001-A"[shape="rectangle"][label="MEM1-A"][URL="exibir?sigla=OTZZ-MEM-2018/00001-A" penwidth=2][tooltip="OTZZ-MEM-2018/00001-A"]; "OTZZ-MEM-2018/00002-A" -> "OTZZ-RHU-2018/00001-V01"[style="dashed"][tooltip="Vinculação"][color="gray"][dir=none]; "OTZZ-MEM-2018/00001-A" -> "OTZZ-MEM-2018/00002-A"[style="dashed"][tooltip="Juntada"][dir=back]; }'

A chamada ao VizService segue exatamente o mesmo contrato que o container Docker omerio/graphviz-server, portanto, uma instalação do Projeto-Siga baseada em containers do Docker não precisará usar o VizServer, poderá simplesmente substituir esse artefato pelo graphviz-server.

Um site online para montar o gráfico a partir da estrutura montada - https://www.devtoolsdaily.com/graphviz/?#v2=N4IgJg9gLiBcIgL5A

vizservice's People

Contributors

crivano avatar raphaelpaiva avatar jmolivei avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Chrystinne Fernandes avatar  avatar Dri avatar  avatar  avatar Raquel  avatar  avatar Rafaela Castro avatar Herval avatar  avatar  avatar  avatar  avatar

Forkers

codata-gedes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.