diff --git a/frontend/mock/data/plugin/graphs/graphs.js b/frontend/mock/data/plugin/graphs/graphs.js new file mode 100644 index 0000000000000000000000000000000000000000..6097e8bee4b8fe98324b62e0b82af4602f4eace8 --- /dev/null +++ b/frontend/mock/data/plugin/graphs/graphs.js @@ -0,0 +1,115 @@ +/** + * get mock data + * + * @param {string} path request path + * @param {Object} queryParam query params + * @param {Object} postParam post params + * @return {Object} + */ +module.exports = function (path, queryParam, postParam) { + return { + // moock delay + _timeout: 0, + // mock http status + _status: 200, + // mock response data + _data: { + status: 0, + msg: 'SUCCESS', + data: { + title: { + text: 'Graph 简单示例' + }, + tooltip: {}, + animationDurationUpdate: 1500, + animationEasingUpdate: 'quinticInOut', + series : [ + { + type: 'graph', + layout: 'none', + symbolSize: 50, + roam: true, + label: { + normal: { + show: true + } + }, + edgeSymbol: ['circle', 'arrow'], + edgeSymbolSize: [4, 10], + edgeLabel: { + normal: { + textStyle: { + fontSize: 20 + } + } + }, + data: [{ + name: '节点1', + x: 300, + y: 300 + }, { + name: '节点2', + x: 800, + y: 300 + }, { + name: '节点3', + x: 550, + y: 100 + }, { + name: '节点4', + x: 550, + y: 500 + }], + // links: [], + links: [{ + source: 0, + target: 1, + symbolSize: [5, 20], + label: { + normal: { + show: true + } + }, + lineStyle: { + normal: { + width: 5, + curveness: 0.2 + } + } + }, { + source: '节点2', + target: '节点1', + label: { + normal: { + show: true + } + }, + lineStyle: { + normal: { curveness: 0.2 } + } + }, { + source: '节点1', + target: '节点3' + }, { + source: '节点2', + target: '节点3' + }, { + source: '节点2', + target: '节点4' + }, { + source: '节点1', + target: '节点4' + }], + lineStyle: { + normal: { + opacity: 0.9, + width: 2, + curveness: 0 + } + } + } + ] + } + } + }; +}; diff --git a/frontend/src/common/component/AppMenu.san b/frontend/src/common/component/AppMenu.san index 8a31cce8838bbfe1228059eb8146737059a1a0d9..2538a3277561e62057cee9b977b7cd57c5dfa3d5 100644 --- a/frontend/src/common/component/AppMenu.san +++ b/frontend/src/common/component/AppMenu.san @@ -39,6 +39,11 @@ export default { url: '/histograms', title: 'HISTOGRAMS', name: 'histograms' + }, + { + url: '/graphs', + title: 'GRAPHS', + name: 'graphs' } ] }; diff --git a/frontend/src/graph/Graph.san b/frontend/src/graph/Graph.san new file mode 100644 index 0000000000000000000000000000000000000000..5b7cb2359c6e9fdf819f8992630735e44cccc9a4 --- /dev/null +++ b/frontend/src/graph/Graph.san @@ -0,0 +1,92 @@ + + + + + diff --git a/frontend/src/graph/index.js b/frontend/src/graph/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4f76411c1a2c47596b683970c046a2fdf8d17ce0 --- /dev/null +++ b/frontend/src/graph/index.js @@ -0,0 +1,9 @@ +import {router} from 'san-router'; + +import Graph from './Graph'; + +router.add({ + target: '#content', + rule: '/graphs', + Component: Graph +}); diff --git a/frontend/src/graph/ui/chart.san b/frontend/src/graph/ui/chart.san new file mode 100644 index 0000000000000000000000000000000000000000..593186f040b6031e4708d2f11ac82c154c2845ac --- /dev/null +++ b/frontend/src/graph/ui/chart.san @@ -0,0 +1,73 @@ + + + diff --git a/frontend/src/graph/ui/config.san b/frontend/src/graph/ui/config.san new file mode 100644 index 0000000000000000000000000000000000000000..89f218d42b313de19035b158347f4248224bebf5 --- /dev/null +++ b/frontend/src/graph/ui/config.san @@ -0,0 +1,68 @@ + + + diff --git a/frontend/src/histogram/ui/config.san b/frontend/src/histogram/ui/config.san index 6b4986e06d38d0d9fc6c8385bb05b4a103bb7ec4..b48f245f57b84d246b4f034ba536abf7a88a034b 100644 --- a/frontend/src/histogram/ui/config.san +++ b/frontend/src/histogram/ui/config.san @@ -1,5 +1,5 @@