1.0.21 • Published 4 years ago

suwis-paths v1.0.21

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

智能路径分析图表插件

website: http://npmdoc.suwis.com/suwis-paths/

介绍

一个基于zrender的vue 智能路径分析插件,可用于用户走向分析

示意

Image text

使用

<template lang="html">
  <section id="app" class="cti-flow">
    <div class="data-path">
      <cti-path ref="path"
      :options="options"
      :params="params"
      @lazyLoad="lazyLoad"
      :from="pathData.from"
      :land="pathData.land"
      :towards="pathData.towards"
      :title="pathData.title"
      :linksTextTop="pathData.linksTextTop"
      :linksTextBottom="pathData.linksTextBottom">
      </cti-path>
    </div>
  </section>
</template>

<script type="text/javascript">
import path from 'suwis-paths/components/paths'
let sessions = {
  counts: 0,
  nexts: []
}
export default {
  components: {
    'cti-path': path
  },
  data() {
    return {
      // 图表配置
      options: {
        horizontalInterval: 88,
        childkey: 'item',
        nodes: {
          width: 180,
          height: 52,
          // 格式化节点标题
          text(data) {
            // TODO: return text
            return ''
          },
          render(data) {
            // TODO: return styleObject
            return {}
          }
        },
        // 路径
        paths: {
          render(opt) {
            // TODO: return styleObject
            return {}
          }
        },
        // 列
        columns: {
          // 头
          headText(data) {
            // TODO: return text
            return ''
          },
          // 列底部文字
          footerText(data) {
            // TODO: return text
            return ''
          }
        },
        // 弹出层
        layer: {
          width: 180,
          height: 88,
          autodir: false,
          text(item) {
            // TODO: return styleObject
            return text
          }
        }
      }
    }
  },
  methods: {
    // 远程加载
    lazyLoad(opt) {
      // TODO: 获取集合
      let subitems = [...]
      opt.resolve(subitems)
    }
  }
};
</script>

props

属性说明类型默认值
from媒体来源Array[]
land落地页Object{}
towards走向(子节点)Array[]
options配置Object{}

from 数据结构

[{
  "landpage": "car_eado-plus_wap",
  "mainpg": "car_eado-plus_wap",
  "pg_count": "44",
  "visit": "13023",
  "uv": "12264",
  "landpage_name": "car_eado-plus_wap"
}, {
  "landpage": "home_wap",
  "mainpg": "home_wap",
  "pg_count": "86",
  "visit": "12344",
  "uv": "11666",
  "landpage_name": "首页"
}, {
  "landpage": "car_cs75plus_wap",
  "mainpg": "car_cs75plus_wap",
  "pg_count": "37",
  "visit": "10891",
  "uv": "10475",
  "landpage_name": "car_cs75plus_wap"
}]

land 数据结构

{
  "landpage": "car_cs75plus_wap",
  "mainpg": "car_cs75plus_wap",
  "pg_count": "37",
  "visit": "10891",
  "uv": "10475",
  "landpage_name": "car_cs75plus_wap"
}

towards 数据结构

[{
  "pg": "https://www.xxx.com.cn/",
  "pg_count": "12",
  "visit": "102",
  "uv": "102",
  "subpath": "897c295d89cc35b6bd6789c5f3e1d6fc",
  "rank": "3",
  "pg_name": "首页-PC",
  "main_url": "car_eado-plus_wap^https://www.xxx.com.cn/",
  "item_next": "Y",
  "item": [{
    "pg": "https://www.xxx.com.cn/m/",
    "pg_count": "11",
    "visit": "78",
    "uv": "78",
    "subpath": "0dc1713fe3e2726677637c0949b4febf",
    "rank": "4",
    "pg_name": "首页-WAP",
    "main_url": "car_eado-plus_wap^https://www.xxx.com.cn/",
    "item_next": "Y",
    "item": []
  }, {
    "pg": "https://www.xxx.com.cn/m/car/eado-plus/",
    "pg_count": "6",
    "visit": "7",
    "uv": "7",
    "subpath": "0dc1713fe3e2726677637c0949b4febf",
    "rank": "4",
    "pg_name": "https://www.xxx.com.cn/m/car/eado-plus/",
    "main_url": "car_eado-plus_wap^https://www.xxx.com.cn/",
    "item_next": "Y",
    "item": []
  }]
}]

options

属性说明类型默认值
horizontalInterval节点间的水平距离Number180
maxRows最多渲染行Number12
childkey子集key,通过此key访问数据结构中的子节点Stringchildren
renderer渲染模式Stringcanvas
grid.top网格用来控制整体节点的垂直偏移Number5
nodes节点属性Object-
nodes.width节点宽度Number230
nodes.height节点高度Number50
nodes.radius节点圆角Number10
nodes.namekey节点标题keyStringname
nodes.valkey节点值Stringvalue
nodes.text节点文字function{}
nodes.render自定义节点function{}
paths自定义路径属性Object{}
mousewheel是否开启鼠标滚动Booleanfalse
draggable是否可拖拽Booleantrue
scrollbar.speed滚动速度Number5
scrollbar.radius滚动条圆角Number5
scrollbar.height滚动条高度Number5
bezier.opacity路径透明度Number0.6
bezier.hoverOpacity路径悬浮透明度Number0.8
columns.headText路径悬浮透明度function返回字符串
layer.width悬浮窗宽度Number230
layer.height悬浮窗高度Number60
layer.fill填充色Stringrgba(88, 94, 107, 1)
layer.textFill文字填充颜色String#fff
layer.speed移动速度Number200
layer.offset偏移量Number20
layer.autodir自动左右转向Booleantrue
layer.text显示文本function返回字符串
1.0.21

4 years ago

1.0.20

4 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago