├── .gitignore
├── LICENSE
├── Model
├── neo4j_models.py
└── read_csv.py
├── README.md
├── app.py
├── data
├── bank.csv
├── series.csv
└── 汽车知识图谱导入指令.txt
├── forms.py
├── handler
├── ner_handler.py
├── search_entity_handler.py
└── search_relation_handler.py
├── img
├── entity.png
└── relation.png
├── requirements.txt
├── static
├── app
│ └── fonts
│ │ └── glyphicons-halflings-regular.woff
├── assets
│ ├── chart-master
│ │ ├── .gitignore
│ │ ├── Chart.js
│ │ ├── Chart.min.js
│ │ ├── LICENSE.md
│ │ ├── component.json
│ │ ├── docs
│ │ │ ├── Chart.js
│ │ │ ├── index.html
│ │ │ ├── prettify.css
│ │ │ ├── prettify.js
│ │ │ ├── prettify.less
│ │ │ ├── styles.css
│ │ │ └── styles.less
│ │ ├── readme.md
│ │ ├── samples
│ │ │ ├── bar.html
│ │ │ ├── doughnut.html
│ │ │ ├── line.html
│ │ │ ├── pie.html
│ │ │ ├── polarArea.html
│ │ │ ├── radar.html
│ │ │ └── sixup.html
│ │ └── site
│ │ │ ├── assets
│ │ │ ├── 6charts.png
│ │ │ ├── Chart.js
│ │ │ ├── effects.js
│ │ │ ├── excanvas.js
│ │ │ ├── html.png
│ │ │ └── simple.png
│ │ │ ├── index.html
│ │ │ └── styles.css
│ ├── fullcalendar
│ │ ├── GPL-LICENSE.txt
│ │ ├── MIT-LICENSE.txt
│ │ ├── changelog.txt
│ │ ├── demos
│ │ │ ├── agenda-views.html
│ │ │ ├── basic-views.html
│ │ │ ├── cupertino
│ │ │ │ ├── images
│ │ │ │ │ ├── ui-bg_diagonals-thick_90_eeeeee_40x40.png
│ │ │ │ │ ├── ui-bg_flat_15_cd0a0a_40x100.png
│ │ │ │ │ ├── ui-bg_glass_100_e4f1fb_1x400.png
│ │ │ │ │ ├── ui-bg_glass_50_3baae3_1x400.png
│ │ │ │ │ ├── ui-bg_glass_80_d7ebf9_1x400.png
│ │ │ │ │ ├── ui-bg_highlight-hard_100_f2f5f7_1x100.png
│ │ │ │ │ ├── ui-bg_highlight-hard_70_000000_1x100.png
│ │ │ │ │ ├── ui-bg_highlight-soft_100_deedf7_1x100.png
│ │ │ │ │ ├── ui-bg_highlight-soft_25_ffef8f_1x100.png
│ │ │ │ │ ├── ui-icons_2694e8_256x240.png
│ │ │ │ │ ├── ui-icons_2e83ff_256x240.png
│ │ │ │ │ ├── ui-icons_3d80b3_256x240.png
│ │ │ │ │ ├── ui-icons_72a7cf_256x240.png
│ │ │ │ │ └── ui-icons_ffffff_256x240.png
│ │ │ │ └── theme.css
│ │ │ ├── default.html
│ │ │ ├── external-dragging.html
│ │ │ ├── gcal.html
│ │ │ ├── json-events.php
│ │ │ ├── json.html
│ │ │ ├── selectable.html
│ │ │ └── theme.html
│ │ ├── fullcalendar
│ │ │ ├── bootstrap-fullcalendar.css
│ │ │ ├── fullcalendar.css
│ │ │ ├── fullcalendar.js
│ │ │ ├── fullcalendar.min.js
│ │ │ ├── fullcalendar.print.css
│ │ │ └── gcal.js
│ │ └── jquery
│ │ │ ├── jquery-1.8.1.min.js
│ │ │ └── jquery-ui-1.8.23.custom.min.js
│ ├── jquery-easy-pie-chart
│ │ ├── Makefile
│ │ ├── Readme.md
│ │ ├── examples
│ │ │ ├── excanvas.js
│ │ │ ├── index.html
│ │ │ └── style.css
│ │ ├── img
│ │ │ └── easy-pie-chart.png
│ │ ├── jquery.easy-pie-chart.coffee
│ │ ├── jquery.easy-pie-chart.css
│ │ └── jquery.easy-pie-chart.js
│ └── jquery-knob
│ │ ├── README.md
│ │ ├── index.html
│ │ └── js
│ │ └── jquery.knob.js
├── css
│ ├── bootstrap-theme.css
│ ├── bootstrap.min.css
│ ├── elegant-icons-style.css
│ ├── font-awesome.css
│ ├── font-awesome.min.css
│ ├── footable.bootstrap.css
│ ├── footable.bootstrap.min.css
│ ├── fullcalendar.css
│ ├── jquery-jvectormap-1.2.2.css
│ ├── jquery-ui-1.10.4.min.css
│ ├── line-icons.css
│ ├── owl.carousel.css
│ ├── style-responsive.css
│ ├── style.css
│ ├── tagcloud.css
│ ├── tree_style.css
│ ├── widgets.css
│ └── xcharts.min.css
├── fonts
│ ├── ElegantIcons.eot
│ ├── ElegantIcons.svg
│ ├── ElegantIcons.ttf
│ ├── ElegantIcons.woff
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
├── img
│ ├── arrow-up.png
│ ├── chart-texture.jpg
│ ├── icons
│ │ ├── line-icon-c.png
│ │ ├── line-icon-hover.png
│ │ ├── line-icon.png
│ │ ├── search-line-icon.png
│ │ ├── social.png
│ │ ├── weather-hover.png
│ │ └── weather.png
│ ├── left-arrow.png
│ └── right-arrow.png
└── js
│ ├── additional-methods.min.js
│ ├── bootstrap-switch.js
│ ├── bootstrap-wysiwyg-custom.js
│ ├── bootstrap-wysiwyg.js
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ ├── calendar-custom.js
│ ├── chartjs-custom.js
│ ├── charts-flot.js
│ ├── charts-other.js
│ ├── charts-xcharts.js
│ ├── charts.js
│ ├── dynamic-table.js
│ ├── easy-pie-chart.js
│ ├── echarts-all.js
│ ├── echarts.common.js
│ ├── echarts.common.min.js
│ ├── echarts.js
│ ├── echarts.min.js
│ ├── excanvas.min.js
│ ├── footable.js
│ ├── footable.min.js
│ ├── form-component.js
│ ├── form-validation-script.js
│ ├── fullcalendar.js
│ ├── fullcalendar.min.js
│ ├── ga.js
│ ├── gdp-data.js
│ ├── gritter.js
│ ├── html5shiv.js
│ ├── index.js
│ ├── jquery-1.8.3.min.js
│ ├── jquery-jvectormap-1.2.2.min.js
│ ├── jquery-jvectormap-world-mill-en.js
│ ├── jquery-ui-1.10.4.min.js
│ ├── jquery-ui-1.9.2.custom.min.js
│ ├── jquery.autosize.min.js
│ ├── jquery.customSelect.min.js
│ ├── jquery.flot.pie.js
│ ├── jquery.hotkeys.js
│ ├── jquery.js
│ ├── jquery.localscroll.js
│ ├── jquery.min.js
│ ├── jquery.nicescroll.js
│ ├── jquery.placeholder.min.js
│ ├── jquery.rateit.min.js
│ ├── jquery.scrollTo.min.js
│ ├── jquery.slimscroll.min.js
│ ├── jquery.smartWizard.js
│ ├── jquery.sparkline-11.js
│ ├── jquery.sparkline.js
│ ├── jquery.stepy.js
│ ├── jquery.tagsinput.js
│ ├── jquery.validate.min.js
│ ├── lte-ie7 2.js
│ ├── lte-ie7.js
│ ├── morris-script 2.js
│ ├── morris-script.js
│ ├── morris.min 2.js
│ ├── morris.min.js
│ ├── owl.carousel 2.js
│ ├── owl.carousel.js
│ ├── popper.min.js
│ ├── scripts 2.js
│ ├── scripts.js
│ ├── sliders 2.js
│ ├── sliders.js
│ ├── sparkline-chart 2.js
│ ├── sparkline-chart.js
│ ├── sparklines 2.js
│ ├── sparklines.js
│ ├── tagcloud.min.js
│ ├── testjs.js
│ ├── tree_control.js
│ ├── xcharts.min 2.js
│ └── xcharts.min.js
├── templates
├── 404.html
├── entity.html
├── index.html
├── navigate.html
└── relation.html
└── toolkit
├── domainDict.csv
├── nlp_ner.py
├── pre_load.py
└── relationStaticResult.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 luxuantao
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Model/neo4j_models.py:
--------------------------------------------------------------------------------
1 | from py2neo import Graph, Node, Relationship, NodeMatcher
2 |
3 |
4 | class Neo4j_Handle():
5 | graph = None
6 |
7 | # matcher = None
8 | def __init__(self):
9 | print("Neo4j Init ...")
10 |
11 | def connectDB(self):
12 | self.graph = Graph("http://localhost:7474", username="neo4j", password="12345678")
13 |
14 | # self.matcher = NodeMatcher(self.graph)
15 |
16 | # 实体查询,用于命名实体识别:品牌+车系+车型
17 | def matchEntityItem(self, value):
18 | answer = self.graph.run("MATCH (entity1) WHERE entity1.name = \"" + value + "\" RETURN entity1").data()
19 | return answer
20 |
21 | # 实体查询
22 | def getEntityRelationbyEntity(self, value):
23 | # 查询实体:不考虑实体类型,只考虑关系方向
24 | answer = self.graph.run(
25 | "MATCH (entity1) - [rel] -> (entity2) WHERE entity1.name = \"" + value + "\" RETURN rel,entity2").data()
26 | if (len(answer) == 0):
27 | # 查询实体:不考虑关系方向
28 | answer = self.graph.run(
29 | "MATCH (entity1) - [rel] - (entity2) WHERE entity1.name = \"" + value + "\" RETURN rel,entity2").data()
30 | print(answer)
31 | return answer
32 |
33 | # 关系查询:实体1
34 | def findRelationByEntity1(self, entity1):
35 | # 基于品牌查询
36 | answer = self.graph.run("MATCH (n1:Bank {name:\"" + entity1 + "\"})- [rel] -> (n2) RETURN n1,rel,n2").data()
37 | # 基于车系查询,注意此处额外的空格
38 | if (len(answer) == 0):
39 | answer = self.graph.run(
40 | "MATCH (n1:Series {name:\"" + entity1 + "\"})- [rel] - (n2) RETURN n1,rel,n2").data()
41 | return answer
42 |
43 | # 关系查询:实体2
44 | def findRelationByEntity2(self, entity1):
45 | # 基于品牌
46 | answer = self.graph.run("MATCH (n1)<- [rel] - (n2:Bank {name:\"" + entity1 + "\"}) RETURN n1,rel,n2").data()
47 | if (len(answer) == 0):
48 | # 基于车系
49 | answer = self.graph.run(
50 | "MATCH (n1) - [rel] - (n2:Series {name:\"" + entity1 + "\"}) RETURN n1,rel,n2").data()
51 | return answer
52 |
53 | # 关系查询:实体1+关系
54 | def findOtherEntities(self, entity, relation):
55 | answer = self.graph.run(
56 | "MATCH (n1:Bank {name:\"" + entity + "\"})- [rel:Subtype {type:\"" + relation + "\"}] -> (n2) RETURN n1,rel,n2").data()
57 | return answer
58 |
59 | # 关系查询:关系+实体2
60 | def findOtherEntities2(self, entity, relation):
61 | print("findOtherEntities2==")
62 | print(entity, relation)
63 | answer = self.graph.run(
64 | "MATCH (n1)- [rel:RELATION {type:\"" + relation + "\"}] -> (n2:Bank {name:\"" + entity + "\"}) RETURN n1,rel,n2").data()
65 | if (len(answer) == 0):
66 | answer = self.graph.run(
67 | "MATCH (n1)- [rel:RELATION {type:\"" + relation + "\"}] -> (n2:Series {name:\"" + entity + "\"}) RETURN n1,rel,n2").data()
68 | return answer
69 |
70 | # 关系查询:实体1+实体2(注意Entity2的空格)
71 | def findRelationByEntities(self, entity1, entity2):
72 | # 品牌 + 品牌
73 | answer = self.graph.run(
74 | "MATCH (n1:Bank {name:\"" + entity1 + "\"})- [rel] -> (n2:Bank{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
75 | if (len(answer) == 0):
76 | # 品牌 + 系列
77 | print(
78 | "MATCH (n1:Bank {name:\"" + entity1 + "\"})- [rel] -> (n2:Series{name:\"" + entity2 + "\"}) RETURN n1,rel,n2")
79 | answer = self.graph.run(
80 | "MATCH (n1:Bank {name:\"" + entity1 + "\"})- [rel] -> (n2:Series{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
81 | if (len(answer) == 0):
82 | # 系列 + 品牌
83 | answer = self.graph.run(
84 | "MATCH (n1:Series {name:\"" + entity1 + "\"})- [rel] -> (n2:Bank{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
85 | if (len(answer) == 0):
86 | # 系列 + 系列
87 | answer = self.graph.run(
88 | "MATCH (n1:Series {name:\"" + entity1 + "\"})- [rel] -> (n2:Series{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
89 | return answer
90 |
91 | # 查询数据库中是否有对应的实体-关系匹配
92 | def findEntityRelation(self, entity1, relation, entity2):
93 | answer = self.graph.run(
94 | "MATCH (n1:Bank {name:\"" + entity1 + "\"})- [rel:subbank {type:\"" + relation + "\"}] -> (n2:Bank{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
95 | if (len(answer) == 0):
96 | answer = self.graph.run(
97 | "MATCH (n1:Bank {name:\"" + entity1 + "\"})- [rel:subbank {type:\"" + relation + "\"}] -> (n2:Series{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
98 | if (len(answer) == 0):
99 | answer = self.graph.run(
100 | "MATCH (n1:Series {name:\"" + entity1 + "\"})- [rel:subbank {type:\"" + relation + "\"}] -> (n2:Bank{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
101 | if (len(answer) == 0):
102 | answer = self.graph.run(
103 | "MATCH (n1:Series {name:\"" + entity1 + "\"})- [rel:subbank {type:\"" + relation + "\"}] -> (n2:Series{name:\"" + entity2 + "\"}) RETURN n1,rel,n2").data()
104 | return answer
105 |
--------------------------------------------------------------------------------
/Model/read_csv.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import csv
3 |
4 | def readCSV(filename): ##读取csv的二维数组,第一行是列名
5 | List = []
6 | with open(filename,'r') as csvfile:
7 | reader = csv.reader(csvfile, delimiter=',')
8 | for row in reader:
9 | List.append(row)
10 | return List
11 |
12 | def readCSV2(filename): ##读取csv的二维数组,第一行是列名(空格分割)
13 | List = []
14 | with open(filename,'r') as csvfile:
15 | reader = csv.reader(csvfile, delimiter=' ')
16 | for row in reader:
17 | List.append(row)
18 | return List
19 |
20 |
21 | def readCSVbyColumn(filename , columnname): ##读取csv列名对应列,不包括列名
22 | List = []
23 | with open(filename,'r') as csvfile:
24 | reader = csv.reader(csvfile, delimiter=',')
25 | p = -1
26 | i = 0
27 | j = 0
28 | for row in reader:
29 | if i == 0:
30 | for c in row:
31 | if c == columnname :
32 | p = j
33 | j += 1
34 | else:
35 | List.append(row[p])
36 | i += 1
37 | if p == -1:
38 | break
39 | return List
40 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # car_knowledge_graph
2 | 基于neo4j的汽车知识图谱,使用flask构建系统,Echarts可视化
3 |
4 | 本项目源于这门课程: https://study.163.com/course/introduction.htm?courseId=1006292001&_trace_c_p_k2_=9d9fe21f18364c63badf2d3df0523c56
5 |
6 | 但是原课程的代码中使用的包很多都过时了,所以我用flask重构了原本的django代码,neo4j也换成了4.x
7 |
8 | ### 安装
9 |
10 | 直接 pip install -r requirements.txt 即可
11 |
12 | neo4j使用的是 neo4j-community-4.0.1
13 |
14 | ### 导入数据
15 |
16 | 数据和使用说明都在data目录下
17 |
18 | 导入时要将数据放在neo4j的import目录下,不然会提示找不到数据
19 |
20 | ### 运行
21 |
22 | 在app.py 所在目录下 `flask run` 即可
23 |
24 | ### 实体查询
25 |
26 | 
27 |
28 | ### 关系查询
29 |
30 | 
31 |
32 | ### 未来
33 |
34 | 其实项目中可以改进的点很多,读者也可以此项目为模板,开发更多不同类型的知识图谱
--------------------------------------------------------------------------------
/app.py:
--------------------------------------------------------------------------------
1 | from flask import Flask, render_template
2 | from handler import ner_handler, search_entity_handler, search_relation_handler
3 | from forms import NerForm, EntityForm, RelationForm
4 |
5 |
6 | app = Flask(__name__)
7 | app.secret_key = 'secret key'
8 | app.config['WTF_I18N_ENABLED'] = False
9 |
10 |
11 | @app.route('/')
12 | def index():
13 | ner_form = NerForm()
14 | return render_template('index.html', form=ner_form)
15 |
16 | @app.errorhandler(404)
17 | def page_not_found(e):
18 | return render_template('404.html'), 404
19 |
20 | @app.route('/search_entity', methods=['GET', 'POST'])
21 | def search_entity():
22 | entity_form = EntityForm()
23 | res = {'ctx': 'padding', 'entityRelation': ''}
24 | if entity_form.validate_on_submit():
25 | res = search_entity_handler.search_entity(entity_form.entity.data)
26 | return render_template('entity.html', form=entity_form, ctx=res['ctx'], entityRelation=res['entityRelation'])
27 |
28 | @app.route('/search_relation', methods=['GET', 'POST'])
29 | def search_relation():
30 | relation_form = RelationForm()
31 | res = {'ctx': '', 'searchResult': ''}
32 | if relation_form.validate_on_submit():
33 | res = search_relation_handler.search_relation(relation_form.entity1.data, relation_form.relation.data, relation_form.entity2.data)
34 | return render_template('relation.html', form=relation_form, ctx=res['ctx'], searchResult=res['searchResult'])
35 |
36 | @app.route('/ner-post', methods=['POST'])
37 | def ner_post():
38 | ner_form = NerForm()
39 | ctx = {'rlt': '', 'seg_word': ''}
40 | if ner_form.validate_on_submit():
41 | ctx = ner_handler.ner_post(ner_form.ner_text.data)
42 | return render_template("index.html", form=ner_form, rlt=ctx['rlt'], seg_word=ctx['seg_word'])
43 |
--------------------------------------------------------------------------------
/data/汽车知识图谱导入指令.txt:
--------------------------------------------------------------------------------
1 | # 遇上csv文件乱码,先用 记事本 打开文件,在另存为csv文件时选择utf-8转码
2 |
3 | #MATCH (n) detach delete n
4 |
5 | # 导入汽车品牌表
6 | LOAD CSV WITH HEADERS FROM "file:///bank.csv" AS line
7 | CREATE (:Bank{name:line.bank, count:line.count})
8 |
9 | # 导入品牌系列表
10 | LOAD CSV WITH HEADERS FROM "file:///series.csv" AS line
11 | CREATE (:Series{name:line.series, count:line.count})
12 |
13 | # 导入关系表【这里关系表和品牌系列表一样】
14 | LOAD CSV WITH HEADERS FROM "file:///series.csv" AS line
15 | MATCH (entity1: Bank{name:line.bank}), (entity2: Series{name:line.series})
16 | CREATE (entity1) - [:Subtype{type:line.relation}] -> (entity2)
17 |
18 | # 查询品牌及其关系
19 | MATCH p=()-[r:Subtype]->() RETURN p LIMIT 250
20 |
21 | CREATE CONSTRAINT ON (b: Bank)
22 | ASSERT b.name is UNIQUE
23 |
24 | match (n:Series) return n LIMIT 25
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/forms.py:
--------------------------------------------------------------------------------
1 | from flask_wtf import FlaskForm
2 | from wtforms import TextAreaField, SubmitField, StringField, SelectField
3 | from wtforms.validators import DataRequired, Length
4 |
5 |
6 | class MyBaseForm(FlaskForm):
7 | class Meta:
8 | locales = ['zh']
9 |
10 | class NerForm(MyBaseForm):
11 | ner_text = TextAreaField('ner_text', validators=[DataRequired(), Length(0, 300)])
12 | submit = SubmitField('确认')
13 |
14 | class EntityForm(MyBaseForm):
15 | entity = StringField('entity', validators=[DataRequired()])
16 | submit = SubmitField('查询')
17 |
18 | class RelationForm(MyBaseForm):
19 | entity1 = StringField('entity1')
20 | relation = SelectField('relation', choices=[(1, '无限制')], default=1, coerce=int)
21 | entity2 = StringField('entity2')
22 | submit = SubmitField('查询')
23 |
--------------------------------------------------------------------------------
/handler/ner_handler.py:
--------------------------------------------------------------------------------
1 | import sys
2 | sys.path.append("..")
3 | from toolkit.pre_load import thuFactory, neo4jconn, domain_ner_dict
4 | from toolkit.nlp_ner import get_ner, tempword, get_detail_ner_info, get_ner_info
5 |
6 |
7 | # 中文分词+词性标注+命名实体识别
8 | def ner_post(key):
9 | ctx = {}
10 | thu1 = thuFactory
11 | # 中文分词:提前移除空格
12 | key = key.strip()
13 | TagList = thu1.cut(key, text=False)
14 | text = ""
15 | # 命名实体识别
16 | ner_list = get_ner(key)
17 | # 遍历输出
18 | for pair in ner_list:
19 | if pair[1] == 0:
20 | text += pair[0]
21 | continue
22 | if tempword(pair[1]):
23 | text += "" + pair[0] + " "
26 | continue
27 |
28 | text += "" + pair[0] + " "
31 |
32 | ctx['rlt'] = text
33 |
34 | seg_word = ""
35 | length = len(TagList)
36 | # 设置显示格式
37 | for t in TagList:
38 | seg_word += t[0] + " [" + t[1] + "] "
39 | seg_word += ""
40 | ctx['seg_word'] = seg_word
41 |
42 | return ctx
43 |
--------------------------------------------------------------------------------
/handler/search_entity_handler.py:
--------------------------------------------------------------------------------
1 | from toolkit.pre_load import neo4jconn
2 | import os
3 | import json
4 |
5 |
6 | relationCountDict = {}
7 | filePath = os.path.abspath(os.path.join(os.getcwd(),"."))
8 |
9 | with open(filePath+"/toolkit/relationStaticResult.txt","r") as fr:
10 | for line in fr:
11 | relationNameCount = line.split(",")
12 | relationName = relationNameCount[0][2:-1]
13 | relationCount = relationNameCount[1][1:-2]
14 | relationCountDict[relationName] = int(relationCount)
15 |
16 | def sortDict(relationDict):
17 | for i in range( len(relationDict) ):
18 | relationName = relationDict[i]['rel']['type']
19 | relationCount = relationCountDict.get(relationName)
20 | if(relationCount is None ):
21 | relationCount = 0
22 | relationDict[i]['relationCount'] = relationCount
23 |
24 | relationDict = sorted(relationDict,key = lambda item:item['relationCount'],reverse = True)
25 | return relationDict
26 |
27 | #实体查询
28 | def search_entity(entity):
29 | #根据传入的实体名称搜索出关系
30 | #连接数据库
31 | db = neo4jconn
32 | entityRelation = db.getEntityRelationbyEntity(entity)
33 | if len(entityRelation) == 0:
34 | #若数据库中无法找到该实体,则返回数据库中无该实体
35 | return {'ctx': '', 'entityRelation': ''}
36 | else:
37 | #返回查询结果
38 | #将查询结果按照"关系出现次数"的统计结果进行排序
39 | entityRelation = sortDict(entityRelation)
40 | return {'ctx': json.dumps(entity, ensure_ascii=False), 'entityRelation': json.dumps(entityRelation, ensure_ascii=False)}
41 |
--------------------------------------------------------------------------------
/handler/search_relation_handler.py:
--------------------------------------------------------------------------------
1 | from toolkit.pre_load import neo4jconn
2 | import os
3 | import json
4 |
5 |
6 | relationCountDict = {}
7 | filePath = os.path.abspath(os.path.join(os.getcwd(),"."))
8 |
9 | with open(filePath+"/toolkit/relationStaticResult.txt","r") as fr:
10 | for line in fr:
11 | relationNameCount = line.split(",")
12 | relationName = relationNameCount[0][2:-1]
13 | relationCount = relationNameCount[1][1:-2]
14 | relationCountDict[relationName] = int(relationCount)
15 |
16 | def sortDict(relationDict):
17 | for i in range(len(relationDict)):
18 | relationName = relationDict[i]['rel']['type']
19 | relationCount = relationCountDict.get(relationName)
20 | if relationCount is None:
21 | relationCount = 0
22 | relationDict[i]['relationCount'] = relationCount
23 | relationDict = sorted(relationDict,key = lambda item:item['relationCount'],reverse = True)
24 | return relationDict
25 |
26 | def search_relation(entity1, relation, entity2):
27 | db = neo4jconn
28 | entity1 = entity1.strip()
29 | entity2 = entity2.strip()
30 | relation_map = {1: '无限制'}
31 | #若只输入entity1,则输出与entity1有直接关系的实体和关系
32 | if len(entity1) != 0 and relation == 1 and len(entity2) == 0:
33 | searchResult = db.findRelationByEntity1(entity1)
34 | searchResult = sortDict(searchResult)
35 | if len(searchResult) > 0:
36 | return {'ctx': '', 'searchResult':json.dumps(searchResult, ensure_ascii=False)}
37 |
38 | #若只输入entity2则,则输出与entity2有直接关系的实体和关系
39 | if len(entity2) != 0 and relation == 1 and len(entity1) == 0:
40 | searchResult = db.findRelationByEntity2(entity2)
41 | searchResult = sortDict(searchResult)
42 | if len(searchResult) > 0:
43 | return {'ctx': '', 'searchResult':json.dumps(searchResult, ensure_ascii=False)}
44 |
45 | #若输入entity1和relation,则输出与entity1具有relation关系的其他实体
46 | if len(entity1) != 0 and relation != 1 and len(entity2) == 0:
47 | relation = relation_map[relation]
48 | searchResult = db.findOtherEntities(entity1, relation)
49 | searchResult = sortDict(searchResult)
50 | if len(searchResult) > 0:
51 | return {'ctx': '', 'searchResult':json.dumps(searchResult, ensure_ascii=False)}
52 |
53 | #若输入entity2和relation,则输出与entity2具有relation关系的其他实体
54 | if len(entity2) != 0 and relation != 1 and len(entity1) == 0:
55 | relation = relation_map[relation]
56 | searchResult = db.findOtherEntities2(entity2, relation)
57 | searchResult = sortDict(searchResult)
58 | if len(searchResult) > 0:
59 | return {'ctx': '', 'searchResult':json.dumps(searchResult, ensure_ascii=False)}
60 |
61 | #若输入entity1和entity2,则输出entity1和entity2之间的关系
62 | if len(entity1) != 0 and relation == 1 and len(entity2) != 0:
63 | searchResult = db.findRelationByEntities(entity1, entity2)
64 | print(searchResult)
65 | searchResult = sortDict(searchResult)
66 | if len(searchResult) > 0:
67 | return {'ctx': '', 'searchResult':json.dumps(searchResult, ensure_ascii=False)}
68 |
69 | #若输入entity1,entity2和relation,则输出entity1、entity2是否具有相应的关系
70 | if len(entity1) != 0 and len(entity2) != 0 and relation != 1:
71 | relation = relation_map[relation]
72 | searchResult = db.findEntityRelation(entity1, relation, entity2)
73 | searchResult = sortDict(searchResult)
74 | if len(searchResult) > 0:
75 | return {'ctx': '', 'searchResult':json.dumps(searchResult, ensure_ascii=False)}
76 |
77 | return {'ctx': 'padding', 'searchResult': ''}
78 |
--------------------------------------------------------------------------------
/img/entity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/img/entity.png
--------------------------------------------------------------------------------
/img/relation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/img/relation.png
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | appdirs==1.4.3
2 | atomicwrites==1.4.0
3 | attrs==20.1.0
4 | beautifulsoup4==4.9.0
5 | bs4==0.0.1
6 | certifi==2020.4.5.1
7 | cffi==1.14.2
8 | chardet==3.0.4
9 | click==7.1.2
10 | colorama==0.4.3
11 | cryptography==3.0
12 | cssselect==1.1.0
13 | english==2020.7.0
14 | fake-useragent==0.1.11
15 | Flask==1.1.2
16 | Flask-WTF==0.14.3
17 | idna==2.9
18 | importlib-metadata==1.7.0
19 | iniconfig==1.0.1
20 | itsdangerous==1.1.0
21 | Jinja2==2.11.2
22 | lxml==4.5.0
23 | MarkupSafe==1.1.1
24 | monotonic==1.5
25 | more-itertools==8.4.0
26 | neo4j-driver==4.1.0
27 | neotime==1.7.4
28 | packaging==20.4
29 | pansi==2020.7.3
30 | parse==1.15.0
31 | pinyin==0.4.0
32 | pluggy==0.13.1
33 | prompt-toolkit==2.0.10
34 | py==1.9.0
35 | py2neo==2020.0.0
36 | pycparser==2.20
37 | pyee==7.0.1
38 | Pygments==2.6.1
39 | pyOpenSSL==19.1.0
40 | pyparsing==2.4.7
41 | pyppeteer==0.0.25
42 | pyquery==1.4.1
43 | pytest==6.0.1
44 | pytz==2020.1
45 | pywin32==227
46 | requests==2.23.0
47 | requests-html==0.10.0
48 | six==1.15.0
49 | soupsieve==2.0
50 | thulac==0.2.0
51 | toml==0.10.1
52 | tqdm==4.45.0
53 | urllib3==1.25.9
54 | w3lib==1.21.0
55 | wcwidth==0.2.5
56 | websocket-client==0.57.0
57 | websockets==8.1
58 | Werkzeug==1.0.1
59 | WTForms==2.3.3
60 | zipp==3.1.0
61 |
--------------------------------------------------------------------------------
/static/app/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/app/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/static/assets/chart-master/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .DS_Store
3 |
--------------------------------------------------------------------------------
/static/assets/chart-master/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 Nick Downie
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/static/assets/chart-master/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Chart.js",
3 | "version": "0.2.0",
4 | "description": "Simple HTML5 Charts using the canvas element",
5 | "keywords": ["charts"],
6 | "homepage": "https://github.com/nnnick/Chart.js",
7 | "author": "nnnick",
8 | "main": ["Chart.min.js"],
9 | "dependencies": {
10 | }
11 | }
--------------------------------------------------------------------------------
/static/assets/chart-master/docs/prettify.css:
--------------------------------------------------------------------------------
1 | /* Pretty printing styles. Used with prettify.js. */
2 | /* Vim sunburst theme by David Leibovic */
3 |
4 | pre .str, code .str { color: #65B042; } /* string - green */
5 | pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
6 | pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
7 | pre .typ, code .typ { color: #89bdff; } /* type - light blue */
8 | pre .lit, code .lit { color: #3387CC; } /* literal - blue */
9 | pre .pun, code .pun { color: #fff; } /* punctuation - white */
10 | pre .pln, code .pln { color: #fff; } /* plaintext - white */
11 | pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */
12 | pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */
13 | pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
14 | pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
15 |
16 | pre.prettyprint, code.prettyprint {
17 | background-color: #000;
18 | -moz-border-radius: 8px;
19 | -webkit-border-radius: 8px;
20 | -o-border-radius: 8px;
21 | -ms-border-radius: 8px;
22 | -khtml-border-radius: 8px;
23 | border-radius: 8px;
24 | }
25 |
26 | pre.prettyprint {
27 | width: 95%;
28 | margin: 1em auto;
29 | padding: 1em;
30 | white-space: pre-wrap;
31 | }
32 |
33 |
34 | /* Specify class=linenums on a pre to get line numbering */
35 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
36 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
37 | /* Alternate shading for lines */
38 | li.L1,li.L3,li.L5,li.L7,li.L9 { }
39 |
--------------------------------------------------------------------------------
/static/assets/chart-master/docs/prettify.less:
--------------------------------------------------------------------------------
1 | /* Pretty printing styles. Used with prettify.js. */
2 | /* Vim sunburst theme by David Leibovic */
3 |
4 | pre .str{ color: #65B042; } /* string - green */
5 | pre .kwd{ color: #E28964; } /* keyword - dark pink */
6 | pre .com{ color: #AEAEAE; font-style: italic; } /* comment - gray */
7 | pre .typ{ color: #89bdff; } /* type - light blue */
8 | pre .lit{ color: #3387CC; } /* literal - blue */
9 | pre .pun{ color: #fff; } /* punctuation - white */
10 | pre .pln{ color: #fff; } /* plaintext - white */
11 | pre .tag{ color: #89bdff; } /* html/xml tag - light blue */
12 | pre .atn{ color: #bdb76b; } /* html/xml attribute name - khaki */
13 | pre .atv{ color: #65B042; } /* html/xml attribute value - green */
14 | pre .dec{ color: #3387CC; } /* decimal - blue */
15 |
16 | /* Specify class=linenums on a pre to get line numbering */
17 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
18 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
19 | /* Alternate shading for lines */
20 | li.L1,li.L3,li.L5,li.L7,li.L9 { }
21 |
22 | @media print {
23 | pre .str{ color: #060; }
24 | pre .kwd{ color: #006; font-weight: bold; }
25 | pre .com{ color: #600; font-style: italic; }
26 | pre .typ{ color: #404; font-weight: bold; }
27 | pre .lit{ color: #044; }
28 | pre .pun{ color: #440; }
29 | pre .pln{ color: #000; }
30 | pre .tag{ color: #006; font-weight: bold; }
31 | pre .atn{ color: #404; }
32 | pre .atv{ color: #060; }
33 | }
--------------------------------------------------------------------------------
/static/assets/chart-master/docs/styles.less:
--------------------------------------------------------------------------------
1 | @import "prettify";
2 |
3 | @codeBackground : #292B36;
4 |
5 | @primaryFont : "proxima-nova";
6 |
7 | @textColour : #282B36;
8 | @secondaryTextColour : #767c8d;
9 |
10 | @borderPaleColour : #EBEBEB;
11 | @pageBorderColour : @textColour;
12 |
13 | @red : #F33E6F;
14 | @green : #46BFBD;
15 | @yellow : #FDB45C;
16 | @blue : #2D91EA;
17 |
18 | *{
19 | padding:0;
20 | margin:0;
21 | box-sizing:border-box;
22 | -moz-box-sizing:border-box;
23 | -webkit-box-sizing:border-box;
24 | color:inherit;
25 | text-rendering: optimizeLegibility;
26 | }
27 |
28 | body{
29 | color: @textColour;
30 | min-width: 768px;
31 | }
32 |
33 | .redBorder,.greenBorder,.yellowBorder{
34 | border-top: 8px solid @pageBorderColour;
35 | width: 33.33%;
36 | float: left;
37 | height: 16px;
38 | position: relative;
39 | z-index:50;
40 | }
41 | .redBorder{
42 | background-color: @red;
43 | }
44 | .greenBorder{
45 | background-color: @green;
46 | }
47 | .yellowBorder{
48 | background-color: @yellow;
49 | }
50 |
51 | h1{
52 | font-family: @primaryFont;
53 | font-weight: 600;
54 | font-size: 32px;
55 | }
56 | h2{
57 | font-family: @primaryFont;
58 | font-weight: 600;
59 | font-size: 22px;
60 | line-height: 40px;
61 | }
62 | #mainHeader{
63 | font-size: 55px;
64 | }
65 | #introText{
66 | font-weight: 400;
67 | margin-top: 20px;
68 | font-size: 26px;
69 | line-height: 40px;
70 | margin-bottom: 40px;
71 | }
72 | #wrapper{
73 | margin: 0 auto;
74 | position: relative;
75 | min-width: 768px;
76 | nav{
77 | width: 20%;
78 | padding-right: 20px;
79 | position: fixed;
80 | height: 100%;
81 | overflow-y: scroll;
82 | top: 0;
83 | z-index: 0;
84 | padding: 40px 20px;
85 | font-family: @primaryFont;
86 | background-color: @borderPaleColour;
87 |
88 | dl{
89 | color: @secondaryTextColour;
90 | dt{
91 | list-style: none;
92 | margin-top: 10px;
93 | margin-bottom: 5px;
94 | a{
95 | display: block;
96 | padding: 2px 0;
97 | border-bottom: 1px solid fade(@secondaryTextColour,20%);
98 | text-decoration: none;
99 | }
100 | }
101 | dd{
102 | margin-bottom: 5px;
103 | padding-left: 5px;
104 | &:before{
105 | content: "- ";
106 |
107 | }
108 | a{
109 | text-decoration:none;
110 | font-size: 12px;
111 | border-bottom: 1px solid transparent;
112 | }
113 | }
114 | a{
115 | -webkit-transition: all 200ms ease-in-out;
116 | -moz-transition: all 200ms ease-in-out;
117 | -o-transition: all 200ms ease-in-out;
118 | -ms-transition: all 200ms ease-in-out;
119 | transition: all 200ms ease-in-out;
120 | &:hover{
121 | color: @blue;
122 | border-bottom-color:@blue;
123 | }
124 | }
125 |
126 | }
127 | }
128 | #contentWrapper{
129 | width: 80%;
130 | max-width: 1080px;
131 | margin-left: 20%;
132 | padding: 0px 40px;
133 | padding-top: 72px;
134 | }
135 | }
136 | article{
137 | border-top: 1px solid @borderPaleColour;
138 | padding: 40px 0;
139 | h2{
140 | margin-top: 20px;
141 | }
142 | }
143 |
144 | p,ul li{
145 | font-family: @primaryFont;
146 | line-height: 20px;
147 | font-size: 16px;
148 | margin-top: 10px;
149 | color: @secondaryTextColour;
150 | a{
151 | text-decoration: none;
152 | border-bottom: 1px solid @blue;
153 | color: @blue;
154 | }
155 | }
156 |
157 | canvas{
158 | margin-top: 20px;
159 | }
160 | pre{
161 | background-color: @codeBackground;
162 | padding: 10px;
163 | border-radius: 5px;
164 | position: relative;
165 | -webkit-font-smoothing: antialiased;
166 | margin: 40px 0 20px 0;
167 | code{
168 | display: block;
169 | }
170 | &:before{
171 | content: attr(data-type);
172 | position: absolute;
173 | font-size: 12px;
174 | top: -30px;
175 | left: 0;
176 | font-family: @primaryFont;
177 | font-weight: 400;
178 | display: inline-block;
179 | padding: 2px 5px;
180 | border-radius: 5px;
181 | background-color: @borderPaleColour;
182 | }
183 | }
184 | p{
185 | }
--------------------------------------------------------------------------------
/static/assets/chart-master/readme.md:
--------------------------------------------------------------------------------
1 | Chart.js
2 | =======
3 | *Simple HTML5 Charts using the canvas element* [chartjs.org](http://www.chartjs.org)
4 |
5 | Competition!
6 | -------
7 | The guys at ChallengePost are running a competition to design and build a personal dashboard using Chart.js, and are offering some great prizes for winning. Take a look at [chartjs.challengepost.com](http://chartjs.challengepost.com/).
8 |
9 | Documentation
10 | -------
11 | You can find documentation at [chartjs.org/docs](http://www.chartjs.org/docs).
12 |
13 | License
14 | -------
15 | Chart.js was taken down on the 19th March. It is now back online for good and IS available under MIT license.
16 |
17 | Chart.js is available under the [MIT license] (http://opensource.org/licenses/MIT).
18 |
--------------------------------------------------------------------------------
/static/assets/chart-master/samples/bar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Bar Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/static/assets/chart-master/samples/doughnut.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Doughnut Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/static/assets/chart-master/samples/line.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Line Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/static/assets/chart-master/samples/pie.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Radar Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/static/assets/chart-master/samples/polarArea.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Polar Area Chart
5 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/static/assets/chart-master/samples/radar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Radar Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/static/assets/chart-master/samples/sixup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Doughnut Chart
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
154 |
155 |
156 |
--------------------------------------------------------------------------------
/static/assets/chart-master/site/assets/6charts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/chart-master/site/assets/6charts.png
--------------------------------------------------------------------------------
/static/assets/chart-master/site/assets/html.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/chart-master/site/assets/html.png
--------------------------------------------------------------------------------
/static/assets/chart-master/site/assets/simple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/chart-master/site/assets/simple.png
--------------------------------------------------------------------------------
/static/assets/chart-master/site/styles.css:
--------------------------------------------------------------------------------
1 | * {
2 | padding: 0;
3 | margin: 0;
4 | color: inherit;
5 | -webkit-font-smoothing: antialiased;
6 | text-rendering: optimizeLegibility;
7 | }
8 | body {
9 | color: #282b36;
10 | border-top: 8px solid #282b36;
11 | }
12 | canvas {
13 | font-family: "proxima-nova", sans-serif sans-serif;
14 | }
15 | .redBorder,
16 | .greenBorder,
17 | .yellowBorder {
18 | width: 33.33%;
19 | float: left;
20 | height: 8px;
21 | }
22 | .redBorder {
23 | background-color: #f33e6f;
24 | }
25 | .greenBorder {
26 | background-color: #46bfbd;
27 | }
28 | .yellowBorder {
29 | background-color: #fdb45c;
30 | }
31 | h1 {
32 | font-family: "proxima-nova", sans-serif;
33 | font-weight: 600;
34 | font-size: 55px;
35 | margin-top: 40px;
36 | }
37 | h2 {
38 | font-family: "proxima-nova", sans-serif;
39 | font-weight: 400;
40 | margin-top: 20px;
41 | font-size: 26px;
42 | line-height: 40px;
43 | }
44 | h3 {
45 | font-family: "proxima-nova", sans-serif;
46 | font-weight: 600;
47 | text-align: center;
48 | margin: 20px 0;
49 | }
50 | h3 a {
51 | color: #2d91ea;
52 | text-decoration: none;
53 | border-bottom: 1px solid #2d91ea;
54 | }
55 | p {
56 | font-family: "proxima-nova", sans-serif;
57 | line-height: 24px;
58 | font-size: 18px;
59 | color: #767c8d;
60 | }
61 | .btn {
62 | display: inline-block;
63 | padding: 20px;
64 | font-family: "proxima-nova", sans-serif;
65 | font-weight: 600;
66 | color: #fff;
67 | text-decoration: none;
68 | border-radius: 5px;
69 | text-align: center;
70 | font-size: 18px;
71 | -webkit-transition-property: background-color box-shadow;
72 | -webkit-transition-duration: 200ms;
73 | -webkit-transition-timing-function: ease-in-out;
74 | -moz-transition-property: background-color box-shadow;
75 | -moz-transition-duration: 200ms;
76 | -moz-transition-timing-function: ease-in-out;
77 | -ms-transition-property: background-color box-shadow;
78 | -ms-transition-duration: 200ms;
79 | -ms-transition-timing-function: ease-in-out;
80 | -o-transition-property: background-color box-shadow;
81 | -o-transition-duration: 200ms;
82 | -o-transition-timing-function: ease-in-out;
83 | transition-property: background-color box-shadow;
84 | transition-duration: 200ms;
85 | transition-timing-function: ease-in-out;
86 | }
87 | .btn:active {
88 | box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.25);
89 | }
90 | .btn.red {
91 | background-color: #f33e6f;
92 | }
93 | .btn.red:hover {
94 | background-color: #f2265d;
95 | }
96 | .btn.blue {
97 | background-color: #2d91ea;
98 | }
99 | .btn.blue:hover {
100 | background-color: #1785e6;
101 | }
102 | header {
103 | width: 978px;
104 | margin: 20px auto;
105 | display: block;
106 | position: relative;
107 | }
108 | header hgroup {
109 | width: 50%;
110 | padding: 20px 0;
111 | }
112 | header #introChart {
113 | position: absolute;
114 | top: 60px;
115 | right: 0;
116 | }
117 | header .btn {
118 | margin-right: 10px;
119 | width: 180px;
120 | }
121 | footer {
122 | width: 100%;
123 | text-align: center;
124 | background-color: #ebebeb;
125 | }
126 | footer p {
127 | color: #767c8d;
128 | font-family: "proxima-nova", sans-serif;
129 | font-size: 16px;
130 | padding: 20px 0;
131 | }
132 | section {
133 | width: 978px;
134 | margin: 40px auto;
135 | }
136 | section:before {
137 | content: '';
138 | width: 600px;
139 | margin: 0 auto;
140 | border-top: 1px solid #ebebeb;
141 | height: 20px;
142 | display: block;
143 | }
144 | section:after {
145 | content: "";
146 | display: table;
147 | clear: both;
148 | }
149 | *section {
150 | zoom: 1;
151 | }
152 | #features article {
153 | width: 33.33%;
154 | float: left;
155 | }
156 | #features article p {
157 | display: block;
158 | width: 90%;
159 | margin: 0 auto;
160 | text-align: center;
161 | }
162 | #features article img {
163 | width: 250px;
164 | height: 250px;
165 | margin: 0 auto;
166 | display: block;
167 | }
168 | #examples article {
169 | -webkit-transition: opacity 200ms ease-in-out;
170 | -ms-transition: opacity 200ms ease-in-out;
171 | -moz-transition: opacity 200ms ease-in-out;
172 | -o-transition: opacity 200ms ease-in-out;
173 | transition: opacity 200ms ease-in-out;
174 | position: relative;
175 | margin-top: 20px;
176 | clear: both;
177 | }
178 | #examples article:after {
179 | content: '';
180 | width: 600px;
181 | padding-top: 40px;
182 | margin: 40px auto;
183 | border-bottom: 1px solid #ebebeb;
184 | height: 20px;
185 | display: block;
186 | clear: both;
187 | }
188 | #examples article p {
189 | margin-top: 10px;
190 | }
191 | #examples article .half {
192 | width: 50%;
193 | float: left;
194 | }
195 | #examples article .canvasWrapper {
196 | float: left;
197 | width: 449px;
198 | padding: 0 20px;
199 | }
200 | #examples h3 {
201 | clear: both;
202 | }
203 | #examples .hidden {
204 | opacity: 0;
205 | }
206 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 Adam Shaw
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/agenda-views.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
76 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/basic-views.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
76 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_glass_50_3baae3_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_glass_50_3baae3_1x400.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-icons_2694e8_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-icons_2694e8_256x240.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-icons_2e83ff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-icons_2e83ff_256x240.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-icons_3d80b3_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-icons_3d80b3_256x240.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-icons_72a7cf_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-icons_72a7cf_256x240.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/cupertino/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/fullcalendar/demos/cupertino/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
71 |
86 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/external-dragging.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
78 |
133 |
134 |
135 |
136 |
137 |
138 |
Draggable Events
139 |
My Event 1
140 |
My Event 2
141 |
My Event 3
142 |
My Event 4
143 |
My Event 5
144 |
145 | remove after drop
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/gcal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
38 |
59 |
60 |
61 | loading...
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/json-events.php:
--------------------------------------------------------------------------------
1 | 111,
10 | 'title' => "Event1",
11 | 'start' => "$year-$month-10",
12 | 'url' => "http://yahoo.com/"
13 | ),
14 |
15 | array(
16 | 'id' => 222,
17 | 'title' => "Event2",
18 | 'start' => "$year-$month-20",
19 | 'end' => "$year-$month-22",
20 | 'url' => "http://yahoo.com/"
21 | )
22 |
23 | ));
24 |
25 | ?>
26 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/json.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
34 |
55 |
56 |
57 | loading...
58 |
59 | json-events.php needs to be running in the same directory.
60 |
61 |
62 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/selectable.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
93 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/demos/theme.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
78 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/fullcalendar/fullcalendar.print.css:
--------------------------------------------------------------------------------
1 | /*
2 | * FullCalendar v1.5.4 Print Stylesheet
3 | *
4 | * Include this stylesheet on your page to get a more printer-friendly calendar.
5 | * When including this stylesheet, use the media='print' attribute of the tag.
6 | * Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css.
7 | *
8 | * Copyright (c) 2011 Adam Shaw
9 | * Dual licensed under the MIT and GPL licenses, located in
10 | * MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
11 | *
12 | * Date: Tue Sep 4 23:38:33 2012 -0700
13 | *
14 | */
15 |
16 |
17 | /* Events
18 | -----------------------------------------------------*/
19 |
20 | .fc-event-skin {
21 | background: none !important;
22 | color: #000 !important;
23 | }
24 |
25 | /* horizontal events */
26 |
27 | .fc-event-hori {
28 | border-width: 0 0 1px 0 !important;
29 | border-bottom-style: dotted !important;
30 | border-bottom-color: #000 !important;
31 | padding: 1px 0 0 0 !important;
32 | }
33 |
34 | .fc-event-hori .fc-event-inner {
35 | border-width: 0 !important;
36 | padding: 0 1px !important;
37 | }
38 |
39 | /* vertical events */
40 |
41 | .fc-event-vert {
42 | border-width: 0 0 0 1px !important;
43 | border-left-style: dotted !important;
44 | border-left-color: #000 !important;
45 | padding: 0 1px 0 0 !important;
46 | }
47 |
48 | .fc-event-vert .fc-event-inner {
49 | border-width: 0 !important;
50 | padding: 1px 0 !important;
51 | }
52 |
53 | .fc-event-bg {
54 | display: none !important;
55 | }
56 |
57 | .fc-event .ui-resizable-handle {
58 | display: none !important;
59 | }
60 |
61 |
62 |
--------------------------------------------------------------------------------
/static/assets/fullcalendar/fullcalendar/gcal.js:
--------------------------------------------------------------------------------
1 | /*
2 | * FullCalendar v1.5.4 Google Calendar Plugin
3 | *
4 | * Copyright (c) 2011 Adam Shaw
5 | * Dual licensed under the MIT and GPL licenses, located in
6 | * MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
7 | *
8 | * Date: Tue Sep 4 23:38:33 2012 -0700
9 | *
10 | */
11 |
12 | (function($) {
13 |
14 |
15 | var fc = $.fullCalendar;
16 | var formatDate = fc.formatDate;
17 | var parseISO8601 = fc.parseISO8601;
18 | var addDays = fc.addDays;
19 | var applyAll = fc.applyAll;
20 |
21 |
22 | fc.sourceNormalizers.push(function(sourceOptions) {
23 | if (sourceOptions.dataType == 'gcal' ||
24 | sourceOptions.dataType === undefined &&
25 | (sourceOptions.url || '').match(/^(http|https):\/\/www.google.com\/calendar\/feeds\//)) {
26 | sourceOptions.dataType = 'gcal';
27 | if (sourceOptions.editable === undefined) {
28 | sourceOptions.editable = false;
29 | }
30 | }
31 | });
32 |
33 |
34 | fc.sourceFetchers.push(function(sourceOptions, start, end) {
35 | if (sourceOptions.dataType == 'gcal') {
36 | return transformOptions(sourceOptions, start, end);
37 | }
38 | });
39 |
40 |
41 | function transformOptions(sourceOptions, start, end) {
42 |
43 | var success = sourceOptions.success;
44 | var data = $.extend({}, sourceOptions.data || {}, {
45 | 'start-min': formatDate(start, 'u'),
46 | 'start-max': formatDate(end, 'u'),
47 | 'singleevents': true,
48 | 'max-results': 9999
49 | });
50 |
51 | var ctz = sourceOptions.currentTimezone;
52 | if (ctz) {
53 | data.ctz = ctz = ctz.replace(' ', '_');
54 | }
55 |
56 | return $.extend({}, sourceOptions, {
57 | url: sourceOptions.url.replace(/\/basic$/, '/full') + '?alt=json-in-script&callback=?',
58 | dataType: 'jsonp',
59 | data: data,
60 | startParam: false,
61 | endParam: false,
62 | success: function(data) {
63 | var events = [];
64 | if (data.feed.entry) {
65 | $.each(data.feed.entry, function(i, entry) {
66 | var startStr = entry['gd$when'][0]['startTime'];
67 | var start = parseISO8601(startStr, true);
68 | var end = parseISO8601(entry['gd$when'][0]['endTime'], true);
69 | var allDay = startStr.indexOf('T') == -1;
70 | var url;
71 | $.each(entry.link, function(i, link) {
72 | if (link.type == 'text/html') {
73 | url = link.href;
74 | if (ctz) {
75 | url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz;
76 | }
77 | }
78 | });
79 | if (allDay) {
80 | addDays(end, -1); // make inclusive
81 | }
82 | events.push({
83 | id: entry['gCal$uid']['value'],
84 | title: entry['title']['$t'],
85 | url: url,
86 | start: start,
87 | end: end,
88 | allDay: allDay,
89 | location: entry['gd$where'][0]['valueString'],
90 | description: entry['content']['$t']
91 | });
92 | });
93 | }
94 | var args = [events].concat(Array.prototype.slice.call(arguments, 1));
95 | var res = applyAll(success, this, args);
96 | if ($.isArray(res)) {
97 | return res;
98 | }
99 | return events;
100 | }
101 | });
102 |
103 | }
104 |
105 |
106 | // legacy
107 | fc.gcalFeed = function(url, sourceOptions) {
108 | return $.extend({}, sourceOptions, { url: url, dataType: 'gcal' });
109 | };
110 |
111 |
112 | })(jQuery);
113 |
--------------------------------------------------------------------------------
/static/assets/jquery-easy-pie-chart/Makefile:
--------------------------------------------------------------------------------
1 | dist: all
2 | @echo Done
3 |
4 | all:
5 | @echo Compiling coffee script
6 | coffee -c *.coffee
7 |
8 | watch:
9 | @echo Watch coffee script files
10 | coffee -w *.coffee
11 |
12 | .PHONY: dist all watch
--------------------------------------------------------------------------------
/static/assets/jquery-easy-pie-chart/Readme.md:
--------------------------------------------------------------------------------
1 | easy pie chart
2 | ==============
3 |
4 | Easy pie chart is a jQuery plugin that uses the canvas element to render simple pie charts for single values.
5 | These charts are highly customizable, very easy to implement and **scale to the resolution of the display of the client to provide sharp charts even on retina displays**.
6 |
7 | 
8 |
9 | Get started
10 | -----------
11 |
12 | To use the easy pie chart plugin you need to load the current version of jQuery (testet with 1.7.2) and the source (css+js) of the plugin.
13 | Just add the following lines to the `head` of your website:
14 |
15 |
16 |
17 |
18 |
19 |
20 | The second step is to add a element to your site to represent chart and add the `data-percent` attribute with the percent number the pie chart should have:
21 |
22 | 73%
23 |
24 | Finally you have to initialize the plugin with your desired configuration:
25 |
26 |
33 |
34 | Configuration parameter
35 | -----------------------
36 |
37 | You can pass a set of these options to the initialize function to set a custom behaviour and look for the plugin.
38 |
39 |
40 |
41 | Property (Type)
42 | Default
43 | Description
44 |
45 |
46 | barColor
47 | #ef1e25
48 | The color of the curcular bar. You can pass either a css valid color string like rgb, rgba hex or string colors. But you can also pass a function that accepts the current percentage as a value to return a dynamically generated color.
49 |
50 |
51 | trackColor
52 | #f2f2f2
53 | The color of the track for the bar, false to disable rendering.
54 |
55 |
56 | scaleColor
57 | #dfe0e0
58 | The color of the scale lines, false to disable rendering.
59 |
60 |
61 | lineCap
62 | round
63 | Defines how the ending of the bar line looks like. Possible values are: butt
, round
and square
.
64 |
65 |
66 | lineWidth
67 | 3
68 | Width of the bar line in px.
69 |
70 |
71 | size
72 | 110
73 | Size of the pie chart in px. It will always be a square.
74 |
75 |
76 | animate
77 | false
78 | Time in milliseconds for a eased animation of the bar growing, or false to deactivate.
79 |
80 |
81 | onStart
82 | $.noop
83 | Callback function that is called at the start of any animation (only if animate is not false).
84 |
85 |
86 | onStop
87 | $.noop
88 | Callback function that is called at the end of any animation (only if animate is not false).
89 |
90 |
91 |
92 |
93 | Public plugin methods
94 | ---------------------
95 |
96 | If you want to update the current percentage of the a pie chart, you can call the `update` method. The instance of the plugin is saved in the jQuery-data.
97 |
98 |
110 |
111 | Credits
112 | -------
113 |
114 | Thanks to [Rafal Bromirski](http://www.paranoida.com/) for making [this dribble shot](http://drbl.in/ezuc) which inspired me and [Philip Thrasher](http://philipthrasher.com/) for his [CoffeeScript jQuery boilerplate](https://github.com/pthrasher/coffee-plate)
115 |
--------------------------------------------------------------------------------
/static/assets/jquery-easy-pie-chart/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Easy Pie Chart
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
43 |
44 |
45 |
46 |
EASY PIE CHART
47 |
48 |
55 %
49 |
New visits
50 |
51 |
52 |
46 %
53 |
Bounce rate
54 |
55 |
56 |
92 %
57 |
Server load
58 |
59 |
60 |
752 MB
61 |
Used RAM
62 |
63 |
64 |
65 |
66 |
55 %
67 |
New visits
68 |
69 |
70 |
46 %
71 |
Bounce rate
72 |
73 |
74 |
92 %
75 |
Server load
76 |
77 |
78 |
752 MB
79 |
Used RAM
80 |
81 |
82 |
83 |
84 |
Update pie charts
85 |
86 |
Inspired by: Simple Pie Charts II by Rafal Bromirski on dribble
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/static/assets/jquery-easy-pie-chart/examples/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font: 13px/1.4 'Helvetica Neue', 'Helvetica','Arial', sans-serif;
3 | color: #333;
4 | }
5 |
6 | .container {
7 | width: 520px;
8 | margin: auto;
9 | }
10 |
11 | h1 {
12 | border-bottom: 1px solid #d9d9d9;
13 | }
14 |
15 | a {
16 | color: #be2221;
17 | text-decoration: none;
18 | }
19 |
20 | .chart {
21 | float: left;
22 | margin: 10px;
23 | }
24 |
25 | .percentage,
26 | .label {
27 | text-align: center;
28 | color: #333;
29 | font-weight: 100;
30 | font-size: 1.2em;
31 | margin-bottom: 0.3em;
32 | }
33 |
34 | .credits {
35 | padding-top: 0.5em;
36 | clear: both;
37 | color: #999;
38 | }
39 |
40 | .credits a {
41 | color: #333;
42 | }
43 |
44 | .dark {
45 | background: #333;
46 | }
47 |
48 | .dark .percentage-light,
49 | .dark .label {
50 | text-align: center;
51 | color: #999;
52 | font-weight: 100;
53 | font-size: 1.2em;
54 | margin-bottom: 0.3em;
55 | }
56 |
57 |
58 | .button {
59 | -webkit-box-shadow: inset 0 0 1px #000, inset 0 1px 0 1px rgba(255,255,255,0.2), 0 1px 1px -1px rgba(0, 0, 0, .5);
60 | -moz-box-shadow: inset 0 0 1px #000, inset 0 1px 0 1px rgba(255,255,255,0.2), 0 1px 1px -1px rgba(0, 0, 0, .5);
61 | box-shadow: inset 0 0 1px #000, inset 0 1px 0 1px rgba(255,255,255,0.2), 0 1px 1px -1px rgba(0, 0, 0, .5);
62 | -webkit-border-radius: 3px;
63 | -moz-border-radius: 3px;
64 | border-radius: 3px;
65 | padding: 6px 20px;
66 | font-weight: bold;
67 | text-transform: uppercase;
68 | display: block;
69 | margin: auto;
70 | max-width: 200px;
71 | text-align: center;
72 | background-color: #5c5c5c;
73 | background-image: -moz-linear-gradient(top, #666666, #4d4d4d);
74 | background-image: -ms-linear-gradient(top, #666666, #4d4d4d);
75 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#666666), to(#4d4d4d));
76 | background-image: -webkit-linear-gradient(top, #666666, #4d4d4d);
77 | background-image: -o-linear-gradient(top, #666666, #4d4d4d);
78 | background-image: linear-gradient(top, #666666, #4d4d4d);
79 | background-repeat: repeat-x;
80 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#4d4d4d', GradientType=0);
81 | color: #ffffff;
82 | text-shadow: 0 1px 1px #333333;
83 | }
84 | .button:hover {
85 | color: #ffffff;
86 | text-decoration: none;
87 | background-color: #616161;
88 | background-image: -moz-linear-gradient(top, #6b6b6b, #525252);
89 | background-image: -ms-linear-gradient(top, #6b6b6b, #525252);
90 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#6b6b6b), to(#525252));
91 | background-image: -webkit-linear-gradient(top, #6b6b6b, #525252);
92 | background-image: -o-linear-gradient(top, #6b6b6b, #525252);
93 | background-image: linear-gradient(top, #6b6b6b, #525252);
94 | background-repeat: repeat-x;
95 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b6b6b', endColorstr='#525252', GradientType=0);
96 | }
97 | .button:active {
98 | background-color: #575757;
99 | background-image: -moz-linear-gradient(top, #616161, #474747);
100 | background-image: -ms-linear-gradient(top, #616161, #474747);
101 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#616161), to(#474747));
102 | background-image: -webkit-linear-gradient(top, #616161, #474747);
103 | background-image: -o-linear-gradient(top, #616161, #474747);
104 | background-image: linear-gradient(top, #616161, #474747);
105 | background-repeat: repeat-x;
106 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#616161', endColorstr='#474747', GradientType=0);
107 | -webkit-transform: translate(0, 1px);
108 | -moz-transform: translate(0, 1px);
109 | -ms-transform: translate(0, 1px);
110 | -o-transform: translate(0, 1px);
111 | transform: translate(0, 1px);
112 | }
113 | .button:disabled {
114 | background-color: #dddddd;
115 | background-image: -moz-linear-gradient(top, #e7e7e7, #cdcdcd);
116 | background-image: -ms-linear-gradient(top, #e7e7e7, #cdcdcd);
117 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e7e7e7), to(#cdcdcd));
118 | background-image: -webkit-linear-gradient(top, #e7e7e7, #cdcdcd);
119 | background-image: -o-linear-gradient(top, #e7e7e7, #cdcdcd);
120 | background-image: linear-gradient(top, #e7e7e7, #cdcdcd);
121 | background-repeat: repeat-x;
122 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e7e7e7', endColorstr='#cdcdcd', GradientType=0);
123 | color: #939393;
124 | text-shadow: 0 1px 1px #fff;
125 | }
126 |
127 | @media screen and (max-device-width: 480px) {
128 | .container{
129 | width: 100%;
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/static/assets/jquery-easy-pie-chart/img/easy-pie-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/assets/jquery-easy-pie-chart/img/easy-pie-chart.png
--------------------------------------------------------------------------------
/static/assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css:
--------------------------------------------------------------------------------
1 | .easyPieChart {
2 | position: relative;
3 | text-align: center;
4 | }
5 |
6 | .easyPieChart canvas {
7 | position: absolute;
8 | top: 0;
9 | left: 0;
10 | }
11 |
--------------------------------------------------------------------------------
/static/assets/jquery-knob/README.md:
--------------------------------------------------------------------------------
1 | jQuery Knob
2 | =============
3 |
4 | - canvas based ; no png or jpg sprites.
5 | - touch, mouse and mousewheel, keyboard events implemented.
6 | - downward compatible ; overloads an input element.
7 |
8 | Example
9 | -------
10 |
11 |
12 |
13 |
18 |
19 | Options
20 | -------
21 |
22 | Options are provided as attributes 'data-option':
23 |
24 |
25 |
26 | ... or in the "knob()" call :
27 |
28 | $(".dial").knob({
29 | 'min':-50
30 | ,'max':50
31 | })
32 |
33 | The following options are supported :
34 |
35 | Behaviors :
36 | * min : min value | default=0.
37 | * max : max value | default=100.
38 | * angleOffset : starting angle in degrees | default=0.
39 | * angleArc : arc size in degrees | default=360.
40 | * stopper : stop at min & max on keydown/mousewheel | default=true.
41 | * readOnly : disable input and events | default=false.
42 |
43 | UI :
44 | * cursor : display mode "cursor" | default=gauge.
45 | * thickness : gauge thickness.
46 | * width : dial width.
47 | * displayInput : default=true | false=hide input.
48 | * displayPrevious : default=false | true=displays the previous value with transparency.
49 | * fgColor : foreground color.
50 | * bgColor : background color.
51 |
52 | Hooks
53 | -------
54 |
55 |
60 |
61 | * 'release' : executed on release
62 |
63 | Parameters :
64 | + value : int, current value
65 |
66 | * 'change' : executed at each change of the value
67 |
68 | Parameters :
69 | + value : int, current value
70 |
71 | * 'draw' : when drawing the canvas
72 |
73 | Context :
74 | - this.g : canvas context 2D (see Canvas documentation)
75 | - this.$ : jQuery wrapped element
76 | - this.o : options
77 | - this.i : input
78 | - ... console.log(this);
79 |
80 | * 'cancel' : triggered on [esc] keydown
81 |
82 | The scope (this) of each hook function is the current Knob instance (refer to the demo code).
83 |
84 | Example
85 | -------
86 |
87 |
88 |
89 |
94 |
95 |
96 | Dynamically configure
97 | -------
98 |
99 |
112 |
113 | Set the value
114 | -------
115 |
116 |
121 |
122 | Supported browser
123 | -------
124 |
125 | Tested on Chrome, Safari, Firefox, IE 9.0.
--------------------------------------------------------------------------------
/static/css/jquery-jvectormap-1.2.2.css:
--------------------------------------------------------------------------------
1 | .jvectormap-label {
2 | position: absolute;
3 | display: none;
4 | border: solid 1px #d4d4d4;
5 | -webkit-border-radius: 2px;
6 | -moz-border-radius: 2px;
7 | border-radius: 2px;
8 | background: white;
9 | color: #d4d4d4;
10 | font-family: sans-serif, Verdana;
11 | font-size: smaller;
12 | padding: 3px;
13 | }
14 |
15 | .jvectormap-zoomin, .jvectormap-zoomout {
16 | position: absolute;
17 | left: 10px;
18 | -webkit-border-radius: 1px;
19 | -moz-border-radius: 1px;
20 | border-radius: 1px;
21 | border: solid 1px #d4d4d4;
22 | background: white;
23 | padding: 3px;
24 | color: #d4d4d4;
25 | width: 20px;
26 | height: 20px;
27 | cursor: pointer;
28 | line-height: 10px;
29 | text-align: center;
30 | }
31 |
32 | .jvectormap-zoomin {
33 | top: 10px;
34 | }
35 |
36 | .jvectormap-zoomout {
37 | top: 30px;
38 | }
--------------------------------------------------------------------------------
/static/css/line-icons.css:
--------------------------------------------------------------------------------
1 | .icon-envelope-l {
2 | background: url('../img/icons/line-icon.png') no-repeat -727px -62px;
3 | width: 24px;
4 | height: 16px;;
5 | display: inline-block !important;
6 | }
7 | .icon-bell-l {
8 | background: url('../img/icons/line-icon.png') no-repeat -217px -18px;
9 | width: 23px;
10 | height: 25px;;
11 | display: inline-block !important;
12 | }
13 | .icon-task-l {
14 | background: url('../img/icons/line-icon.png') no-repeat -517px -102px;
15 | width: 23px;
16 | height: 16px;;
17 | display: inline-block !important;
18 | }
19 | .icon-dashboard-l {
20 | background: url('../img/icons/line-icon.png') no-repeat -15px -17px;
21 | width: 24px;
22 | height: 24px;
23 | display: inline-block !important;
24 | }
25 | .icon-charts-l {
26 | background: url('../img/icons/line-icon.png') no-repeat -136px -98px;
27 | width: 24px;
28 | height: 24px;
29 | display: inline-block !important;
30 | }
31 | .icon-calendar-l {
32 | background: url('../img/icons/line-icon.png') no-repeat -435px -138px;
33 | width: 24px;
34 | height: 22px;
35 | display: inline-block !important;
36 | }
37 | .icon-login-l {
38 | background: url('../img/icons/line-icon.png') no-repeat -687px -59px;
39 | width: 23px;
40 | height: 23px;
41 | display: inline-block !important;
42 | }
43 | .icon-map-l {
44 | background: url('../img/icons/line-icon.png') no-repeat -519px -134px;
45 | width: 19px;
46 | height: 29px;
47 | display: inline-block !important;
48 | }
49 | .icon-widget-l {
50 | background: url('../img/icons/line-icon.png') no-repeat -357px -19px;
51 | width: 22px;
52 | height: 22px;
53 | display: inline-block !important;
54 | }
55 | .icon-uikit-l {
56 | background: url('../img/icons/line-icon.png') no-repeat -135px -57px;
57 | width: 24px;
58 | height: 24px;
59 | display: inline-block !important;
60 | }
61 | .icon-pages-l {
62 | background: url('../img/icons/line-icon.png') no-repeat -729px -18px;
63 | width: 21px;
64 | height: 25px;
65 | display: inline-block !important;
66 | }
67 | .icon-form-l {
68 | background: url('../img/icons/line-icon.png') no-repeat -55px -102px;
69 | width: 26px;
70 | height: 18px;
71 | display: inline-block !important;
72 | }
73 | .icon-table-l {
74 | background: url('../img/icons/line-icon.png') no-repeat -807px -140px;
75 | width: 26px;
76 | height: 20px;
77 | display: inline-block !important;
78 | }
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | /*Hover*/
87 | .icon-envelope-l:hover,.icon-envelope-l.active{
88 | background: url('../img/icons/line-icon-hover.png') no-repeat -727px -62px;
89 | width: 24px;
90 | height: 16px;
91 | display: inline-block !important;
92 | }
93 | .icon-bell-l:hover{
94 | background: url('../img/icons/line-icon-hover.png') no-repeat -217px -18px;
95 | width: 23px;
96 | height: 25px;
97 | display: inline-block !important;
98 | }
99 | .icon-task-l:hover{
100 | background: url('../img/icons/line-icon-hover.png') no-repeat -517px -102px;
101 | width: 23px;
102 | height: 16px;
103 | display: inline-block !important;
104 | }
--------------------------------------------------------------------------------
/static/css/owl.carousel.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Core carousel CSS File
3 | * v1.21
4 | */
5 |
6 | /* clearfix */
7 | .owl-carousel .owl-wrapper:after {
8 | content: ".";
9 | display: block;
10 | clear: both;
11 | visibility: hidden;
12 | line-height: 0;
13 | height: 0;
14 | }
15 | /* display none until init */
16 | .owl-carousel{
17 | display: none;
18 | position: relative;
19 | width: 100%;
20 | -ms-touch-action: pan-y;
21 | }
22 | .owl-carousel .owl-wrapper{
23 | display: none;
24 | position: relative;
25 | -webkit-transform: translate3d(0px, 0px, 0px);
26 | -webkit-perspective: 1000;
27 | }
28 | .owl-carousel .owl-wrapper-outer{
29 | overflow: hidden;
30 | position: relative;
31 | width: 100%;
32 | }
33 | .owl-carousel .owl-wrapper-outer.autoHeight{
34 | -webkit-transition: height 500ms ease-in-out;
35 | -moz-transition: height 500ms ease-in-out;
36 | -ms-transition: height 500ms ease-in-out;
37 | -o-transition: height 500ms ease-in-out;
38 | transition: height 500ms ease-in-out;
39 | }
40 |
41 | .owl-carousel .owl-item{
42 | float: left;
43 | }
44 | .owl-controls .owl-page,
45 | .owl-controls .owl-buttons div{
46 | cursor: pointer;
47 | }
48 | .owl-controls {
49 | -webkit-user-select: none;
50 | -khtml-user-select: none;
51 | -moz-user-select: none;
52 | -ms-user-select: none;
53 | user-select: none;
54 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
55 | }
56 |
57 | /* mouse grab icon */
58 | .grabbing {
59 | /*cursor:url(grabbing.png) 8 8, move;*/
60 | }
61 |
62 | /* fix */
63 | .owl-carousel .owl-wrapper,
64 | .owl-carousel .owl-item{
65 | -webkit-backface-visibility: hidden;
66 | -moz-backface-visibility: hidden;
67 | -ms-backface-visibility: hidden;
68 | }
69 |
--------------------------------------------------------------------------------
/static/css/tagcloud.css:
--------------------------------------------------------------------------------
1 | /**
2 | * tagcloud v1.1.1 - http://tagcloud.congm.in
3 | * Copyright 2016 @ Cong Min , Inc.
4 | * MIT License - https://github.com/mcc108/tagcloud
5 | */
6 | /* base */
7 | .tagcloud {
8 | visibility: hidden;
9 | display: block;
10 | position: relative;
11 | height: 100%;
12 | width: 100%;
13 | margin: 0;
14 | padding: 0;
15 | }
16 | .tagcloud > a {
17 | position: absolute;
18 | top: 0;
19 | left: 0;
20 | line-height: 1;
21 | font-weight: bold;
22 | text-decoration: none;
23 | padding: 2px 4px;
24 | background-color: transparent;
25 | border: 1px solid transparent;
26 | color: #333;
27 | }
28 | .tagcloud > a:hover {
29 | background-color: rgba(180, 180, 180, .15);
30 | border: 1px solid #666;
31 | -webkit-border-radius: 2px;
32 | -moz-border-radius: 2px;
33 | border-radius: 2px;
34 | }
35 | /* light */
36 | .tagcloud.tagcloud-light > a {
37 | color: #fff;
38 | }
39 | .tagcloud.tagcloud-light > a:hover {
40 | background-color: rgba(255, 255, 255, .1);
41 | border: 1px solid #fff;
42 | }
--------------------------------------------------------------------------------
/static/css/tree_style.css:
--------------------------------------------------------------------------------
1 | .tree {
2 | min-height:20px;
3 | padding:19px;
4 | margin-bottom:20px;
5 | background-color:#fbfbfb;
6 | border:1px solid #999;
7 | -webkit-border-radius:4px;
8 | -moz-border-radius:4px;
9 | border-radius:4px;
10 | -webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);
11 | -moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);
12 | box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05)
13 | }
14 | .tree li {
15 | list-style-type:none;
16 | margin:0;
17 | padding:10px 5px 0 5px;
18 | position:relative
19 | }
20 | .tree li::before, .tree li::after {
21 | content:'';
22 | left:-20px;
23 | position:absolute;
24 | right:auto
25 | }
26 | .tree li::before {
27 | border-left:1px solid #999;
28 | bottom:50px;
29 | height:100%;
30 | top:0;
31 | width:1px
32 | }
33 | .tree li::after {
34 | border-top:1px solid #999;
35 | height:20px;
36 | top:25px;
37 | width:25px
38 | }
39 | .tree li span {
40 | -moz-border-radius:5px;
41 | -webkit-border-radius:5px;
42 | border:1px solid #999;
43 | border-radius:5px;
44 | display:inline-block;
45 | padding:3px 8px;
46 | text-decoration:none
47 | }
48 | .tree li.parent_li>span {
49 | cursor:pointer
50 | }
51 | .tree>ul>li::before, .tree>ul>li::after {
52 | border:0
53 | }
54 | .tree li:last-child::before {
55 | height:25px
56 | }
57 | .tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span {
58 | background:#eee;
59 | border:1px solid #94a0b4;
60 | color:#000
61 | }
--------------------------------------------------------------------------------
/static/css/xcharts.min.css:
--------------------------------------------------------------------------------
1 | .xchart .line{stroke-width:3px;fill:none}.xchart .fill{stroke-width:0}.xchart circle{stroke:#FFF;stroke-width:3px}.xchart .axis .domain{fill:none}.xchart .axis .tick line{stroke:#EEE;stroke-width:1px}.xchart .axis text{font-family:Helvetica,Arial,Verdana,sans-serif;fill:#666;font-size:12px}.xchart .color0 .line{stroke:#3880aa}.xchart .color0 .line .fill{pointer-events:none}.xchart .color0 rect,.xchart .color0 circle{fill:#3880aa}.xchart .color0 .fill{fill:rgba(56,128,170,0.1)}.xchart .color0.comp .line{stroke:#89bbd8}.xchart .color0.comp rect{fill:#89bbd8}.xchart .color0.comp .fill{display:none}.xchart .color0.comp circle,.xchart .color0.comp .pointer{fill:#89bbd8}.xchart .color1 .line{stroke:#4da944}.xchart .color1 .line .fill{pointer-events:none}.xchart .color1 rect,.xchart .color1 circle{fill:#4da944}.xchart .color1 .fill{fill:rgba(77,169,68,0.1)}.xchart .color1.comp .line{stroke:#9dd597}.xchart .color1.comp rect{fill:#9dd597}.xchart .color1.comp .fill{display:none}.xchart .color1.comp circle,.xchart .color1.comp .pointer{fill:#9dd597}.xchart .color2 .line{stroke:#f26522}.xchart .color2 .line .fill{pointer-events:none}.xchart .color2 rect,.xchart .color2 circle{fill:#f26522}.xchart .color2 .fill{fill:rgba(242,101,34,0.1)}.xchart .color2.comp .line{stroke:#f9b99a}.xchart .color2.comp rect{fill:#f9b99a}.xchart .color2.comp .fill{display:none}.xchart .color2.comp circle,.xchart .color2.comp .pointer{fill:#f9b99a}.xchart .color3 .line{stroke:#c6080d}.xchart .color3 .line .fill{pointer-events:none}.xchart .color3 rect,.xchart .color3 circle{fill:#c6080d}.xchart .color3 .fill{fill:rgba(198,8,13,0.1)}.xchart .color3.comp .line{stroke:#f8555a}.xchart .color3.comp rect{fill:#f8555a}.xchart .color3.comp .fill{display:none}.xchart .color3.comp circle,.xchart .color3.comp .pointer{fill:#f8555a}.xchart .color4 .line{stroke:#672d8b}.xchart .color4 .line .fill{pointer-events:none}.xchart .color4 rect,.xchart .color4 circle{fill:#672d8b}.xchart .color4 .fill{fill:rgba(103,45,139,0.1)}.xchart .color4.comp .line{stroke:#a869ce}.xchart .color4.comp rect{fill:#a869ce}.xchart .color4.comp .fill{display:none}.xchart .color4.comp circle,.xchart .color4.comp .pointer{fill:#a869ce}.xchart .color5 .line{stroke:#ce1797}.xchart .color5 .line .fill{pointer-events:none}.xchart .color5 rect,.xchart .color5 circle{fill:#ce1797}.xchart .color5 .fill{fill:rgba(206,23,151,0.1)}.xchart .color5.comp .line{stroke:#f075cb}.xchart .color5.comp rect{fill:#f075cb}.xchart .color5.comp .fill{display:none}.xchart .color5.comp circle,.xchart .color5.comp .pointer{fill:#f075cb}.xchart .color6 .line{stroke:#d9ce00}.xchart .color6 .line .fill{pointer-events:none}.xchart .color6 rect,.xchart .color6 circle{fill:#d9ce00}.xchart .color6 .fill{fill:rgba(217,206,0,0.1)}.xchart .color6.comp .line{stroke:#fff75a}.xchart .color6.comp rect{fill:#fff75a}.xchart .color6.comp .fill{display:none}.xchart .color6.comp circle,.xchart .color6.comp .pointer{fill:#fff75a}.xchart .color7 .line{stroke:#754c24}.xchart .color7 .line .fill{pointer-events:none}.xchart .color7 rect,.xchart .color7 circle{fill:#754c24}.xchart .color7 .fill{fill:rgba(117,76,36,0.1)}.xchart .color7.comp .line{stroke:#c98c50}.xchart .color7.comp rect{fill:#c98c50}.xchart .color7.comp .fill{display:none}.xchart .color7.comp circle,.xchart .color7.comp .pointer{fill:#c98c50}.xchart .color8 .line{stroke:#2eb9b4}.xchart .color8 .line .fill{pointer-events:none}.xchart .color8 rect,.xchart .color8 circle{fill:#2eb9b4}.xchart .color8 .fill{fill:rgba(46,185,180,0.1)}.xchart .color8.comp .line{stroke:#86e1de}.xchart .color8.comp rect{fill:#86e1de}.xchart .color8.comp .fill{display:none}.xchart .color8.comp circle,.xchart .color8.comp .pointer{fill:#86e1de}.xchart .color9 .line{stroke:#0e2e42}.xchart .color9 .line .fill{pointer-events:none}.xchart .color9 rect,.xchart .color9 circle{fill:#0e2e42}.xchart .color9 .fill{fill:rgba(14,46,66,0.1)}.xchart .color9.comp .line{stroke:#2477ab}.xchart .color9.comp rect{fill:#2477ab}.xchart .color9.comp .fill{display:none}.xchart .color9.comp circle,.xchart .color9.comp .pointer{fill:#2477ab} .xchart .errorLine path {stroke: #C6080D;stroke-width: 3px;}.ex-tooltip{position:absolute;background:#EEE;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:5px;-webkit-box-shadow:0 1px 3px #000;-moz-box-shadow:0 1px 3px #000;-ms-box-shadow:0 1px 3px #000;-o-box-shadow:0 1px 3px #000;box-shadow:0 1px 3px #000;border-collapse:separate;display:none}
--------------------------------------------------------------------------------
/static/fonts/ElegantIcons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/ElegantIcons.eot
--------------------------------------------------------------------------------
/static/fonts/ElegantIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/ElegantIcons.ttf
--------------------------------------------------------------------------------
/static/fonts/ElegantIcons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/ElegantIcons.woff
--------------------------------------------------------------------------------
/static/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/static/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/static/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/static/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/static/img/arrow-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/arrow-up.png
--------------------------------------------------------------------------------
/static/img/chart-texture.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/chart-texture.jpg
--------------------------------------------------------------------------------
/static/img/icons/line-icon-c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/icons/line-icon-c.png
--------------------------------------------------------------------------------
/static/img/icons/line-icon-hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/icons/line-icon-hover.png
--------------------------------------------------------------------------------
/static/img/icons/line-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/icons/line-icon.png
--------------------------------------------------------------------------------
/static/img/icons/search-line-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/icons/search-line-icon.png
--------------------------------------------------------------------------------
/static/img/icons/social.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/icons/social.png
--------------------------------------------------------------------------------
/static/img/icons/weather-hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/icons/weather-hover.png
--------------------------------------------------------------------------------
/static/img/icons/weather.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/icons/weather.png
--------------------------------------------------------------------------------
/static/img/left-arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/left-arrow.png
--------------------------------------------------------------------------------
/static/img/right-arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luxuantao/car_knowledge_graph/085e7a9c497d3c99f88bfaf2a7cc14c983aad2e1/static/img/right-arrow.png
--------------------------------------------------------------------------------
/static/js/bootstrap-wysiwyg-custom.js:
--------------------------------------------------------------------------------
1 | //bootstrap wysiwyg
2 | $(function(){
3 | function initToolbarBootstrapBindings() {
4 | var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',
5 | 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',
6 | 'Times New Roman', 'Verdana'],
7 | fontTarget = $('[title=Font]').siblings('.dropdown-menu');
8 | $.each(fonts, function (idx, fontName) {
9 | fontTarget.append($(''+fontName + ' '));
10 | });
11 | $('a[title]').tooltip({container:'body'});
12 | $('.dropdown-menu input').click(function() {return false;})
13 | .change(function () {$(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');})
14 | .keydown('esc', function () {this.value='';$(this).change();});
15 |
16 | $('[data-role=magic-overlay]').each(function () {
17 | var overlay = $(this), target = $(overlay.data('target'));
18 | overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());
19 | });
20 | /* voiceBtn
21 | if ("onwebkitspeechchange" in document.createElement("input")) {
22 | var editorOffset = $('#editor').offset();
23 | $('#voiceBtn').css('position','absolute').offset({top: editorOffset.top, left: editorOffset.left+$('#editor').innerWidth()-35});
24 | } else {
25 | $('#voiceBtn').hide();
26 | }*/
27 | };
28 | function showErrorAlert (reason, detail) {
29 | var msg='';
30 | if (reason==='unsupported-file-type') { msg = "Unsupported format " +detail; }
31 | else {
32 | console.log("error uploading file", reason, detail);
33 | }
34 | $(' × '+
35 | 'File upload error '+msg+'
').prependTo('#alerts');
36 | };
37 | initToolbarBootstrapBindings();
38 | $('#editor').wysiwyg({ fileUploadError: showErrorAlert} );
39 | window.prettyPrint && prettyPrint();
40 | });
--------------------------------------------------------------------------------
/static/js/calendar-custom.js:
--------------------------------------------------------------------------------
1 | var Script = function () {
2 |
3 |
4 | /* initialize the external events
5 | -----------------------------------------------------------------*/
6 |
7 | $('#external-events div.external-event').each(function() {
8 |
9 | // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
10 | // it doesn't need to have a start or end
11 | var eventObject = {
12 | title: $.trim($(this).text()) // use the element's text as the event title
13 | };
14 |
15 | // store the Event Object in the DOM element so we can get to it later
16 | $(this).data('eventObject', eventObject);
17 |
18 | // make the event draggable using jQuery UI
19 | $(this).draggable({
20 | zIndex: 999,
21 | revert: true, // will cause the event to go back to its
22 | revertDuration: 0 // original position after the drag
23 | });
24 |
25 | });
26 |
27 |
28 | /* initialize the calendar
29 | -----------------------------------------------------------------*/
30 |
31 | var date = new Date();
32 | var d = date.getDate();
33 | var m = date.getMonth();
34 | var y = date.getFullYear();
35 |
36 | $('#calendar').fullCalendar({
37 | header: {
38 | left: 'prev,next today',
39 | center: 'title',
40 | right: 'month,basicWeek,basicDay'
41 | },
42 | editable: true,
43 | droppable: true, // this allows things to be dropped onto the calendar !!!
44 | drop: function(date, allDay) { // this function is called when something is dropped
45 |
46 | // retrieve the dropped element's stored Event Object
47 | var originalEventObject = $(this).data('eventObject');
48 |
49 | // we need to copy it, so that multiple events don't have a reference to the same object
50 | var copiedEventObject = $.extend({}, originalEventObject);
51 |
52 | // assign it the date that was reported
53 | copiedEventObject.start = date;
54 | copiedEventObject.allDay = allDay;
55 |
56 | // render the event on the calendar
57 | // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
58 | $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
59 |
60 | // is the "remove after drop" checkbox checked?
61 | if ($('#drop-remove').is(':checked')) {
62 | // if so, remove the element from the "Draggable Events" list
63 | $(this).remove();
64 | }
65 |
66 | },
67 | events: [
68 | {
69 | title: 'All Day Event',
70 | start: new Date(y, m, 1)
71 | },
72 | {
73 | title: 'Long Event',
74 | start: new Date(y, m, d-5),
75 | end: new Date(y, m, d-2)
76 | },
77 | {
78 | id: 999,
79 | title: 'Repeating Event',
80 | start: new Date(y, m, d-3, 16, 0),
81 | allDay: false
82 | },
83 | {
84 | id: 999,
85 | title: 'Repeating Event',
86 | start: new Date(y, m, d+4, 16, 0),
87 | allDay: false
88 | },
89 | {
90 | title: 'Meeting',
91 | start: new Date(y, m, d, 10, 30),
92 | allDay: false
93 | },
94 | {
95 | title: 'Lunch',
96 | start: new Date(y, m, d, 12, 0),
97 | end: new Date(y, m, d, 14, 0),
98 | allDay: false
99 | },
100 | {
101 | title: 'Birthday Party',
102 | start: new Date(y, m, d+1, 19, 0),
103 | end: new Date(y, m, d+1, 22, 30),
104 | allDay: false
105 | },
106 | {
107 | title: 'Click for Google',
108 | start: new Date(y, m, 28),
109 | end: new Date(y, m, 29),
110 | url: 'http://google.com/'
111 | }
112 | ]
113 | });
114 |
115 | }();
--------------------------------------------------------------------------------
/static/js/chartjs-custom.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function() {
2 |
3 |
4 | var doughnutData = [
5 | {
6 | value: 30,
7 | color:"#F7464A"
8 | },
9 | {
10 | value : 50,
11 | color : "#46BFBD"
12 | },
13 | {
14 | value : 100,
15 | color : "#FDB45C"
16 | },
17 | {
18 | value : 40,
19 | color : "#949FB1"
20 | },
21 | {
22 | value : 120,
23 | color : "#4D5360"
24 | }
25 |
26 | ];
27 | var lineChartData = {
28 | labels : ["","","","","","",""],
29 | datasets : [
30 | {
31 | fillColor : "rgba(220,220,220,0.5)",
32 | strokeColor : "rgba(220,220,220,1)",
33 | pointColor : "rgba(220,220,220,1)",
34 | pointStrokeColor : "#fff",
35 | data : [65,59,90,81,56,55,40]
36 | },
37 | {
38 | fillColor : "rgba(151,187,205,0.5)",
39 | strokeColor : "rgba(151,187,205,1)",
40 | pointColor : "rgba(151,187,205,1)",
41 | pointStrokeColor : "#fff",
42 | data : [28,48,40,19,96,27,100]
43 | }
44 | ]
45 |
46 | };
47 | var pieData = [
48 | {
49 | value: 30,
50 | color:"#F38630"
51 | },
52 | {
53 | value : 50,
54 | color : "#E0E4CC"
55 | },
56 | {
57 | value : 100,
58 | color : "#69D2E7"
59 | }
60 |
61 | ];
62 | var barChartData = {
63 | labels : ["January","February","March","April","May","June","July"],
64 | datasets : [
65 | {
66 | fillColor : "rgba(220,220,220,0.5)",
67 | strokeColor : "rgba(220,220,220,1)",
68 | data : [65,59,90,81,56,55,40]
69 | },
70 | {
71 | fillColor : "rgba(151,187,205,0.5)",
72 | strokeColor : "rgba(151,187,205,1)",
73 | data : [28,48,40,19,96,27,100]
74 | }
75 | ]
76 |
77 | };
78 | var chartData = [
79 | {
80 | value : Math.random(),
81 | color: "#D97041"
82 | },
83 | {
84 | value : Math.random(),
85 | color: "#C7604C"
86 | },
87 | {
88 | value : Math.random(),
89 | color: "#21323D"
90 | },
91 | {
92 | value : Math.random(),
93 | color: "#9D9B7F"
94 | },
95 | {
96 | value : Math.random(),
97 | color: "#7D4F6D"
98 | },
99 | {
100 | value : Math.random(),
101 | color: "#584A5E"
102 | }
103 | ];
104 | var radarChartData = {
105 | labels : ["","","","","","",""],
106 | datasets : [
107 | {
108 | fillColor : "rgba(220,220,220,0.5)",
109 | strokeColor : "rgba(220,220,220,1)",
110 | pointColor : "rgba(220,220,220,1)",
111 | pointStrokeColor : "#fff",
112 | data : [65,59,90,81,56,55,40]
113 | },
114 | {
115 | fillColor : "rgba(151,187,205,0.5)",
116 | strokeColor : "rgba(151,187,205,1)",
117 | pointColor : "rgba(151,187,205,1)",
118 | pointStrokeColor : "#fff",
119 | data : [28,48,40,19,96,27,100]
120 | }
121 | ]
122 |
123 | };
124 | new Chart(document.getElementById("doughnut").getContext("2d")).Doughnut(doughnutData);
125 | new Chart(document.getElementById("line").getContext("2d")).Line(lineChartData);
126 | new Chart(document.getElementById("radar").getContext("2d")).Radar(radarChartData);
127 | new Chart(document.getElementById("polarArea").getContext("2d")).PolarArea(chartData);
128 | new Chart(document.getElementById("bar").getContext("2d")).Bar(barChartData);
129 | new Chart(document.getElementById("pie").getContext("2d")).Pie(pieData);
130 |
131 |
132 | });
--------------------------------------------------------------------------------
/static/js/charts.js:
--------------------------------------------------------------------------------
1 | /*Sparklines */
2 |
3 | /* Sparkline plugin Section starts */
4 |
5 | $("#status1").sparkline([5,6,7,9,9,5,9,6,5,6,6,7,7,6,7,8,9,5 ], {
6 | type: 'line',
7 | width: '80',
8 | height: '20',
9 | lineColor: '#436B91',
10 | fillColor: '#fff'});
11 |
12 | $("#status2").sparkline([5,6,7,4,9,5,9,6,4,6,6,7,8,6,7,4,9,5 ], {
13 | type: 'line',
14 | width: '80',
15 | height: '20',
16 | lineColor: '#436B91',
17 | fillColor: '#fff'});
18 |
19 | $("#status3").sparkline([9,6,7,5,9,5,9,7,5,6,3,7,7,6,7,8,8,5 ], {
20 | type: 'line',
21 | width: '80',
22 | height: '20',
23 | lineColor: '#436B91',
24 | fillColor: '#fff'});
25 |
26 | $("#status4").sparkline([5,2,7,9,9,4,9,6,5,9,6,7,5,6,7,8,4,5 ], {
27 | type: 'line',
28 | width: '80',
29 | height: '20',
30 | lineColor: '#436B91',
31 | fillColor: '#fff'});
32 |
33 | $("#status5").sparkline([7,6,3,9,9,5,4,6,6,9,6,7,7,6,4,8,9,5 ], {
34 | type: 'line',
35 | width: '80',
36 | height: '20',
37 | lineColor: '#436B91',
38 | fillColor: '#fff'});
39 |
40 | $("#status6").sparkline([4,6,7,8,9,5,3,6,5,6,7,5,7,2,7,8,7,5 ], {
41 | type: 'line',
42 | width: '80',
43 | height: '20',
44 | lineColor: '#436B91',
45 | fillColor: '#fff'});
46 |
47 | $("#status7").sparkline([3,6,3,9,9,5,4,6,5,6,4,9,7,6,7,8,8,5 ], {
48 | type: 'line',
49 | width: '80',
50 | height: '20',
51 | lineColor: '#436B91',
52 | fillColor: '#fff'});
53 |
54 | $("#todayspark1").sparkline([8,11,9,12,10,9,13,11,12,11,10,12,11,], {
55 | type: 'bar',
56 | height: '30',
57 | barWidth: 5,
58 | barColor: '#999'});
59 |
60 | $("#todayspark2").sparkline([8,11,9,12,10,9,13,11,12,11,10,12,12,11,10,12,11,], {
61 | type: 'bar',
62 | height: '30',
63 | barWidth: 5,
64 | barColor: '#C5CED6'});
65 |
66 | $("#todayspark3").sparkline([8,11,9,12,10,9,13,11,12,11,10,12,11,12,11,9], {
67 | type: 'bar',
68 | height: '30',
69 | barWidth: 10,
70 | barColor: '#436B91'});
71 |
72 | $("#todayspark4").sparkline([8,11,9,12,10,9,13,11,12,11,10,12,11,12,11,14,13], {
73 | type: 'bar',
74 | height: '30',
75 | barWidth: 10,
76 | barColor: '#486b60'});
77 |
78 | $("#todayspark5").sparkline([3,6,3,9,9,5,4,6,5,6,4,9,7,9,7,4,6,8,9,5,6,7,8,6,7,2,4,6,3,7,8,9,7,5,8,9,5,7,8,8,5 ], {
79 | type: 'line',
80 | width: '250',
81 | height: '30',
82 | lineColor: '#436B91',
83 | fillColor: '#efefef'});
84 |
85 |
86 | /* Sparkline plugin section ends */
87 |
88 |
--------------------------------------------------------------------------------
/static/js/dynamic-table.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function() {
2 |
3 | // begin first table
4 | $('#sample_1').dataTable({
5 | "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
6 | "sPaginationType": "bootstrap",
7 | "oLanguage": {
8 | "sLengthMenu": "_MENU_ records per page",
9 | "oPaginate": {
10 | "sPrevious": "Prev",
11 | "sNext": "Next"
12 | }
13 | },
14 | "aoColumnDefs": [{
15 | 'bSortable': false,
16 | 'aTargets': [0]
17 | }]
18 | });
19 |
20 | jQuery('#sample_1 .group-checkable').change(function () {
21 | var set = jQuery(this).attr("data-set");
22 | var checked = jQuery(this).is(":checked");
23 | jQuery(set).each(function () {
24 | if (checked) {
25 | $(this).attr("checked", true);
26 | } else {
27 | $(this).attr("checked", false);
28 | }
29 | });
30 | jQuery.uniform.update(set);
31 | });
32 |
33 | jQuery('#sample_1_wrapper .dataTables_filter input').addClass("form-control"); // modify table search input
34 | jQuery('#sample_1_wrapper .dataTables_length select').addClass("form-control"); // modify table per page dropdown
35 |
36 | // begin second table
37 | $('#sample_2').dataTable({
38 | "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
39 | "sPaginationType": "bootstrap",
40 | "oLanguage": {
41 | "sLengthMenu": "_MENU_ per page",
42 | "oPaginate": {
43 | "sPrevious": "Prev",
44 | "sNext": "Next"
45 | }
46 | },
47 | "aoColumnDefs": [{
48 | 'bSortable': false,
49 | 'aTargets': [0]
50 | }]
51 | });
52 |
53 | jQuery('#sample_2 .group-checkable').change(function () {
54 | var set = jQuery(this).attr("data-set");
55 | var checked = jQuery(this).is(":checked");
56 | jQuery(set).each(function () {
57 | if (checked) {
58 | $(this).attr("checked", true);
59 | } else {
60 | $(this).attr("checked", false);
61 | }
62 | });
63 | jQuery.uniform.update(set);
64 | });
65 |
66 | jQuery('#sample_2_wrapper .dataTables_filter input').addClass("form-control"); // modify table search input
67 | jQuery('#sample_2_wrapper .dataTables_length select').addClass("form-control"); // modify table per page dropdown
68 |
69 | // begin: third table
70 | $('#sample_3').dataTable({
71 | "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
72 | "sPaginationType": "bootstrap",
73 | "oLanguage": {
74 | "sLengthMenu": "_MENU_ per page",
75 | "oPaginate": {
76 | "sPrevious": "Prev",
77 | "sNext": "Next"
78 | }
79 | },
80 | "aoColumnDefs": [{
81 | 'bSortable': false,
82 | 'aTargets': [0]
83 | }]
84 | });
85 |
86 | jQuery('#sample_3 .group-checkable').change(function () {
87 | var set = jQuery(this).attr("data-set");
88 | var checked = jQuery(this).is(":checked");
89 | jQuery(set).each(function () {
90 | if (checked) {
91 | $(this).attr("checked", true);
92 | } else {
93 | $(this).attr("checked", false);
94 | }
95 | });
96 | jQuery.uniform.update(set);
97 | });
98 |
99 | jQuery('#sample_3_wrapper .dataTables_filter input').addClass("form-control"); // modify table search input
100 | jQuery('#sample_3_wrapper .dataTables_length select').addClass("form-control"); // modify table per page dropdown
101 |
102 |
103 |
104 | });
--------------------------------------------------------------------------------
/static/js/easy-pie-chart.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function() {
2 |
3 | // easy pie chart
4 | $('.percentage').easyPieChart({
5 | animate: 1000,
6 | size: 135,
7 | barColor:'#FF2D55'
8 | });
9 | $('.percentage-light').easyPieChart({
10 | barColor: function(percent) {
11 | percent /= 100;
12 | return "rgb(" + Math.round(255 * (1-percent)) + ", " + Math.round(255 * percent) + ", 0)";
13 | },
14 | trackColor: '#666',
15 | scaleColor: false,
16 | lineCap: 'butt',
17 | lineWidth: 15,
18 | animate: 1000
19 | });
20 |
21 | $('.update-easy-pie-chart').click(function(){
22 | $('.easy-pie-chart .percentage').each(function() {
23 | var newValue = Math.floor(100*Math.random());
24 | $(this).data('easyPieChart').update(newValue);
25 | $('span', this).text(newValue);
26 | });
27 | });
28 |
29 | $('.updateEasyPieChart').on('click', function(e) {
30 | e.preventDefault();
31 | $('.percentage, .percentage-light').each(function() {
32 | var newValue = Math.round(100*Math.random());
33 | $(this).data('easyPieChart').update(newValue);
34 | $('span', this).text(newValue);
35 | });
36 | });
37 |
38 | });
--------------------------------------------------------------------------------
/static/js/form-validation-script.js:
--------------------------------------------------------------------------------
1 | var Script = function () {
2 |
3 | $.validator.setDefaults({
4 | submitHandler: function() { alert("submitted!"); }
5 | });
6 |
7 | $().ready(function() {
8 | // validate the comment form when it is submitted
9 | $("#feedback_form").validate();
10 |
11 | // validate signup form on keyup and submit
12 | $("#register_form").validate({
13 | rules: {
14 | fullname: {
15 | required: true,
16 | minlength: 6
17 | },
18 | address: {
19 | required: true,
20 | minlength: 10
21 | },
22 | username: {
23 | required: true,
24 | minlength: 5
25 | },
26 | password: {
27 | required: true,
28 | minlength: 5
29 | },
30 | confirm_password: {
31 | required: true,
32 | minlength: 5,
33 | equalTo: "#password"
34 | },
35 | email: {
36 | required: true,
37 | email: true
38 | },
39 | topic: {
40 | required: "#newsletter:checked",
41 | minlength: 2
42 | },
43 | agree: "required"
44 | },
45 | messages: {
46 | fullname: {
47 | required: "Please enter a Full Name.",
48 | minlength: "Your Full Name must consist of at least 6 characters long."
49 | },
50 | address: {
51 | required: "Please enter a Address.",
52 | minlength: "Your Address must consist of at least 10 characters long."
53 | },
54 | username: {
55 | required: "Please enter a Username.",
56 | minlength: "Your username must consist of at least 5 characters long."
57 | },
58 | password: {
59 | required: "Please provide a password.",
60 | minlength: "Your password must be at least 5 characters long."
61 | },
62 | confirm_password: {
63 | required: "Please provide a password.",
64 | minlength: "Your password must be at least 5 characters long.",
65 | equalTo: "Please enter the same password as above."
66 | },
67 | email: "Please enter a valid email address.",
68 | agree: "Please accept our terms & condition."
69 | }
70 | });
71 |
72 | // propose username by combining first- and lastname
73 | $("#username").focus(function() {
74 | var firstname = $("#firstname").val();
75 | var lastname = $("#lastname").val();
76 | if(firstname && lastname && !this.value) {
77 | this.value = firstname + "." + lastname;
78 | }
79 | });
80 |
81 | //code to hide topic selection, disable for demo
82 | var newsletter = $("#newsletter");
83 | // newsletter topics are optional, hide at first
84 | var inital = newsletter.is(":checked");
85 | var topics = $("#newsletter_topics")[inital ? "removeClass" : "addClass"]("gray");
86 | var topicInputs = topics.find("input").attr("disabled", !inital);
87 | // show when newsletter is checked
88 | newsletter.click(function() {
89 | topics[this.checked ? "removeClass" : "addClass"]("gray");
90 | topicInputs.attr("disabled", !this.checked);
91 | });
92 | });
93 |
94 |
95 | }();
--------------------------------------------------------------------------------
/static/js/gdp-data.js:
--------------------------------------------------------------------------------
1 | var gdpData = {
2 | "AF": 16.63,
3 | "AL": 11.58,
4 | "DZ": 158.97,
5 | "AO": 85.81,
6 | "AG": 1.1,
7 | "AR": 351.02,
8 | "AM": 8.83,
9 | "AU": 1219.72,
10 | "AT": 366.26,
11 | "AZ": 52.17,
12 | "BS": 7.54,
13 | "BH": 21.73,
14 | "BD": 105.4,
15 | "BB": 3.96,
16 | "BY": 52.89,
17 | "BE": 461.33,
18 | "BZ": 1.43,
19 | "BJ": 6.49,
20 | "BT": 1.4,
21 | "BO": 19.18,
22 | "BA": 16.2,
23 | "BW": 12.5,
24 | "BR": 2023.53,
25 | "BN": 11.96,
26 | "BG": 44.84,
27 | "BF": 8.67,
28 | "BI": 1.47,
29 | "KH": 11.36,
30 | "CM": 21.88,
31 | "CA": 1563.66,
32 | "CV": 1.57,
33 | "CF": 2.11,
34 | "TD": 7.59,
35 | "CL": 199.18,
36 | "CN": 5745.13,
37 | "CO": 283.11,
38 | "KM": 0.56,
39 | "CD": 12.6,
40 | "CG": 11.88,
41 | "CR": 35.02,
42 | "CI": 22.38,
43 | "HR": 59.92,
44 | "CY": 22.75,
45 | "CZ": 195.23,
46 | "DK": 304.56,
47 | "DJ": 1.14,
48 | "DM": 0.38,
49 | "DO": 50.87,
50 | "EC": 61.49,
51 | "EG": 216.83,
52 | "SV": 21.8,
53 | "GQ": 14.55,
54 | "ER": 2.25,
55 | "EE": 19.22,
56 | "ET": 30.94,
57 | "FJ": 3.15,
58 | "FI": 231.98,
59 | "FR": 2555.44,
60 | "GA": 12.56,
61 | "GM": 1.04,
62 | "GE": 11.23,
63 | "DE": 3305.9,
64 | "GH": 18.06,
65 | "GR": 305.01,
66 | "GD": 0.65,
67 | "GT": 40.77,
68 | "GN": 4.34,
69 | "GW": 0.83,
70 | "GY": 2.2,
71 | "HT": 6.5,
72 | "HN": 15.34,
73 | "HK": 226.49,
74 | "HU": 132.28,
75 | "IS": 12.77,
76 | "IN": 1430.02,
77 | "ID": 695.06,
78 | "IR": 337.9,
79 | "IQ": 84.14,
80 | "IE": 204.14,
81 | "IL": 201.25,
82 | "IT": 2036.69,
83 | "JM": 13.74,
84 | "JP": 5390.9,
85 | "JO": 27.13,
86 | "KZ": 129.76,
87 | "KE": 32.42,
88 | "KI": 0.15,
89 | "KR": 986.26,
90 | "UNDEFINED": 5.73,
91 | "KW": 117.32,
92 | "KG": 4.44,
93 | "LA": 6.34,
94 | "LV": 23.39,
95 | "LB": 39.15,
96 | "LS": 1.8,
97 | "LR": 0.98,
98 | "LY": 77.91,
99 | "LT": 35.73,
100 | "LU": 52.43,
101 | "MK": 9.58,
102 | "MG": 8.33,
103 | "MW": 5.04,
104 | "MY": 218.95,
105 | "MV": 1.43,
106 | "ML": 9.08,
107 | "MT": 7.8,
108 | "MR": 3.49,
109 | "MU": 9.43,
110 | "MX": 1004.04,
111 | "MD": 5.36,
112 | "MN": 5.81,
113 | "ME": 3.88,
114 | "MA": 91.7,
115 | "MZ": 10.21,
116 | "MM": 35.65,
117 | "NA": 11.45,
118 | "NP": 15.11,
119 | "NL": 770.31,
120 | "NZ": 138,
121 | "NI": 6.38,
122 | "NE": 5.6,
123 | "NG": 206.66,
124 | "NO": 413.51,
125 | "OM": 53.78,
126 | "PK": 174.79,
127 | "PA": 27.2,
128 | "PG": 8.81,
129 | "PY": 17.17,
130 | "PE": 153.55,
131 | "PH": 189.06,
132 | "PL": 438.88,
133 | "PT": 223.7,
134 | "QA": 126.52,
135 | "RO": 158.39,
136 | "RU": 1476.91,
137 | "RW": 5.69,
138 | "WS": 0.55,
139 | "ST": 0.19,
140 | "SA": 434.44,
141 | "SN": 12.66,
142 | "RS": 38.92,
143 | "SC": 0.92,
144 | "SL": 1.9,
145 | "SG": 217.38,
146 | "SK": 86.26,
147 | "SI": 46.44,
148 | "SB": 0.67,
149 | "ZA": 354.41,
150 | "ES": 1374.78,
151 | "LK": 48.24,
152 | "KN": 0.56,
153 | "LC": 1,
154 | "VC": 0.58,
155 | "SD": 65.93,
156 | "SR": 3.3,
157 | "SZ": 3.17,
158 | "SE": 444.59,
159 | "CH": 522.44,
160 | "SY": 59.63,
161 | "TW": 426.98,
162 | "TJ": 5.58,
163 | "TZ": 22.43,
164 | "TH": 312.61,
165 | "TL": 0.62,
166 | "TG": 3.07,
167 | "TO": 0.3,
168 | "TT": 21.2,
169 | "TN": 43.86,
170 | "TR": 729.05,
171 | "TM": 0,
172 | "UG": 17.12,
173 | "UA": 136.56,
174 | "AE": 239.65,
175 | "GB": 2258.57,
176 | "US": 14624.18,
177 | "UY": 40.71,
178 | "UZ": 37.72,
179 | "VU": 0.72,
180 | "VE": 285.21,
181 | "VN": 101.99,
182 | "YE": 30.02,
183 | "ZM": 15.69,
184 | "ZW": 5.57
185 | };
--------------------------------------------------------------------------------
/static/js/gritter.js:
--------------------------------------------------------------------------------
1 | var Gritter = function () {
2 |
3 | $('#add-sticky').click(function(){
4 |
5 | var unique_id = $.gritter.add({
6 | // (string | mandatory) the heading of the notification
7 | title: 'This is a sticky notice!',
8 | // (string | mandatory) the text inside the notification
9 | text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.',
10 | // (string | optional) the image to display on the left
11 | image: 'img/avatar-mini.jpg',
12 | // (bool | optional) if you want it to fade out on its own or just sit there
13 | sticky: true,
14 | // (int | optional) the time you want it to be alive for before fading out
15 | time: '',
16 | // (string | optional) the class name you want to apply to that specific message
17 | class_name: 'my-sticky-class'
18 | });
19 |
20 | // You can have it return a unique id, this can be used to manually remove it later using
21 | /*
22 | setTimeout(function(){
23 |
24 | $.gritter.remove(unique_id, {
25 | fade: true,
26 | speed: 'slow'
27 | });
28 |
29 | }, 6000)
30 | */
31 |
32 | return false;
33 |
34 | });
35 |
36 | $('#add-regular').click(function(){
37 |
38 | $.gritter.add({
39 | // (string | mandatory) the heading of the notification
40 | title: 'This is a regular notice!',
41 | // (string | mandatory) the text inside the notification
42 | text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.',
43 | // (string | optional) the image to display on the left
44 | image: 'img/avatar-mini.jpg',
45 | // (bool | optional) if you want it to fade out on its own or just sit there
46 | sticky: false,
47 | // (int | optional) the time you want it to be alive for before fading out
48 | time: ''
49 | });
50 |
51 | return false;
52 |
53 | });
54 |
55 | $('#add-max').click(function(){
56 |
57 | $.gritter.add({
58 | // (string | mandatory) the heading of the notification
59 | title: 'This is a notice with a max of 3 on screen at one time!',
60 | // (string | mandatory) the text inside the notification
61 | text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.',
62 | // (string | optional) the image to display on the left
63 | image: 'img/avatar-mini.jpg',
64 | // (bool | optional) if you want it to fade out on its own or just sit there
65 | sticky: false,
66 | // (function) before the gritter notice is opened
67 | before_open: function(){
68 | if($('.gritter-item-wrapper').length == 3)
69 | {
70 | // Returning false prevents a new gritter from opening
71 | return false;
72 | }
73 | }
74 | });
75 |
76 | return false;
77 |
78 | });
79 |
80 | $('#add-without-image').click(function(){
81 |
82 | $.gritter.add({
83 | // (string | mandatory) the heading of the notification
84 | title: 'This is a notice without an image!',
85 | // (string | mandatory) the text inside the notification
86 | text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.'
87 | });
88 |
89 | return false;
90 | });
91 |
92 | $('#add-gritter-light').click(function(){
93 |
94 | $.gritter.add({
95 | // (string | mandatory) the heading of the notification
96 | title: 'This is a light notification',
97 | // (string | mandatory) the text inside the notification
98 | text: 'Just add a "gritter-light" class_name to your $.gritter.add or globally to $.gritter.options.class_name',
99 | class_name: 'gritter-light'
100 | });
101 |
102 | return false;
103 | });
104 |
105 | $("#remove-all").click(function(){
106 |
107 | $.gritter.removeAll();
108 | return false;
109 |
110 | });
111 |
112 |
113 |
114 | }();
--------------------------------------------------------------------------------
/static/js/html5shiv.js:
--------------------------------------------------------------------------------
1 | /*
2 | HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3 | */
4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x";
6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML=" ";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
8 | for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d ',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o=window.getComputedStyle?window.getComputedStyle(u,null):!1;o?(t=u.getBoundingClientRect().width,(0===t||"number"!=typeof t)&&(t=parseInt(o.width,10)),e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){t-=parseInt(o[i],10)})):t=p.width(),s.style.width=Math.max(t,0)+"px"}function a(){var a={};if(t=u,s.className=i.className,s.id=i.id,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a).attr("wrap",p.attr("wrap")),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?a():o(),s.value=!u.value&&i.placeholder?(p.attr("placeholder")||"")+i.append:u.value+i.append,s.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width(),y=p.css("resize");p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word"}),"vertical"===y?p.css("resize","none"):"both"===y&&p.css("resize","horizontal"),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$);
--------------------------------------------------------------------------------
/static/js/jquery.customSelect.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jquery.customSelect() - v0.4.1
3 | * http://adam.co/lab/jquery/customselect/
4 | * 2013-05-13
5 | *
6 | * Copyright 2013 Adam Coulombe
7 | * @license http://www.opensource.org/licenses/mit-license.html MIT License
8 | * @license http://www.gnu.org/licenses/gpl.html GPL2 License
9 | */
10 | (function(a){a.fn.extend({customSelect:function(c){if(typeof document.body.style.maxHeight==="undefined"){return this}var e={customClass:"customSelect",mapClass:true,mapStyle:true},c=a.extend(e,c),d=c.customClass,f=function(h,k){var g=h.find(":selected"),j=k.children(":first"),i=g.html()||" ";j.html(i);if(g.attr("disabled")){k.addClass(b("DisabledOption"))}else{k.removeClass(b("DisabledOption"))}setTimeout(function(){k.removeClass(b("Open"));a(document).off("mouseup."+b("Open"))},60)},b=function(g){return d+g};return this.each(function(){var g=a(this),i=a(" ").addClass(b("Inner")),h=a(" ");g.after(h.append(i));h.addClass(d);if(c.mapClass){h.addClass(g.attr("class"))}if(c.mapStyle){h.attr("style",g.attr("style"))}g.addClass("hasCustomSelect").on("update",function(){f(g,h);var k=parseInt(g.outerWidth(),10)-(parseInt(h.outerWidth(),10)-parseInt(h.width(),10));h.css({display:"inline-block"});var j=h.outerHeight();if(g.attr("disabled")){h.addClass(b("Disabled"))}else{h.removeClass(b("Disabled"))}i.css({width:k,display:"inline-block"});g.css({"-webkit-appearance":"menulist-button",width:h.outerWidth(),position:"absolute",opacity:0,height:j,fontSize:h.css("font-size")})}).on("change",function(){h.addClass(b("Changed"));f(g,h)}).on("keyup",function(j){if(!h.hasClass(b("Open"))){g.blur();g.focus()}else{if(j.which==13||j.which==27){f(g,h)}}}).on("mousedown",function(j){h.removeClass(b("Changed"))}).on("mouseup",function(j){if(!h.hasClass(b("Open"))){if(a("."+b("Open")).not(h).length>0&&typeof InstallTrigger!=="undefined"){g.focus()}else{h.addClass(b("Open"));j.stopPropagation();a(document).one("mouseup."+b("Open"),function(k){if(k.target!=g.get(0)&&a.inArray(k.target,g.find("*").get())<0){g.blur()}else{f(g,h)}})}}}).focus(function(){h.removeClass(b("Changed")).addClass(b("Focus"))}).blur(function(){h.removeClass(b("Focus")+" "+b("Open"))}).hover(function(){h.addClass(b("Hover"))},function(){h.removeClass(b("Hover"))}).trigger("update")})}})})(jQuery);
--------------------------------------------------------------------------------
/static/js/jquery.hotkeys.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery Hotkeys Plugin
3 | * Copyright 2010, John Resig
4 | * Dual licensed under the MIT or GPL Version 2 licenses.
5 | *
6 | * Based upon the plugin by Tzury Bar Yochay:
7 | * http://github.com/tzuryby/hotkeys
8 | *
9 | * Original idea by:
10 | * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
11 | */
12 |
13 | (function(jQuery){
14 |
15 | jQuery.hotkeys = {
16 | version: "0.8",
17 |
18 | specialKeys: {
19 | 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
20 | 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
21 | 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
22 | 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
23 | 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
24 | 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
25 | 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
26 | },
27 |
28 | shiftNums: {
29 | "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
30 | "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
31 | ".": ">", "/": "?", "\\": "|"
32 | }
33 | };
34 |
35 | function keyHandler( handleObj ) {
36 | // Only care when a possible input has been specified
37 | if ( typeof handleObj.data !== "string" ) {
38 | return;
39 | }
40 |
41 | var origHandler = handleObj.handler,
42 | keys = handleObj.data.toLowerCase().split(" "),
43 | textAcceptingInputTypes = ["text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime", "datetime-local", "search", "color"];
44 |
45 | handleObj.handler = function( event ) {
46 | // Don't fire in text-accepting inputs that we didn't directly bind to
47 | if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
48 | jQuery.inArray(event.target.type, textAcceptingInputTypes) > -1 ) ) {
49 | return;
50 | }
51 |
52 | // Keypress represents characters, not special keys
53 | var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
54 | character = String.fromCharCode( event.which ).toLowerCase(),
55 | key, modif = "", possible = {};
56 |
57 | // check combinations (alt|ctrl|shift+anything)
58 | if ( event.altKey && special !== "alt" ) {
59 | modif += "alt+";
60 | }
61 |
62 | if ( event.ctrlKey && special !== "ctrl" ) {
63 | modif += "ctrl+";
64 | }
65 |
66 | // TODO: Need to make sure this works consistently across platforms
67 | if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
68 | modif += "meta+";
69 | }
70 |
71 | if ( event.shiftKey && special !== "shift" ) {
72 | modif += "shift+";
73 | }
74 |
75 | if ( special ) {
76 | possible[ modif + special ] = true;
77 |
78 | } else {
79 | possible[ modif + character ] = true;
80 | possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
81 |
82 | // "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
83 | if ( modif === "shift+" ) {
84 | possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
85 | }
86 | }
87 |
88 | for ( var i = 0, l = keys.length; i < l; i++ ) {
89 | if ( possible[ keys[i] ] ) {
90 | return origHandler.apply( this, arguments );
91 | }
92 | }
93 | };
94 | }
95 |
96 | jQuery.each([ "keydown", "keyup", "keypress" ], function() {
97 | jQuery.event.special[ this ] = { add: keyHandler };
98 | });
99 |
100 | })( jQuery );
--------------------------------------------------------------------------------
/static/js/jquery.localscroll.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
3 | * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
4 | * Dual licensed under MIT and GPL.
5 | * Date: 3/11/2009
6 | * @author Ariel Flesler
7 | * @version 1.2.7
8 | **/
9 | ;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$(' ').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);
--------------------------------------------------------------------------------
/static/js/jquery.placeholder.min.js:
--------------------------------------------------------------------------------
1 | /*! http://mths.be/placeholder v2.0.8 by @mathias */(function(e,t,n){function c(e){var t={},r=/^jQuery\d+$/;n.each(e.attributes,function(e,n){n.specified&&!r.test(n.name)&&(t[n.name]=n.value)});return t}function h(e,t){var r=this,i=n(r);if(r.value==i.attr("placeholder")&&i.hasClass("placeholder"))if(i.data("placeholder-password")){i=i.hide().next().show().attr("id",i.removeAttr("id").data("placeholder-id"));if(e===!0)return i[0].value=t;i.focus()}else{r.value="";i.removeClass("placeholder");r==d()&&r.select()}}function p(){var e,t=this,r=n(t),i=this.id;if(t.value==""){if(t.type=="password"){if(!r.data("placeholder-textinput")){try{e=r.clone().attr({type:"text"})}catch(s){e=n(" ").attr(n.extend(c(this),{type:"text"}))}e.removeAttr("name").data({"placeholder-password":r,"placeholder-id":i}).bind("focus.placeholder",h);r.data({"placeholder-textinput":e,"placeholder-id":i}).before(e)}r=r.removeAttr("id").hide().prev().attr("id",i).show()}r.addClass("placeholder");r[0].value=r.attr("placeholder")}else r.removeClass("placeholder")}function d(){try{return t.activeElement}catch(e){}}var r=Object.prototype.toString.call(e.operamini)=="[object OperaMini]",i="placeholder"in t.createElement("input")&&!r,s="placeholder"in t.createElement("textarea")&&!r,o=n.fn,u=n.valHooks,a=n.propHooks,f,l;if(i&&s){l=o.placeholder=function(){return this};l.input=l.textarea=!0}else{l=o.placeholder=function(){var e=this;e.filter((i?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":h,"blur.placeholder":p}).data("placeholder-enabled",!0).trigger("blur.placeholder");return e};l.input=i;l.textarea=s;f={get:function(e){var t=n(e),r=t.data("placeholder-password");return r?r[0].value:t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":e.value},set:function(e,t){var r=n(e),i=r.data("placeholder-password");if(i)return i[0].value=t;if(!r.data("placeholder-enabled"))return e.value=t;if(t==""){e.value=t;e!=d()&&p.call(e)}else r.hasClass("placeholder")?h.call(e,!0,t)||(e.value=t):e.value=t;return r}};if(!i){u.input=f;a.value=f}if(!s){u.textarea=f;a.value=f}n(function(){n(t).delegate("form","submit.placeholder",function(){var e=n(".placeholder",this).each(h);setTimeout(function(){e.each(p)},10)})});n(e).bind("beforeunload.placeholder",function(){n(".placeholder").each(function(){this.value=""})})}})(this,document,jQuery);
--------------------------------------------------------------------------------
/static/js/jquery.rateit.min.js:
--------------------------------------------------------------------------------
1 | (function(n){function t(n){var u=n.originalEvent.changedTouches,t=u[0],i="",r;switch(n.type){case"touchmove":i="mousemove";break;case"touchend":i="mouseup";break;default:return}r=document.createEvent("MouseEvent"),r.initMouseEvent(i,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(r),n.preventDefault()}n.fn.rateit=function(i,r){var u={},e="init",o=function(n){return n.charAt(0).toUpperCase()+n.substr(1)},f;if(this.length==0)return this;if(f=n.type(i),f=="object"||i===undefined||i==null)u=n.extend({},n.fn.rateit.defaults,i);else{if(f=="string"&&r===undefined)return this.data("rateit"+o(i));f=="string"&&(e="setvalue")}return this.each(function(){var h=n(this),f=function(n){return arguments[0]="rateit"+o(n),h.data.apply(h,arguments)},a,s,c,v,y,l,p;if(h.hasClass("rateit")||h.addClass("rateit"),a=h.css("direction")!="rtl",e=="setvalue"){if(!f("init"))throw"Can't set value before init";i!="readonly"||f("readonly")||(h.find(".rateit-range").unbind(),f("wired",!1)),i=="value"&&r==null&&(r=f("min")),f("backingfld")&&(s=n(f("backingfld")),i=="value"&&s.val(r),i=="min"&&s[0].min&&(s[0].min=r),i=="max"&&s[0].max&&(s[0].max=r),i=="step"&&s[0].step&&(s[0].step=r)),f(i,r)}f("init")||(f("min",f("min")||u.min),f("max",f("max")||u.max),f("step",f("step")||u.step),f("readonly",f("readonly")!==undefined?f("readonly"):u.readonly),f("resetable",f("resetable")!==undefined?f("resetable"):u.resetable),f("backingfld",f("backingfld")||u.backingfld),f("starwidth",f("starwidth")||u.starwidth),f("starheight",f("starheight")||u.starheight),f("value",f("value")||u.value||u.min),f("ispreset",f("ispreset")!==undefined?f("ispreset"):u.ispreset),f("backingfld")&&(s=n(f("backingfld")),f("value",s.hide().val()),(s.attr("disabled")||s.attr("readonly"))&&f("readonly",!0),s[0].nodeName=="INPUT"&&(s[0].type=="range"||s[0].type=="text")&&(f("min",parseInt(s.attr("min"))||f("min")),f("max",parseInt(s.attr("max"))||f("max")),f("step",parseInt(s.attr("step"))||f("step"))),s[0].nodeName=="SELECT"&&s[0].options.length>1&&(f("min",Number(s[0].options[0].value)),f("max",Number(s[0].options[s[0].length-1].value)),f("step",Number(s[0].options[1].value)-Number(s[0].options[0].value)))),h.append('<\/div>
<\/div>
<\/div><\/div>'),a||(h.find(".rateit-reset").css("float","right"),h.find(".rateit-selected").addClass("rateit-selected-rtl"),h.find(".rateit-hover").addClass("rateit-hover-rtl")),f("init",!0)),c=h.find(".rateit-range"),c.width(f("starwidth")*(f("max")-f("min"))).height(f("starheight")),v="rateit-preset"+(a?"":"-rtl"),f("ispreset")?h.find(".rateit-selected").addClass(v):h.find(".rateit-selected").removeClass(v),f("value")!=null&&(y=(f("value")-f("min"))*f("starwidth"),h.find(".rateit-selected").width(y)),l=h.find(".rateit-reset"),l.data("wired")!==!0&&l.click(function(){f("value",f("min")),c.find(".rateit-hover").hide().width(0),c.find(".rateit-selected").width(0).show(),f("backingfld")&&n(f("backingfld")).val(f("min")),h.trigger("reset")}).data("wired",!0),p=function(t,i){var u=i.changedTouches?i.changedTouches[0].pageX:i.pageX,r=u-n(t).offset().left;return a||(r=c.width()-r),r>c.width()&&(r=c.width()),r<0&&(r=0),y=Math.ceil(r/f("starwidth")*(1/f("step")))},f("readonly")?l.hide():(f("resetable")||l.hide(),f("wired")||(c.bind("touchmove touchend",t),c.mousemove(function(n){var i=p(this,n),t=i*f("starwidth")*f("step"),r=c.find(".rateit-hover"),u;r.data("width")!=t&&(c.find(".rateit-selected").hide(),r.width(t).show().data("width",t),u=[i*f("step")+f("min")],h.trigger("hover",u).trigger("over",u))}),c.mouseleave(function(){c.find(".rateit-hover").hide().width(0).data("width",""),h.trigger("hover",[null]).trigger("over",[null]),c.find(".rateit-selected").show()}),c.mouseup(function(t){var r=p(this,t),i=r*f("step")+f("min");f("value",i),f("backingfld")&&n(f("backingfld")).val(i),f("ispreset")&&(c.find(".rateit-selected").removeClass(v),f("ispreset",!1)),c.find(".rateit-hover").hide(),c.find(".rateit-selected").width(r*f("starwidth")*f("step")).show(),h.trigger("hover",[null]).trigger("over",[null]).trigger("rated",[i])}),f("wired",!0)),f("resetable")&&l.show())})},n.fn.rateit.defaults={min:0,max:5,step:.5,starwidth:16,starheight:16,readonly:!1,resetable:!0,ispreset:!1},n(function(){n("div.rateit").rateit()})})(jQuery)
--------------------------------------------------------------------------------
/static/js/jquery.scrollTo.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2007-2013 Ariel Flesler - aflesler
gmailcom | http://flesler.blogspot.com
3 | * Dual licensed under MIT and GPL.
4 | * @author Ariel Flesler
5 | * @version 1.4.6
6 | */
7 | ;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,targ,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
8 |
--------------------------------------------------------------------------------
/static/js/jquery.slimscroll.min.js:
--------------------------------------------------------------------------------
1 | /*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
4 | *
5 | * Version: 1.3.0
6 | *
7 | */
8 | (function(f){jQuery.fn.extend({slimScroll:function(h){var a=f.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:0.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"0px",railBorderRadius:"0px"},h);this.each(function(){function r(d){if(s){d=d||
9 | window.event;var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);f(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,f,h){k=!1;var e=d,g=b.outerHeight()-c.outerHeight();f&&(e=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),e=Math.min(Math.max(e,0),g),e=0=b.outerHeight()?k=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&g.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(A=setTimeout(function(){a.disableFadeOut&&s||(x||y)||(c.fadeOut("slow"),g.fadeOut("slow"))},1E3))}var s,x,y,A,z,u,l,B,D=30,k=!1,b=f(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(),
12 | c=b.parent().find("."+a.barClass),g=b.parent().find("."+a.railClass);w();if(f.isPlainObject(h)){if("height"in h&&"auto"==h.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height",q);b.css("height",q)}if("scrollTo"in h)n=parseInt(a.scrollTo);else if("scrollBy"in h)n+=parseInt(a.scrollBy);else if("destroy"in h){c.remove();g.remove();b.unwrap();return}m(n,!1,!0)}}else{a.height="auto"==a.height?b.parent().height():a.height;n=f("
").addClass(a.wrapperClass).css({position:"relative",
13 | overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var g=f("
").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=f("
").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?
14 | "block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position?{right:a.distance}:{left:a.distance};g.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(g);a.railDraggable&&c.bind("mousedown",function(a){var b=f(document);y=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)});
15 | b.bind("mouseup.slimscroll",function(a){y=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1});g.hover(function(){v()},function(){p()});c.hover(function(){x=!0},function(){x=!1});b.hover(function(){s=!0;v();p()},function(){s=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(z=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&
16 | (m((z-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),z=b.originalEvent.touches[0].pageY)});w();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),m(0,!0)):"top"!==a.start&&(m(f(a.start).position().top,null,!0),a.alwaysVisible||c.hide());C()}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);
--------------------------------------------------------------------------------
/static/js/morris-script 2.js:
--------------------------------------------------------------------------------
1 | var Script = function () {
2 |
3 | //morris chart
4 |
5 | // Morris Line
6 | $(function () {
7 | // data from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type
8 | var tax_data = [
9 | {"period": "2011 Q3", "licensed": 3407, "sorned": 660},
10 | {"period": "2011 Q2", "licensed": 3351, "sorned": 629},
11 | {"period": "2011 Q1", "licensed": 3269, "sorned": 618},
12 | {"period": "2010 Q4", "licensed": 3246, "sorned": 661},
13 | {"period": "2009 Q4", "licensed": 3171, "sorned": 676},
14 | {"period": "2008 Q4", "licensed": 3155, "sorned": 681},
15 | {"period": "2007 Q4", "licensed": 3226, "sorned": 620},
16 | {"period": "2006 Q4", "licensed": 3245, "sorned": null},
17 | {"period": "2005 Q4", "licensed": 3289, "sorned": null}
18 | ];
19 | Morris.Line({
20 | element: 'hero-graph',
21 | data: tax_data,
22 | xkey: 'period',
23 | ykeys: ['licensed', 'sorned'],
24 | labels: ['Licensed', 'Off the road'],
25 | lineColors:['#007AFF','#34aadc']
26 | });
27 |
28 | // Donut chart
29 | Morris.Donut({
30 | element: 'hero-donut',
31 | data: [
32 | {label: 'Internet Explorer', value: 12.1 },
33 | {label: 'Firefox', value: 27.8 },
34 | {label: 'Chrome', value: 52.3 },
35 | {label: 'Safari', value: 3.9 },
36 | {label: 'Opera', value: 1.7 }
37 | ],
38 | colors: ['#FFCC00', '#4CD964', '#007AFF','#fc3e39','#34AADC'],
39 | formatter: function (y) { return y + "%" }
40 | });
41 |
42 | Morris.Area({
43 | element: 'hero-area',
44 | data: [
45 | {period: '2010 Q1', iphone: 2666, ipad: null, itouch: 2647},
46 | {period: '2010 Q2', iphone: 2778, ipad: 2294, itouch: 2441},
47 | {period: '2010 Q3', iphone: 4912, ipad: 1969, itouch: 2501},
48 | {period: '2010 Q4', iphone: 3767, ipad: 3597, itouch: 5689},
49 | {period: '2011 Q1', iphone: 6810, ipad: 1914, itouch: 2293},
50 | {period: '2011 Q2', iphone: 5670, ipad: 4293, itouch: 1881},
51 | {period: '2011 Q3', iphone: 4820, ipad: 3795, itouch: 1588},
52 | {period: '2011 Q4', iphone: 15073, ipad: 5967, itouch: 5175},
53 | {period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028},
54 | {period: '2012 Q2', iphone: 8432, ipad: 5713, itouch: 1791}
55 | ],
56 |
57 | xkey: 'period',
58 | ykeys: ['iphone', 'ipad', 'itouch'],
59 | labels: ['iPhone', 'iPad', 'iPod Touch'],
60 | hideHover: 'auto',
61 | lineWidth: 1,
62 | pointSize: 5,
63 | lineColors: ['#4CD964', '#007AFF', '#FFCC00'],
64 | fillOpacity: 0.5,
65 | smooth: true
66 | });
67 |
68 | Morris.Bar({
69 | element: 'hero-bar',
70 | data: [
71 | {device: 'iPhone', geekbench: 136},
72 | {device: 'iPhone 3G', geekbench: 137},
73 | {device: 'iPhone 3GS', geekbench: 275},
74 | {device: 'iPhone 4', geekbench: 380},
75 | {device: 'iPhone 4S', geekbench: 655},
76 | {device: 'iPhone 5', geekbench: 1571}
77 | ],
78 | xkey: 'device',
79 | ykeys: ['geekbench'],
80 | labels: ['Geekbench'],
81 | barRatio: 0.4,
82 | xLabelAngle: 35,
83 | hideHover: 'auto',
84 | barColors: ['#007AFF']
85 | });
86 |
87 | new Morris.Line({
88 | element: 'examplefirst',
89 | xkey: 'year',
90 | ykeys: ['value'],
91 | labels: ['Value'],
92 | data: [
93 | {year: '2008', value: 20},
94 | {year: '2009', value: 10},
95 | {year: '2010', value: 5},
96 | {year: '2011', value: 5},
97 | {year: '2012', value: 20}
98 | ]
99 | });
100 |
101 | $('.code-example').each(function (index, el) {
102 | eval($(el).text());
103 | });
104 | });
105 |
106 | }();
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/static/js/morris-script.js:
--------------------------------------------------------------------------------
1 | var Script = function () {
2 |
3 | //morris chart
4 |
5 | // Morris Line
6 | $(function () {
7 | // data from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type
8 | var tax_data = [
9 | {"period": "2011 Q3", "licensed": 3407, "sorned": 660},
10 | {"period": "2011 Q2", "licensed": 3351, "sorned": 629},
11 | {"period": "2011 Q1", "licensed": 3269, "sorned": 618},
12 | {"period": "2010 Q4", "licensed": 3246, "sorned": 661},
13 | {"period": "2009 Q4", "licensed": 3171, "sorned": 676},
14 | {"period": "2008 Q4", "licensed": 3155, "sorned": 681},
15 | {"period": "2007 Q4", "licensed": 3226, "sorned": 620},
16 | {"period": "2006 Q4", "licensed": 3245, "sorned": null},
17 | {"period": "2005 Q4", "licensed": 3289, "sorned": null}
18 | ];
19 | Morris.Line({
20 | element: 'hero-graph',
21 | data: tax_data,
22 | xkey: 'period',
23 | ykeys: ['licensed', 'sorned'],
24 | labels: ['Licensed', 'Off the road'],
25 | lineColors:['#007AFF','#34aadc']
26 | });
27 |
28 | // Donut chart
29 | Morris.Donut({
30 | element: 'hero-donut',
31 | data: [
32 | {label: 'Internet Explorer', value: 12.1 },
33 | {label: 'Firefox', value: 27.8 },
34 | {label: 'Chrome', value: 52.3 },
35 | {label: 'Safari', value: 3.9 },
36 | {label: 'Opera', value: 1.7 }
37 | ],
38 | colors: ['#FFCC00', '#4CD964', '#007AFF','#fc3e39','#34AADC'],
39 | formatter: function (y) { return y + "%" }
40 | });
41 |
42 | Morris.Area({
43 | element: 'hero-area',
44 | data: [
45 | {period: '2010 Q1', iphone: 2666, ipad: null, itouch: 2647},
46 | {period: '2010 Q2', iphone: 2778, ipad: 2294, itouch: 2441},
47 | {period: '2010 Q3', iphone: 4912, ipad: 1969, itouch: 2501},
48 | {period: '2010 Q4', iphone: 3767, ipad: 3597, itouch: 5689},
49 | {period: '2011 Q1', iphone: 6810, ipad: 1914, itouch: 2293},
50 | {period: '2011 Q2', iphone: 5670, ipad: 4293, itouch: 1881},
51 | {period: '2011 Q3', iphone: 4820, ipad: 3795, itouch: 1588},
52 | {period: '2011 Q4', iphone: 15073, ipad: 5967, itouch: 5175},
53 | {period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028},
54 | {period: '2012 Q2', iphone: 8432, ipad: 5713, itouch: 1791}
55 | ],
56 |
57 | xkey: 'period',
58 | ykeys: ['iphone', 'ipad', 'itouch'],
59 | labels: ['iPhone', 'iPad', 'iPod Touch'],
60 | hideHover: 'auto',
61 | lineWidth: 1,
62 | pointSize: 5,
63 | lineColors: ['#4CD964', '#007AFF', '#FFCC00'],
64 | fillOpacity: 0.5,
65 | smooth: true
66 | });
67 |
68 | Morris.Bar({
69 | element: 'hero-bar',
70 | data: [
71 | {device: 'iPhone', geekbench: 136},
72 | {device: 'iPhone 3G', geekbench: 137},
73 | {device: 'iPhone 3GS', geekbench: 275},
74 | {device: 'iPhone 4', geekbench: 380},
75 | {device: 'iPhone 4S', geekbench: 655},
76 | {device: 'iPhone 5', geekbench: 1571}
77 | ],
78 | xkey: 'device',
79 | ykeys: ['geekbench'],
80 | labels: ['Geekbench'],
81 | barRatio: 0.4,
82 | xLabelAngle: 35,
83 | hideHover: 'auto',
84 | barColors: ['#007AFF']
85 | });
86 |
87 | new Morris.Line({
88 | element: 'examplefirst',
89 | xkey: 'year',
90 | ykeys: ['value'],
91 | labels: ['Value'],
92 | data: [
93 | {year: '2008', value: 20},
94 | {year: '2009', value: 10},
95 | {year: '2010', value: 5},
96 | {year: '2011', value: 5},
97 | {year: '2012', value: 20}
98 | ]
99 | });
100 |
101 | $('.code-example').each(function (index, el) {
102 | eval($(el).text());
103 | });
104 | });
105 |
106 | }();
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/static/js/scripts 2.js:
--------------------------------------------------------------------------------
1 | function initializeJS() {
2 |
3 | //tool tips
4 | jQuery('.tooltips').tooltip();
5 |
6 | //popovers
7 | jQuery('.popovers').popover();
8 |
9 | //custom scrollbar
10 | //for html
11 | jQuery("html").niceScroll({styler:"fb",cursorcolor:"#007AFF", cursorwidth: '6', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: '', zindex: '1000'});
12 | //for sidebar
13 | jQuery("#sidebar").niceScroll({styler:"fb",cursorcolor:"#007AFF", cursorwidth: '3', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: ''});
14 | // for scroll panel
15 | jQuery(".scroll-panel").niceScroll({styler:"fb",cursorcolor:"#007AFF", cursorwidth: '3', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: ''});
16 |
17 | //sidebar dropdown menu
18 | jQuery('#sidebar .sub-menu > a').click(function () {
19 | var last = jQuery('.sub-menu.open', jQuery('#sidebar'));
20 | jQuery('.menu-arrow').removeClass('arrow_carrot-right');
21 | jQuery('.sub', last).slideUp(200);
22 | var sub = jQuery(this).next();
23 | if (sub.is(":visible")) {
24 | jQuery('.menu-arrow').addClass('arrow_carrot-right');
25 | sub.slideUp(200);
26 | } else {
27 | jQuery('.menu-arrow').addClass('arrow_carrot-down');
28 | sub.slideDown(200);
29 | }
30 | var o = (jQuery(this).offset());
31 | diff = 200 - o.top;
32 | if(diff>0)
33 | jQuery("#sidebar").scrollTo("-="+Math.abs(diff),500);
34 | else
35 | jQuery("#sidebar").scrollTo("+="+Math.abs(diff),500);
36 | });
37 |
38 | // sidebar menu toggle
39 | jQuery(function() {
40 | function responsiveView() {
41 | var wSize = jQuery(window).width();
42 | if (wSize <= 768) {
43 | jQuery('#container').addClass('sidebar-close');
44 | jQuery('#sidebar > ul').hide();
45 | }
46 |
47 | if (wSize > 768) {
48 | jQuery('#container').removeClass('sidebar-close');
49 | jQuery('#sidebar > ul').show();
50 | }
51 | }
52 | jQuery(window).on('load', responsiveView);
53 | jQuery(window).on('resize', responsiveView);
54 | });
55 |
56 | jQuery('.toggle-nav').click(function () {
57 | if (jQuery('#sidebar > ul').is(":visible") === true) {
58 | jQuery('#main-content').css({
59 | 'margin-left': '0px'
60 | });
61 | jQuery('#sidebar').css({
62 | 'margin-left': '-180px'
63 | });
64 | jQuery('#sidebar > ul').hide();
65 | jQuery("#container").addClass("sidebar-closed");
66 | } else {
67 | jQuery('#main-content').css({
68 | 'margin-left': '180px'
69 | });
70 | jQuery('#sidebar > ul').show();
71 | jQuery('#sidebar').css({
72 | 'margin-left': '0'
73 | });
74 | jQuery("#container").removeClass("sidebar-closed");
75 | }
76 | });
77 |
78 | //bar chart
79 | if (jQuery(".custom-custom-bar-chart")) {
80 | jQuery(".bar").each(function () {
81 | var i = jQuery(this).find(".value").html();
82 | jQuery(this).find(".value").html("");
83 | jQuery(this).find(".value").animate({
84 | height: i
85 | }, 2000)
86 | })
87 | }
88 |
89 | }
90 |
91 | jQuery(document).ready(function(){
92 | initializeJS();
93 | });
--------------------------------------------------------------------------------
/static/js/scripts.js:
--------------------------------------------------------------------------------
1 | function initializeJS() {
2 |
3 | //tool tips
4 | jQuery('.tooltips').tooltip();
5 |
6 | //popovers
7 | jQuery('.popovers').popover();
8 |
9 | //custom scrollbar
10 | //for html
11 | jQuery("html").niceScroll({ styler: "fb", cursorcolor: "#007AFF", cursorwidth: '6', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: '', zindex: '1000' });
12 | //for sidebar
13 | jQuery("#sid ebar").niceScroll({ styler: "fb", cursorcolor: "#007AFF", cursorwidth: '3', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: '' });
14 | // for scroll panel
15 | jQuery(".scroll-panel").niceScroll({ styler: "fb", cursorcolor: "#007AFF", cursorwidth: '3', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: '' });
16 |
17 | //sidebar dropdown menu
18 | jQuery('#sidebar .sub-menu > a').click(function() {
19 | var last = jQuery('.sub-menu.open', jQuery('#sidebar'));
20 | jQuery('.menu-arrow').removeClass('arrow_carrot-right');
21 | jQuery('.sub', last).slideUp(200);
22 | var sub = jQuery(this).next();
23 | if (sub.is(":visible")) {
24 | jQuery('.menu-arrow').addClass('arrow_carrot-right');
25 | sub.slideUp(200);
26 | } else {
27 | jQuery('.menu-arrow').addClass('arrow_carrot-down');
28 | sub.slideDown(200);
29 | }
30 | var o = (jQuery(this).offset());
31 | diff = 200 - o.top;
32 | if (diff > 0)
33 | jQuery("#sidebar").scrollTo("-=" + Math.abs(diff), 500);
34 | else
35 | jQuery("#sidebar").scrollTo("+=" + Math.abs(diff), 500);
36 | });
37 |
38 | // sidebar menu toggle
39 | jQuery(function() {
40 | function responsiveView() {
41 | var wSize = jQuery(window).width();
42 | if (wSize <= 768) {
43 | jQuery('#container').addClass('sidebar-close');
44 | jQuery('#sidebar > ul').hide();
45 | }
46 |
47 | if (wSize > 768) {
48 | jQuery('#container').removeClass('sidebar-close');
49 | jQuery('#sidebar > ul').show();
50 | }
51 | }
52 | jQuery(window).on('load', responsiveView);
53 | jQuery(window).on('resize', responsiveView);
54 | });
55 |
56 | jQuery('.toggle-nav').click(function() {
57 | if (jQuery('#sidebar > ul').is(":visible") === true) {
58 | jQuery('#main-content').css({
59 | 'margin-left': '0px'
60 | });
61 | jQuery('#sidebar').css({
62 | 'margin-left': '-180px'
63 | });
64 | jQuery('#sidebar > ul').hide();
65 | jQuery("#container").addClass("sidebar-closed");
66 | } else {
67 | jQuery('#main-content').css({
68 | 'margin-left': '180px'
69 | });
70 | jQuery('#sidebar > ul').show();
71 | jQuery('#sidebar').css({
72 | 'margin-left': '0'
73 | });
74 | jQuery("#container").removeClass("sidebar-closed");
75 | }
76 | });
77 |
78 | //bar chart
79 | if (jQuery(".custom-custom-bar-chart")) {
80 | jQuery(".bar").each(function() {
81 | var i = jQuery(this).find(".value").html();
82 | jQuery(this).find(".value").html("");
83 | jQuery(this).find(".value").animate({
84 | height: i
85 | }, 2000)
86 | })
87 | }
88 |
89 | }
90 |
91 | jQuery(document).ready(function() {
92 | initializeJS();
93 | });
--------------------------------------------------------------------------------
/static/js/sliders 2.js:
--------------------------------------------------------------------------------
1 | var Sliders = function () {
2 |
3 | // default sliders
4 | $("#default-slider").slider();
5 |
6 | // increment
7 | $("#increment-slider").slider({
8 | value: 10,
9 | min: 0,
10 | max: 100,
11 | step: 10,
12 | slide: function (event, ui) {
13 | $("#increment-slider-amount").text("$" + ui.value);
14 | }
15 | });
16 | $("#increment-slider-amount").text("$" + $("#increment-slider").slider("value"));
17 |
18 | // range slider
19 | $("#slider-range").slider({
20 | range: true,
21 | min: 0,
22 | max: 1000,
23 | values: [100, 400],
24 | slide: function (event, ui) {
25 | $("#slider-range-amount").text("$" + ui.values[0] + " - $" + ui.values[1]);
26 | }
27 | });
28 |
29 | $("#slider-range-amount").text("$" + $("#slider-range").slider("values", 0) + " - $" + $("#slider-range").slider("values", 1));
30 |
31 | //range max
32 | $("#slider-range-max").slider({
33 | range: "max",
34 | min: 1,
35 | max: 100,
36 | value: 15,
37 | slide: function (event, ui) {
38 | $("#slider-range-max-amount").text("$" + ui.value);
39 | }
40 | });
41 |
42 | $("#slider-range-max-amount").text($("#slider-range-max").slider("value"));
43 |
44 | // range min
45 | $("#slider-range-min").slider({
46 | range: "min",
47 | value: 55,
48 | min: 1,
49 | max: 100,
50 | slide: function (event, ui) {
51 | $("#slider-range-min-amount").text("$" + ui.value);
52 | }
53 | });
54 | $("#slider-range-min-amount").text("$" + $("#slider-range-min").slider("value"));
55 |
56 |
57 | // setup graphic EQ
58 | $( "#eq > span" ).each(function() {
59 | var value = parseInt( $( this ).text(), 10 );
60 | $( this ).empty().slider({
61 | value: value,
62 | range: "min",
63 | animate: true,
64 | orientation: "vertical"
65 | });
66 | });
67 |
68 | // bound to select
69 | var select = $( "#bound-to-select" );
70 | var slider = $( "
" ).insertAfter( select ).slider({
71 | min: 1,
72 | max: 10,
73 | range: "min",
74 | value: select[ 0 ].selectedIndex + 1,
75 | slide: function( event, ui ) {
76 | select[ 0 ].selectedIndex = ui.value - 1;
77 | }
78 | });
79 | $( "#bound-to-select" ).change(function() {
80 | slider.slider( "value", this.selectedIndex + 1 );
81 | });
82 |
83 | // vertical slider
84 | $("#slider-vertical").slider({
85 | orientation: "vertical",
86 | range: "min",
87 | min: 0,
88 | max: 100,
89 | value: 40,
90 | slide: function (event, ui) {
91 | $("#slider-vertical-amount").text(ui.value+" cm");
92 | }
93 | });
94 | $("#slider-vertical-amount").text($("#slider-vertical").slider("value")+" cm");
95 |
96 | // vertical range sliders
97 | $("#slider-range-vertical").slider({
98 | orientation: "vertical",
99 | range: true,
100 | min: 0,
101 | max: 1000,
102 | values: [200, 600],
103 | slide: function (event, ui) {
104 | $("#slider-range-vertical-amount").text("$" + ui.values[0] + " - $" + ui.values[1]);
105 | }
106 | });
107 |
108 | $("#slider-range-vertical-amount").text("$" + $("#slider-range-vertical").slider("values", 0) + " - $" + $("#slider-range-vertical").slider("values", 1));
109 |
110 |
111 | }();
--------------------------------------------------------------------------------
/static/js/sliders.js:
--------------------------------------------------------------------------------
1 | var Sliders = function () {
2 |
3 | // default sliders
4 | $("#default-slider").slider();
5 |
6 | // increment
7 | $("#increment-slider").slider({
8 | value: 10,
9 | min: 0,
10 | max: 100,
11 | step: 10,
12 | slide: function (event, ui) {
13 | $("#increment-slider-amount").text("$" + ui.value);
14 | }
15 | });
16 | $("#increment-slider-amount").text("$" + $("#increment-slider").slider("value"));
17 |
18 | // range slider
19 | $("#slider-range").slider({
20 | range: true,
21 | min: 0,
22 | max: 1000,
23 | values: [100, 400],
24 | slide: function (event, ui) {
25 | $("#slider-range-amount").text("$" + ui.values[0] + " - $" + ui.values[1]);
26 | }
27 | });
28 |
29 | $("#slider-range-amount").text("$" + $("#slider-range").slider("values", 0) + " - $" + $("#slider-range").slider("values", 1));
30 |
31 | //range max
32 | $("#slider-range-max").slider({
33 | range: "max",
34 | min: 1,
35 | max: 100,
36 | value: 15,
37 | slide: function (event, ui) {
38 | $("#slider-range-max-amount").text("$" + ui.value);
39 | }
40 | });
41 |
42 | $("#slider-range-max-amount").text($("#slider-range-max").slider("value"));
43 |
44 | // range min
45 | $("#slider-range-min").slider({
46 | range: "min",
47 | value: 55,
48 | min: 1,
49 | max: 100,
50 | slide: function (event, ui) {
51 | $("#slider-range-min-amount").text("$" + ui.value);
52 | }
53 | });
54 | $("#slider-range-min-amount").text("$" + $("#slider-range-min").slider("value"));
55 |
56 |
57 | // setup graphic EQ
58 | $( "#eq > span" ).each(function() {
59 | var value = parseInt( $( this ).text(), 10 );
60 | $( this ).empty().slider({
61 | value: value,
62 | range: "min",
63 | animate: true,
64 | orientation: "vertical"
65 | });
66 | });
67 |
68 | // bound to select
69 | var select = $( "#bound-to-select" );
70 | var slider = $( "
" ).insertAfter( select ).slider({
71 | min: 1,
72 | max: 10,
73 | range: "min",
74 | value: select[ 0 ].selectedIndex + 1,
75 | slide: function( event, ui ) {
76 | select[ 0 ].selectedIndex = ui.value - 1;
77 | }
78 | });
79 | $( "#bound-to-select" ).change(function() {
80 | slider.slider( "value", this.selectedIndex + 1 );
81 | });
82 |
83 | // vertical slider
84 | $("#slider-vertical").slider({
85 | orientation: "vertical",
86 | range: "min",
87 | min: 0,
88 | max: 100,
89 | value: 40,
90 | slide: function (event, ui) {
91 | $("#slider-vertical-amount").text(ui.value+" cm");
92 | }
93 | });
94 | $("#slider-vertical-amount").text($("#slider-vertical").slider("value")+" cm");
95 |
96 | // vertical range sliders
97 | $("#slider-range-vertical").slider({
98 | orientation: "vertical",
99 | range: true,
100 | min: 0,
101 | max: 1000,
102 | values: [200, 600],
103 | slide: function (event, ui) {
104 | $("#slider-range-vertical-amount").text("$" + ui.values[0] + " - $" + ui.values[1]);
105 | }
106 | });
107 |
108 | $("#slider-range-vertical-amount").text("$" + $("#slider-range-vertical").slider("values", 0) + " - $" + $("#slider-range-vertical").slider("values", 1));
109 |
110 |
111 | }();
--------------------------------------------------------------------------------
/static/js/sparkline-chart 2.js:
--------------------------------------------------------------------------------
1 | var Script = function () {
2 |
3 | $(".sparkline").each(function(){
4 | var $data = $(this).data();
5 |
6 | $data.valueSpots = {'0:': $data.spotColor};
7 |
8 | $(this).sparkline( $data.data || "html", $data,
9 | {
10 | tooltipFormat: '' +
11 | '● {{offset:names}} ({{percent.1}}%) '
12 | });
13 | });
14 |
15 | /* sparkline chart */
16 | // barchart
17 | $("#barchart").sparkline([9,8,7,6,5,6,8,6,8,9,6,8,6,5,7,6,5,4,7,4,7,5,6,9], {
18 | type: 'bar',
19 | height: '125',
20 | barWidth: 8,
21 | barSpacing: 5,
22 | barColor: 'rgba(255,255,255,0.6)'
23 | });
24 | $("#barchart-2").sparkline([9,8,7,6,5,6,8,6,8,9,6,8,6,5,7,6,5,4,7,4,7,5,6,9,7,5], {
25 | type: 'bar',
26 | height: '125',
27 | barWidth: 30,
28 | barSpacing: 10,
29 | barColor: 'rgba(252,52,57,0.6)'
30 | });
31 |
32 | // linechart
33 | $("#linechart").sparkline([1,5,3,7,9,3,6,4,7,9,7,6,2], {
34 | type: 'line',
35 | width: '300',
36 | height: '75',
37 | fillColor: '',
38 | lineColor: '#fff',
39 | lineWidth: 2,
40 | spotColor: '#fff',
41 | minSpotColor: '#fff',
42 | maxSpotColor: '#fff',
43 | highlightSpotColor: '#fff',
44 | highlightLineColor: '#ffffff',
45 | spotRadius: 4,
46 | highlightLineColor: '#ffffff'
47 | // tooltipFormat: '' +
48 | // '● {{offset:names}} ({{percent.1}}%) '
49 |
50 |
51 |
52 | });
53 |
54 | $("#pie-chart").sparkline([5,3,4,1,2], {
55 | type: 'pie',
56 | width: '100',
57 | height: '100',
58 | borderColor: '#00bf00',
59 | sliceColors: ['#007AFF', '#4CD964','#34AADC', '#FFCC00', '#fc3e39']
60 | });
61 |
62 | $("#pie-chart-2").sparkline([4,5,3,2,1], {
63 | type: 'pie',
64 | width: '150',
65 | height: '150',
66 | sliceColors: ['#007AFF', '#4CD964','#34AADC', '#FFCC00', '#fc3e39']
67 | });
68 |
69 | //work progress bar
70 | $("#work-progress1").sparkline([5,6,7,5,9,6,4], {
71 | type: 'bar',
72 | height: '20',
73 | barWidth: 5,
74 | barSpacing: 2,
75 | barColor: '#5fbf00'
76 | });
77 |
78 | $("#work-progress2").sparkline([3,2,5,8], {
79 | type: 'bar',
80 | height: '22',
81 | barWidth: 5,
82 | barSpacing: 2,
83 | barColor: '#4cd964'
84 | });
85 |
86 | $("#work-progress3").sparkline([1,6,9,3], {
87 | type: 'bar',
88 | height: '22',
89 | barWidth: 5,
90 | barSpacing: 2,
91 | barColor: '#4cd964'
92 | });
93 |
94 | $("#work-progress4").sparkline([6,7,4,3], {
95 | type: 'bar',
96 | height: '22',
97 | barWidth: 5,
98 | barSpacing: 2,
99 | barColor: '#34aadc'
100 | });
101 |
102 | $("#work-progress5").sparkline([6,8,5,7], {
103 | type: 'bar',
104 | height: '22',
105 | barWidth: 5,
106 | barSpacing: 2,
107 | barColor: '#007AFF'
108 | });
109 |
110 | }();
--------------------------------------------------------------------------------
/static/js/sparkline-chart.js:
--------------------------------------------------------------------------------
1 | var Script = function () {
2 |
3 | $(".sparkline").each(function(){
4 | var $data = $(this).data();
5 |
6 | $data.valueSpots = {'0:': $data.spotColor};
7 |
8 | $(this).sparkline( $data.data || "html", $data,
9 | {
10 | tooltipFormat: '' +
11 | '● {{offset:names}} ({{percent.1}}%) '
12 | });
13 | });
14 |
15 | /* sparkline chart */
16 | // barchart
17 | $("#barchart").sparkline([9,8,7,6,5,6,8,6,8,9,6,8,6,5,7,6,5,4,7,4,7,5,6,9], {
18 | type: 'bar',
19 | height: '125',
20 | barWidth: 8,
21 | barSpacing: 5,
22 | barColor: 'rgba(255,255,255,0.6)'
23 | });
24 | $("#barchart-2").sparkline([9,8,7,6,5,6,8,6,8,9,6,8,6,5,7,6,5,4,7,4,7,5,6,9,7,5], {
25 | type: 'bar',
26 | height: '125',
27 | barWidth: 30,
28 | barSpacing: 10,
29 | barColor: 'rgba(252,52,57,0.6)'
30 | });
31 |
32 | // linechart
33 | $("#linechart").sparkline([1,5,3,7,9,3,6,4,7,9,7,6,2], {
34 | type: 'line',
35 | width: '300',
36 | height: '75',
37 | fillColor: '',
38 | lineColor: '#fff',
39 | lineWidth: 2,
40 | spotColor: '#fff',
41 | minSpotColor: '#fff',
42 | maxSpotColor: '#fff',
43 | highlightSpotColor: '#fff',
44 | highlightLineColor: '#ffffff',
45 | spotRadius: 4,
46 | highlightLineColor: '#ffffff'
47 | // tooltipFormat: '' +
48 | // '● {{offset:names}} ({{percent.1}}%) '
49 |
50 |
51 |
52 | });
53 |
54 | $("#pie-chart").sparkline([5,3,4,1,2], {
55 | type: 'pie',
56 | width: '100',
57 | height: '100',
58 | borderColor: '#00bf00',
59 | sliceColors: ['#007AFF', '#4CD964','#34AADC', '#FFCC00', '#fc3e39']
60 | });
61 |
62 | $("#pie-chart-2").sparkline([4,5,3,2,1], {
63 | type: 'pie',
64 | width: '150',
65 | height: '150',
66 | sliceColors: ['#007AFF', '#4CD964','#34AADC', '#FFCC00', '#fc3e39']
67 | });
68 |
69 | //work progress bar
70 | $("#work-progress1").sparkline([5,6,7,5,9,6,4], {
71 | type: 'bar',
72 | height: '20',
73 | barWidth: 5,
74 | barSpacing: 2,
75 | barColor: '#5fbf00'
76 | });
77 |
78 | $("#work-progress2").sparkline([3,2,5,8], {
79 | type: 'bar',
80 | height: '22',
81 | barWidth: 5,
82 | barSpacing: 2,
83 | barColor: '#4cd964'
84 | });
85 |
86 | $("#work-progress3").sparkline([1,6,9,3], {
87 | type: 'bar',
88 | height: '22',
89 | barWidth: 5,
90 | barSpacing: 2,
91 | barColor: '#4cd964'
92 | });
93 |
94 | $("#work-progress4").sparkline([6,7,4,3], {
95 | type: 'bar',
96 | height: '22',
97 | barWidth: 5,
98 | barSpacing: 2,
99 | barColor: '#34aadc'
100 | });
101 |
102 | $("#work-progress5").sparkline([6,8,5,7], {
103 | type: 'bar',
104 | height: '22',
105 | barWidth: 5,
106 | barSpacing: 2,
107 | barColor: '#007AFF'
108 | });
109 |
110 | }();
--------------------------------------------------------------------------------
/static/js/tagcloud.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * tagcloud v1.1.1 - http://tagcloud.congm.in
3 | * Copyright 2016 @ Cong Min , Inc.
4 | * MIT License - https://github.com/mcc108/tagcloud
5 | */
6 | !function(e){function t(i){if(s[i])return s[i].exports;var o=s[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var s={};return t.m=e,t.c=s,t.p="",t(0)}([function(e,t,s){e.exports=s(5)},,,function(e,t){},,function(e,t,s){s(3),window.tagcloud=function(e,t){function s(e){return"[object Object]"===Object.prototype.toString.call(e)}function i(t){var s=this;s.config=i._getConfig(t),s.box=s.config.element,s.fontsize=s.config.fontsize,s.radius=s.config.radius,s.depth=1.5*s.radius,s.size=1.5*s.radius,s.mspeed=i._getMsSpeed(s.config.mspeed),s.ispeed=i._getIsSpeed(s.config.ispeed),s.items=s._getItems(),s.direction=s.config.direction,s.keep=s.config.keep,s.active=!1,s.lasta=1,s.lastb=1,s.mouseX0=s.ispeed*Math.sin(s.direction*Math.PI/180),s.mouseY0=-s.ispeed*Math.cos(s.direction*Math.PI/180),s.mouseX=s.mouseX0,s.mouseY=s.mouseY0,i._on(s.box,"mouseover",function(){s.active=!0}),i._on(s.box,"mouseout",function(){s.active=!1}),i._on(s.keep?e:s.box,"mousemove",function(t){var i=e.event||t,o=s.box.getBoundingClientRect();s.mouseX=(i.clientX-(o.left+s.box.offsetWidth/2))/5,s.mouseY=(i.clientY-(o.top+s.box.offsetHeight/2))/5}),i.boxs.push(s.box),s.update(s),s.box.style.visibility="visible",s.box.style.position="relative",s.box.style.minHeight=2*s.size+"px",s.box.style.minWidth=2*s.size+"px";for(var o=0,n=s.items.length;o span').attr('title', 'Collapse this branch');
3 | $('.tree li.parent_li > span').on('click', function(e) {
4 | var children = $(this).parent('li.parent_li').find(' > ul > li');
5 | if (children.is(":visible")) {
6 | children.hide('fast');
7 | $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
8 | } else {
9 | children.show('fast');
10 | $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
11 | }
12 | e.stopPropagation();
13 | });
14 | });
--------------------------------------------------------------------------------
/templates/404.html:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/templates/index.html:
--------------------------------------------------------------------------------
1 | {% extends "navigate.html" %} {% block mainbody %}
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 主页
11 | 实体识别
12 |
13 |
14 |
15 |
16 |
37 |
38 |
39 |
40 |
45 |
46 |
47 |
{{ rlt|safe }}
48 |
49 |
50 |
51 |
52 |
59 |
60 |
61 |
{{ seg_word|safe }}
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | {% endblock %}
--------------------------------------------------------------------------------
/toolkit/nlp_ner.py:
--------------------------------------------------------------------------------
1 | import sys
2 | sys.path.append("..")
3 | from toolkit.pre_load import thuFactory,neo4jconn,domain_ner_dict
4 |
5 | '''
6 | n/名词 np/人名 ns/地名 ni/机构名 nz/其它专名
7 | m/数词 q/量词 mq/数量词 t/时间词 f/方位词 s/处所词
8 | v/动词 a/形容词 d/副词 h/前接成分 k/后接成分 i/习语
9 | j/简称 r/代词 c/连词 p/介词 u/助词 y/语气助词
10 | e/叹词 o/拟声词 g/语素 w/标点 x/其它
11 | '''
12 | #上一个词的词性筛选
13 | def preword(s):
14 | if s=='n' or s=='np' or s=='ns' or s=='ni' or s=='nz':
15 | return True
16 | if s=='v' or s=='a' or s=='i' or s=='j' or s=='x' or s=='id' or s=='g' or s=='u':
17 | return True
18 | if s=='t' or s=='m':
19 | return True
20 | return False
21 |
22 | #当前词的词性筛选
23 | def curword(s):
24 |
25 | if s=='n' or s=='np' or s=='ns' or s=='ni' or s=='nz':
26 | return True
27 | if s=='a' or s=='i' or s=='j' or s=='x' or s=='id' or s=='g' or s=='t':
28 | return True
29 | if s=='t' or s=='m':
30 | return True
31 | return False
32 | # 临时:名词短语
33 | def tempword(s):
34 | if s=='np' or s=='ns' or s=='ni' or s=='nz':
35 | return True
36 | if s=='j' or s=='x' or s=='t':
37 | return True
38 | return False
39 | #获取实体信息
40 | def get_ner_info(s):
41 | if s == 1:
42 | return '人物'
43 | if s == 2:
44 | return '地点'
45 | if s == 3:
46 | return '机构'
47 | if s == 4:
48 | return '数字'
49 | if s == 5:
50 | return '时间'
51 | if s == 6:
52 | return '日期'
53 | if s == 7:
54 | return '货币'
55 | if s == 8:
56 | return '汽车品牌'
57 | if s == 9:
58 | return '汽车车系'
59 | if s == 10:
60 | return '汽车车型'
61 | if s == 16:
62 | return '其它实体'
63 |
64 | if s == 'np':
65 | return '人物'
66 | if s == 'ns':
67 | return '地点'
68 | if s == 'ni':
69 | return '机构'
70 | if s == 'nz':
71 | return '专业名词'
72 | if s == 'i' or s == 'id':
73 | return '习语'
74 | if s == 'j':
75 | return '简称'
76 | if s == 'x':
77 | return '其它'
78 | if s == 't':
79 | return '时间'
80 |
81 | return '非实体'
82 | #获取实体描述信息
83 | def get_detail_ner_info(s):
84 | if s == 1:
85 | return '包括人名'
86 | if s == 2:
87 | return '包括地区'
88 | if s == 3:
89 | return '包括机构名'
90 | if s == 4:
91 | return '数字'
92 | if s == 5:
93 | return '时间'
94 | if s == 6:
95 | return '日期'
96 | if s == 7:
97 | return '货币'
98 | if s == 8:
99 | return '汽车品牌'
100 | if s == 9:
101 | return '汽车车系'
102 | if s == 10:
103 | return '汽车车型'
104 |
105 | if s == 'np':
106 | return '人名、职位名等'
107 | if s == 'ns':
108 | return '国家、地区、城市等'
109 | if s == 'ni':
110 | return '组织机构'
111 | if s == 'nz':
112 | return ' '
113 | if s == 'i' or s == 'id':
114 | return ' '
115 | if s == 'j':
116 | return ' '
117 | if s == 'x':
118 | return ' '
119 | if s == 't':
120 | return ' '
121 |
122 | return '非实体'
123 |
124 | def get_ner(text):
125 | # 读取thulac,neo4j,分词
126 | thu1 = thuFactory
127 | db = neo4jconn
128 | taglist = thu1.cut(text, text=False)
129 | taglist.append(['===',None])
130 | #命名实体词典
131 | label = domain_ner_dict
132 | nerlist = []
133 | i = 0
134 | length = len(taglist) - 1 # 扣掉多加的那个
135 | while i < length:
136 | p1 = taglist[i][0]
137 | t1 = taglist[i][1]
138 | p2 = taglist[i+1][0]
139 | t2 = taglist[i+1][1]
140 | p12 = p1 + p2
141 | # 基于组合识别实体对象:单词+单词
142 | flag = db.matchEntityItem(p12)
143 | if p12 in label and flag != None and preword(t1) and curword(t2):
144 | nerlist.append([p12,label[p12]])
145 | i += 2
146 | continue
147 | #单词对象识别:单词
148 | flag = db.matchEntityItem(p1)
149 | if p1 in label and flag != None and curword(t1): # 词典内+数据库内+词性筛选(通过)
150 | nerlist.append([p1,label[p1]])
151 | i += 1
152 | continue
153 | #临时名词单词
154 | if tempword(t1):
155 | nerlist.append([p1,t1])
156 | i += 1
157 | continue
158 | nerlist.append([p1,0])
159 | i += 1
160 | return nerlist
161 |
--------------------------------------------------------------------------------
/toolkit/pre_load.py:
--------------------------------------------------------------------------------
1 | import thulac
2 | import sys
3 | import csv
4 | import os
5 |
6 | sys.path.append("..")
7 |
8 | from Model.neo4j_models import Neo4j_Handle
9 |
10 | thuFactory = thulac.thulac()
11 | print('--init thulac()--')
12 |
13 | #预加载Neo4j图数据库
14 | neo4jconn = Neo4j_Handle()
15 | neo4jconn.connectDB()
16 | print('--Neo4j connecting--')
17 |
18 | domain_ner_dict = {}
19 | filePath = os.getcwd()
20 | with open(filePath+'/toolkit/domainDict.csv','r',encoding="utf-8") as csvfile:
21 | reader = csv.reader(csvfile, delimiter=',')
22 | for row in reader:
23 | #实体 类型代码
24 | domain_ner_dict[str(row[0])] = int(row[1])
25 | print('--Load Domain Dictionary...--!')
26 |
--------------------------------------------------------------------------------