Skip to content

Commit

Permalink
Merge branch 'release-1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
CS-Tao committed Jul 15, 2018
2 parents f8c7dc3 + 6045b4b commit 3d91f94
Show file tree
Hide file tree
Showing 28 changed files with 221 additions and 142 deletions.
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:8

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/GTD-Visualization

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
5 changes: 4 additions & 1 deletion .electron-vue/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ let webConfig = {
entry: {
web: path.join(__dirname, '../src/renderer/main.js')
},
node: {
fs: 'empty'
},
module: {
rules: [
{
Expand Down Expand Up @@ -94,7 +97,7 @@ let webConfig = {
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
'process.env': require('../config/prod.env')
}),
new ExtractTextPlugin('styles.css'),
new HtmlWebpackPlugin({
Expand Down
37 changes: 18 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@ matrix:
- CC: clang
- CXX: clang++
- npm_config_clang: 1
- GIT_PAGE_REF: github.com/CS-Tao/GTD-Visualization.git
- secure: RrwNU+V0+N/dPt+49suq8eeA4UiykOF8jahrFSFyJN0jfoY/VjymRV9CoqM+vG7q0iRwg3mjflfj8Nhy+Q9XbCOY/oIzVEabvLzOiNwWXF/yYKRjJwfulkpuwR1s3FioUUVUlazdM5t15lXbnwKZVuEH2kJLlfg/6j3Scd7X5wxyyVmXpYq/jtj3X71PusmHh6pRFO9izUejSC7PMrwZyE5neQEjXJYE3gi9oexuF6uI4DixrN3MGnxYavGglYSw944zcEPePUOZTx7vdx2UfD/uhGQbwxtLt4DvUDmfbN3Iy6F4xsZk1QuI/zE58RQ1LLS6MhDnRybhbzD0edo9P0KftREXDHjli1pCMmH+uTslDzbTKnB2PXI15wFDWst75BxR7CVOLKw8b752eSniObGapX6R6/2cyiLCQqB7rNfmgvpA2IwnqjUyykoNU+VT2YwfHrOZQiUZw6aZfv+2cGt+JFoKgGffGS3ejhV+11QL0O92lbgna/+nBZMGDcZZrWSw5YnrvX3bX66fHgOo1BHgxOFwpi9wJ/zAkP/6tSO/iLmZFg63sdLSNhoB4egVrIJUyPUF2X9Yd/T2Sks156YaYWK9loWmKfmP8Wa/hpjhsqpf3ApbjCbLeRqLXB6pZJ6yvyQP0nWW1Cqjr7Z+LywT4khiVtJP9gdPc22XpG0=
compiler: clang

cache:
directories:
- node_modules
- "$HOME/.electron"
- "$HOME/.cache"

addons:
apt:
packages:
- libgnome-keyring-dev
- icnsutils
- xvfb

before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
"$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
| tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi

install:
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
Expand All @@ -39,26 +42,22 @@ install:
- source ~/.bashrc
- npm install -g xvfb-maybe
- npm install -g vuepress
- yarn
- npm install

script:
- xvfb-maybe node_modules/.bin/karma start test/unit/karma.conf.js
- yarn run pack && xvfb-maybe node_modules/.bin/mocha test/e2e
- npm install coveralls
- cat ./test/unit/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- npm run build:docs
- npm run build:web
- cd dist
- git init
- git config user.name "CS-Tao"
- git config user.email "[email protected]"
- echo '<head><meta http-equiv="refresh" content="0;url=https://home.cs-tao.cc/GTD-Visualization/docs"></head>' > index.html
- git add docs/
- git add web/
- git add index.html
- git commit -m "Update website by travisCI"
- git push --force --quiet "https://${GH_TOKEN}@${GIT_PAGE_REF}" master:gh-pages
after_script:
- npm install coveralls
- cat ./test/unit/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
branches:
only:
- master

- echo '<head><meta http-equiv="refresh" content="0;url=https://home.cs-tao.cc/GTD-Visualization/web"></head>' > dist/index.html

deploy:
provider: pages
skip-cleanup: true
local-dir: dist
github-token: $GH_TOKEN
on:
branch:
- master
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors)
[![Build Status](https://travis-ci.org/CS-Tao/GTD-Visualization.svg?branch=master)](https://travis-ci.org/CS-Tao/GTD-Visualization)
[![Build status](https://ci.appveyor.com/api/projects/status/2fv7nefk6ojj509y?svg=true)](https://ci.appveyor.com/project/CS-Tao/gtd-visualization)
[![CircleCI](https://circleci.com/gh/CS-Tao/GTD-Visualization.svg?style=svg)](https://circleci.com/gh/CS-Tao/GTD-Visualization)
[![Coverage Status](https://coveralls.io/repos/github/CS-Tao/GTD-Visualization/badge.svg?branch=master)](https://coveralls.io/github/CS-Tao/GTD-Visualization?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/763357d477b76079a3b6/maintainability)](https://codeclimate.com/github/CS-Tao/GTD-Visualization/maintainability)
[![license](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand All @@ -11,13 +11,17 @@

> Global Terrorist Attacks Visualization System
![Overview](https://github.com/CS-Tao/github-content/raw/master/contents/github/GTD/1.webp)
<p align="right"><a href="https://home.cs-tao.cc/GTD-Visualization/docs/preview/">更多预览 >></a></p>
[![Overview](https://github.com/CS-Tao/github-content/raw/master/contents/github/GTD/1.webp)](https://projects.cs-tao.cc/gtd-visualization/)

## 网站
## 相关链接

- [网页端](https://home.cs-tao.cc/GTD-Visualization/web)
- [文档](https://home.cs-tao.cc/GTD-Visualization/docs)
- 后台: [https://github.com/LaZzyMan/terrorsim_rear_end](https://github.com/LaZzyMan/terrorsim_rear_end)
- Docker 部署方案: [https://github.com/CS-Tao/GTD-Docker](https://github.com/CS-Tao/GTD-Docker)
- Docker 镜像仓库:
- postgis: [https://store.docker.com/community/images/cstao/gtd-postgis](https://store.docker.com/community/images/cstao/gtd-postgis)
- django: [https://store.docker.com/community/images/cstao/gtd-django](https://store.docker.com/community/images/cstao/gtd-django)
- nginx: [https://store.docker.com/community/images/cstao/gtd-nginx](https://store.docker.com/community/images/cstao/gtd-nginx)
- 文档: [https://home.cs-tao.cc/GTD-Visualization/docs](https://home.cs-tao.cc/GTD-Visualization/docs)

## 生成步骤

Expand Down Expand Up @@ -49,5 +53,3 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
| [<img src="https://avatars1.githubusercontent.com/u/23273105?v=4" width="100px;"/><br /><sub><b>zz</b></sub>](https://github.com/LaZzyMan)<br />[💻](https://github.com/CS-Tao/GTD-Visualization/commits?author=LaZzyMan "Code") [🎨](#design-LaZzyMan "Design") | [<img src="https://avatars2.githubusercontent.com/u/22520131?v=4" width="100px;"/><br /><sub><b>tang-xy</b></sub>](https://github.com/tang-xy)<br />[💻](https://github.com/CS-Tao/GTD-Visualization/commits?author=tang-xy "Code") [🔌](#plugin-tang-xy "Plugin/utility libraries") | [<img src="https://avatars3.githubusercontent.com/u/28620426?v=4" width="100px;"/><br /><sub><b>Cong-Zou</b></sub>](https://github.com/Cong-Zou)<br />[💻](https://github.com/CS-Tao/GTD-Visualization/commits?author=Cong-Zou "Code") | [<img src="https://avatars2.githubusercontent.com/u/34806806?v=4" width="100px;"/><br /><sub><b>lsq210</b></sub>](https://github.com/lsq210)<br />[💻](https://github.com/CS-Tao/GTD-Visualization/commits?author=lsq210 "Code") |
| :---: | :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
4 changes: 0 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing
version: 0.1.{build}

branches:
only:
- master

image: Visual Studio 2017
platform:
- x64
Expand Down
2 changes: 1 addition & 1 deletion config/prod.env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
NODE_ENV: '"production"',
ENV_CONFIG: '"prod"',
BASE_API: '"http://47.94.208.122:9000"'
BASE_API: '"http://localhost:2001"'
}
2 changes: 1 addition & 1 deletion config/sit.env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
NODE_ENV: '"production"',
ENV_CONFIG: '"sit"',
BASE_API: '"http://47.94.208.122:9000"'
BASE_API: '"http://localhost:2001"'
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "node .electron-vue/build.js && electron-builder",
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node --max_old_space_size=4096 .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web NODE_ENV=production node --max_old_space_size=4096 .electron-vue/build.js",
"build:docs": "vuepress build docs",
"dev": "node .electron-vue/dev-runner.js",
"e2e": "npm run pack && mocha test/e2e",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div id="app"></div>
<!-- Set `__static` path to static files in production -->
<script>
if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
try{if(process.env.NODE_ENV!=='development')window.__static=require('path').join(__dirname,'/static').replace(/\\/g,'\\\\')}catch(e){}
</script>

<!-- webpack builds are automatically injected -->
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Breadcrumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
methods: {
getBreadcrumb () {
let matched = this.$route.matched.filter(item => item.name)
console.log(matched)
// console.log(matched)
// const first = matched[0]
// if (first && first.name !== 'dashboard') {
// matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched) // eslint-disable-line
Expand Down
5 changes: 1 addition & 4 deletions src/renderer/components/Charts/country3ModelRadar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,9 @@ export default {
]
}
},
mounted () {
},
methods: {
initChart () {
if (Object.keys(this.obj).length === 0) {
if (this.obj === null || this.obj === undefined || Object.keys(this.obj).length === 0) {
return
}
var param = []
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/Charts/countryScatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
this.timeList = res
},
selectId (newId, oldId) {
if (Object.keys(this.obj).length === 0 || newId === -1) {
if (this.obj === null || this.obj === undefined || Object.keys(this.obj).length === 0 || newId === -1) {
return
}
var d = this.dataList[this.getNameById(newId)]
Expand All @@ -102,7 +102,7 @@ export default {
methods: {
initChart () {
if (Object.keys(this.obj).length === 0 || this.selectId === -1) {
if (this.obj === null || this.obj === undefined || Object.keys(this.obj).length === 0 || this.selectId === -1) {
return
}
var res = []
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/Charts/ePolyline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ export default {
},
data () {
var t = null
if (this.t === 'sumProp') { t = 'SUM of Prop' }
if (this.t === 'count') { t = 'SUM of Count' }
if (this.t === 'sumKill') { t = 'SUM of Kill' }
if (this.t === 'sumProp') { t = 'Economic losses' }
if (this.t === 'count') { t = 'Number of attacks' }
if (this.t === 'sumKill') { t = 'Death toll' }
return {
chart: null,
title: t
Expand Down
18 changes: 9 additions & 9 deletions src/renderer/components/Charts/globeTrendLine.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<ePolyline :id=id
height="100%"
width="100%"
:data="params"
:start="1970"
:end="2017"
:t="model"
:selectName="selectName"
backgroundColor='rgba(0,0,0,0)'
@click-radar="send">
height="100%"
width="100%"
:data="params"
:start="1970"
:end="2017"
:t="model"
:selectName="selectName"
backgroundColor='rgba(0,0,0,0)'
@click-radar="send">
</ePolyline>
</template>

Expand Down
4 changes: 3 additions & 1 deletion src/renderer/components/Charts/regionCountBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
textColor="#FF9900"
backgroundColor="rgba(128,0,0,0)"
:vertical="true"
formatter="{b}<br/>Attacks : {c0}"
@click-bar="sendClick"
@over-bar="sendOver"
@out-bar="sendOut">
Expand All @@ -19,7 +20,7 @@ import bar from './bar'
export default {
name: 'regionCountBar',
components: {bar},
components: { bar },
props: {
id: {
type: String,
Expand Down Expand Up @@ -53,6 +54,7 @@ export default {
},
methods: {
initChart () {
// console.log(this.obj)
var param = {}
var attackCount = []
for (var i = 0; i < this.obj.length; i++) {
Expand Down
23 changes: 11 additions & 12 deletions src/renderer/components/Charts/regionStatisticsBar.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<bar :id='id'
height="100%"
width="100%"
:data="params"
:selectName="selectName"
:vertical="false"
title="loss by region"
formatter="{b}: <br/>SUM of Prop : {c0} <br/>SUM of Wound : {c1} <br/>SUM of Kill : {c2}"
@click-bar="sendClick"
@over-bar="sendOver"
@out-bar="sendOut">
height="100%"
width="100%"
:data="params"
:selectName="selectName"
:vertical="false"
title="Loss by region"
formatter="{b} : <br/>Economic losses : {c0} <br/>Number of injured : {c1} <br/>Number of death : {c2}"
@click-bar="sendClick"
@over-bar="sendOver"
@out-bar="sendOut">
</bar>
</template>

Expand All @@ -18,7 +18,7 @@ import bar from './bar'
export default {
name: 'regionStatisticsBar',
components: {bar},
components: { bar },
props: {
id: {
type: String,
Expand Down Expand Up @@ -51,7 +51,6 @@ export default {
}
},
methods: {
initChart () {
var param = {}
var sumKill = []
Expand Down
12 changes: 8 additions & 4 deletions src/renderer/components/Charts/year3ModelPie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
width="100%"
:data="params"
:selectName="selectName"
:title="model+' type'"
:title="chartTitle"
:itemColor="color"
@click-pie="send">
</pie>
Expand Down Expand Up @@ -45,13 +45,17 @@ export default {
color: ''
}
},
computed: {
chartTitle () {
return (this.model === 'target') ? 'Target type' : (this.model === 'attack' ? 'Attact type' : 'Weapon type')
}
},
mounted () {
if (this.model === 'target') { this.color = '#A60000' } else if (this.model === 'attack') { this.color = '#009999' } else { this.color = '#9FEE00' }
},
methods: {
initChart () {
if (Object.keys(this.obj).length === 0) {
if (this.obj === null || this.obj === undefined || Object.keys(this.obj).length === 0) {
return
}
var param = []
Expand All @@ -72,7 +76,7 @@ export default {
this.initChart()
},
model (newModel, oldModel) {
if (newModel === 'target') { this.color = '#A60000' } else if (newModel === '#attack') { this.color = '#009999' } else { this.color = '#9FE00' }
if (newModel === 'target') { this.color = '#A60000' } else if (newModel === 'attack') { this.color = '#009999' } else { this.color = '#9FE00' }
}
}
}
Expand Down
Loading

0 comments on commit 3d91f94

Please sign in to comment.