唯杰地图 logo唯杰地图
VJMAP
EN

linkage.json

vjvp/examples/linkage.json 3.9 KB113 行
原文
{
  "project": {
    "name": "数据联动示例",
    "screen": {
      "uid": "screen_main",
      "type": "screen",
      "name": "主页面",
      "options": {
        "fullscreen-mode": "fill-uniform", "fill-auto-expand": true,
        "size": [1920, 1080],
        "background-color": "#0c0d0e",
        "cross-filter-receive": true,
        "select-sync-receive": true
      },
      "stateOverrides": {},
      "widgets": [
        {
          "uid": "w_title",
          "type": "basic-text",
          "options": {
            "position": [140, 70],
            "size": [1200, 60],
            "text": "数据联动示例:点击右侧饼图的城市,左侧柱状图随之联动",
            "text-font": { "size": 30, "color": "#ffffff" },
            "text-position": "left"
          },
          "stateOverrides": {}
        },
        {
          "uid": "w_bar",
          "type": "chart-bar",
          "name": "各城市男女人均收入(受联动)",
          "options": {
            "position": [140, 200],
            "size": [900, 520],
            "title": "各城市男女人均收入",
            "show-legend": true,
            "show-label": true,
            "cross-filter-receive": true,
            "category-field": [["conn_income", "tbl_income", "城市"]],
            "metric-fields": [
              ["conn_income", "tbl_income", "男性人均收入"],
              ["conn_income", "tbl_income", "女性人均收入"]
            ]
          },
          "stateOverrides": {}
        },
        {
          "uid": "w_pie",
          "type": "chart-pie",
          "name": "各城市人均收入占比(联动其他)",
          "options": {
            "position": [1140, 200],
            "size": [600, 520],
            "title": "各城市人均收入占比",
            "show-legend": true,
            "show-label": true,
            "cross-filter-emit": true,
            "category": [["conn_income", "tbl_income", "城市"]],
            "value": [["conn_income", "tbl_income", "总人均收入"]]
          },
          "stateOverrides": {}
        }
      ]
    },
    "screens": [],
    "params": {},
    "settings": {}
  },
  "connections": [
    {
      "uid": "conn_income",
      "name": "城市人均收入",
      "type": "json",
      "connectorType": "json",
      "config": { "copyToRoot": true, "fileName": "" },
      "tables": [
        {
          "uid": "tbl_income",
          "name": "城市人均收入",
          "fields": [
            { "uid": "城市", "alias": "城市", "type": "string" },
            { "uid": "男性人均收入", "alias": "男性人均收入", "type": "number" },
            { "uid": "女性人均收入", "alias": "女性人均收入", "type": "number" },
            { "uid": "总人均收入", "alias": "总人均收入", "type": "number" }
          ]
        }
      ]
    }
  ],
  "connectionData": {
    "conn_income": [
      {
        "tableId": "tbl_income",
        "tableName": "城市人均收入",
        "fields": [
          { "uid": "城市", "alias": "城市", "type": "string" },
          { "uid": "男性人均收入", "alias": "男性人均收入", "type": "number" },
          { "uid": "女性人均收入", "alias": "女性人均收入", "type": "number" },
          { "uid": "总人均收入", "alias": "总人均收入", "type": "number" }
        ],
        "rows": [
          { "城市": "北京", "男性人均收入": 11111, "女性人均收入": 22222, "总人均收入": 33333 },
          { "城市": "上海", "男性人均收入": 12345, "女性人均收入": 23456, "总人均收入": 35801 },
          { "城市": "杭州", "男性人均收入": 22222, "女性人均收入": 33333, "总人均收入": 55555 },
          { "城市": "南京", "男性人均收入": 23456, "女性人均收入": 34567, "总人均收入": 58023 }
        ]
      }
    ]
  },
  "dataRules": []
}