1.3.2 • Published 6 years ago
at-chart v1.3.2
chart
d3 force layout for learning
- Vue
- d3.js
- web worker
Client Render Static Force Layout
nodes | d3 | d3 && web worker | Echarts Force |
---|---|---|---|
1000 | ms | ms | > d3 && web worker |
5000 | 20s | 5s | > d3 && web worker |
10000 | 40s | 10s | > d3 && web worker |
Install
yarn add at-chart
Usage
import at-chart from 'at-chart'
import 'at-chart/dist/css/AtChart.min.css'
Vue.use(at-chart)
<template>
<div>
<p>{{process}}</p>
<at-chart :nodes="nodes" :edges="edges" @renderProcess="setProcess"/>
</div>
</template>
<script>
const num = 1000
const nodes = d3.range(num).map(function (i) {
return {
index: i,
name: '10.255.81.47'
}
})
const edges = d3.range(nodes.length - 1).map(function (i) {
return {
source: Math.floor(Math.sqrt(i)),
target: i + 1
}
})
export default {
name: 'app',
data() {
return {
process: '',
nodes = nodes
edges = edges
}
},
methods: {
setProcess(process) {
this.process = process
}
}
}
</script>
Example
nodemon server.js
Attributes
Attribute | Description | Type | Accepted Values | Default |
---|---|---|---|---|
nodes | Nodes | Array | ——— | ——— |
edges | Edges | Array | ——— | ——— |
Events
Event Name | Description | Parameters |
---|---|---|
renderProcess | Render Process | process |
Methods
Method | Description | Parameters |
---|
Update
yarn upgrade at-chart
Build Setup npm or yarn
# install dependencies
yarn install
# serve with hot reload at localhost:xxx
yarn run dev
# build for production with minification
yarn run package
# build for production and view the bundle analyzer report
npm run package --report
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.29
6 years ago
1.0.28
6 years ago
1.0.27
6 years ago
1.0.26
6 years ago
1.0.25
6 years ago
1.0.24
6 years ago
1.0.23
6 years ago
1.0.22
6 years ago
1.0.21
6 years ago
1.0.20
6 years ago
1.0.19
6 years ago
1.0.18
6 years ago
1.0.17
6 years ago
1.0.16
6 years ago
1.0.15
6 years ago
1.0.14
6 years ago
1.0.13
6 years ago
1.0.12
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago