Giter VIP home page Giter VIP logo

kg-vis-api's Introduction

KG-VIS-API

try to make it professional try again

quick start

uvicorn demo:app --host=0.0.0.0 --port=4002 --reload

format to visual

  • cypher output to json format for echarts
{
  "nodes": [
    { "id": "0", "symbolSize": 20.1, "x": 10, "y": 20, "category": 1 },
    { "id": "1", "symbolSize": 20.1, "x": 10, "y": 20, "category": 0 }
  ],
  "links": [
    { "source": "0", "target": "1" },
    { "source": "1", "target": "0" }
  ],
  "categories": [{ "name": "CASE" }, { "name": "ACTION" }]
}

这个

{
  "res": [
    { "node": { "c_id": "19", "case": "徐某某盗窃罪一审刑事判决书" } },
    { "node": { "keyword": "罚金", "k_id": "0" } },
    { "node": { "keyword": "有期徒刑", "k_id": "1" } },
    { "node": { "keyword": "从轻处罚", "k_id": "4" } },
    { "node": { "keyword": "并处罚金", "k_id": "6" } },
    { "node": { "keyword": "行政处罚", "k_id": "60" } },
    {
      "node": {
        "fact": "本案于2015年3月30日被行政拘留15日,同年4月9日被刑事拘留",
        "f_id": "488"
      }
    },
    { "node": { "fact": "同年4月21日被逮捕。", "f_id": "489" } }
  ]
}
  • option for echarts graph

https://echarts.apache.org/en/option.html#series-graph

{
  "nodes": [
    {
      "id": "0",
      "symbol": "rect",
      "symbolSize": 20.1,
      "x": 10,
      "y": 20,
      "category": 1
    },
    {
      "id": "1",
      "symbolSize": 20.1,
      "x": 10,
      "y": 20,
      "category": 0,
      "itemStyle": { "color": "rgb(255,255,255)" }
    }
  ],
  "links": [
    {
      "source": "0",
      "target": "1",
      "value": 10,
      "lineStyle": { "color": "rgb(255,255,255)" }
    },
    { "source": "1", "target": "0", "value": 4, "symbolSize": 20.1 }
  ],
  "categories": [{ "name": "CASE" }, { "name": "ACTION" }]
}

kg-vis-api's People

Contributors

jinhuasu avatar

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.