Giter VIP home page Giter VIP logo

seed's Introduction

项目概述

Seed自助数据展示系统只是一款简易的BI系统,它方便快捷,可以通过简易的拖拽并配置报表,使只会SQL的统计人员都能快速搭建出属于自己的数据可视化报表。

首页 默认业务

测试网址

http://seed.boyaa.com

测试账号: admin 密码: admin123

系统操作手册

如何操作Seed自助数据展示系统

如何安装

  1. 需要环境
    系统环境: Linux, Mac和Windows
    运行环境: Python3.5+
    其他软件: Redis, MySQL(Postgresql)
    
    注: 数据库一定要使用空库。
    
  2. 安装
  • pip安装

    pip install boyaa-seed
    
  • 编译安装

    获取代码 git clone [email protected]:BoyaaDataCenter/seed.git
    进入文件夹 cd seed
    编译代码 python setup.py install
    
  1. 初始化seed的config文件
    执行seed init
    
  2. config文件设置
    打开用户根目录下的.seed/seed_conf.py文件
    进行数据库等相关的配置
    如: vim ~/.seed/seed_conf.py
    
  3. 初始化数据库
    进行数据库初始化, 执行
    seed upgrade
    即可
    
  4. 运行web程序
    执行 seed run web运行web系统
    注:因uwsgi模块不支持Windows,故只能以开发模式运行:seed run web --debug=True
    
  5. 访问
    127.0.0.1:5000 可访问系统
    

如何升级

  1. 获取到最新代码
  2. 打包seed
    进入seed项目根目录
    运行 python setup.py install
    
  3. 运行web程序
    执行 seed run web运行web系统
    
  4. 访问
    127.0.0.1:5000 可访问系统
    

开发模式

  1. 安装seed的pip运行文件到第三方库中
    python setup.py develop
    
  2. 运行seed数据
    seed init
    
  3. 设置数据库
    vim ~/.seed/seed_config.py
    
  4. 运行web
    seed run web --debug=True
    

图形说明

1、桑基图使用规范

桑基图源数据需可以将数据按照以下形式组合:

selet source, target, value  from table
union all
selet source, target, value from table

(上面一条sql的target需要和下一条sql的source相同,否则就不能形成桑基图形式 source, target 这两个字段别名已固定)

数据示例说明(以mysql为例):
CREATE TABLE `sankey_testdata` (
  `state` varchar(20) ,
  `address` varchar(20) ,
  `province` varchar(20) ,
  `value` int
) ENGINE=innodb  DEFAULT CHARSET=utf8;
insert into sankey_testdata values
('东部地区',  '东三省',  '黑龙江',246),
('东部地区',  '东三省',  '吉林', 319),
('东部地区',  '东三省',  '辽宁', 871),
('东部地区',  '华南',     '广东', 323),
('东部地区',  '华南',     '广西', 250),
('东部地区',  '华南',     '海南', 431),
('东部地区',  '华南',     '福建', 236),
('东部地区',  '华南',     '香港', 334),
('东部地区',  '华南',     '澳门', 544),
('东部地区',  '华南',     '**', 915),
('东部地区',  '环渤海',  '北京', 687),
('东部地区',  '环渤海',  '天津', 340),
('东部地区',  '环渤海',  '内蒙古',234),
('东部地区',  '环渤海',  '河北', 282),
('东部地区',  '环渤海',  '山东', 102),
('东部地区',  '长三角',  '上海', 201),
('东部地区',  '长三角',  '江苏', 717),
('东部地区',  '长三角',  '浙江', 669),
('西部地区',  '西北',     '青海', 335),
('西部地区',  '西北',     '甘肃', 357),
('西部地区',  '西北',     '宁夏', 456),
('西部地区',  '西北',     '山西', 119),
('西部地区',  '西北',     '**', 984),
('西部地区',  '西南',     '云南', 611);
桑基图查询SQL示例:
SELECT
  state as source,
  address as target,
  sum(value) as value
FROM sankey_testdata
GROUP BY state,address
union all
SELECT
  address as source,
  province as target ,
  sum(value) as value
FROM sankey_testdata
GROUP BY address,province

2、地图使用规范

地图源数据至少需要以下字段

经度
纬度
区域名称
区域id
区域上级id
区域级别id(注:区域级别需按以下分类,否则可能导致数据显示混乱)
   1-国家
   2-省份
   3-地市
   4-区县/乡镇(街道)
   7-社区
   8-具体位置
数据示例说明(以mysql为例):
CREATE TABLE `map_testdata` (
  `fdate` date,
  `fid` int comment '区域id',
  `region_name` varchar(100) comment '区域名称',
  `fpid` int comment '区域上级id',
  `region_id` int comment '区域级别id',
  `value1` int,
  `value2` int,
  `value3` int,
  `lat` varchar(100) comment '经度',
  `lng` varchar(100) comment '纬度'
) ENGINE=innodb  DEFAULT CHARSET=utf8;
insert into map_testdata values
('2019-05-08',1,'**',0,1,25000,10000,20000,'37.550339','104.114129'),
('2019-05-08',107712,'广东省',1,2,5000,3000,1000,'23.408003729025','113.39481755876'),
('2019-05-08',112083,'深圳市',107712,3,3000,1000,1500,'22.546053546205','114.02597365732'),
('2019-05-08',112313,'南山区',112083,4,2000,300,200,'22.558887751083','113.95072266574'),
('2019-05-08',null,null,'112313',7,2,2,2,'22.5557455','114.026432'),
('2019-05-08',null,null,'112313',7,40,40,40,'22.5658103','114.0948389'),
('2019-05-08',null,null,'112313',7,166,166,166,'22.53615273','114.1144042'),
('2019-05-08',null,null,'112313',7,80,80,80,'22.5232017','114.0353637'),
('2019-05-08',null,null,'112313',7,14,14,14,'22.53781229','114.1248561'),
('2019-05-08',null,null,'112313',7,1,1,1,'22.578339','114.140053'),
('2019-05-08',null,null,'112313',7,1,1,1,'22.52957','114.200043'),
('2019-05-08',null,null,'112313',7,33,33,33,'22.60465685','114.1245172'),
('2019-05-08',null,null,'112313',7,154,154,154,'22.5465231','114.0245698'),
('2019-05-08',null,null,'112313',7,1,1,1,'22.530012','114.199852'),
('2019-05-08',null,null,'112313',7,12,12,12,'22.6010765','113.8757611'),
('2019-05-08',null,null,'112313',7,5,5,5,'22.5274626','114.195732'),
('2019-05-08',null,null,'112313',7,3,3,3,'22.58916333','113.9847973'),
('2019-05-08',null,null,'112313',7,2,2,2,'22.510313','114.146149'),
('2019-05-08',null,null,'112313',7,52,52,52,'22.56592831','114.1653427'),
('2019-05-08',null,null,'112313',7,6,6,6,'22.5230185','113.8840307'),
('2019-05-08',null,null,'112313',7,8,8,8,'22.55479675','113.876808'),
('2019-05-08',null,null,'112313',7,2,2,2,'22.527546','114.1382295'),
('2019-05-08',null,null,'112313',7,20,20,20,'22.60403745','113.8813462'),
('2019-05-08',null,null,'112313',7,3,3,3,'22.53090833','114.0340117'),
('2019-05-08',null,null,'112313',7,24,24,24,'22.52259221','114.1844415'),
('2019-05-08',null,null,'112313',7,6,6,6,'22.56845417','113.8482768'),
('2019-05-08',null,null,'112313',7,15,15,15,'22.50921313','114.1460804'),
('2019-05-08',null,null,'112313',7,1,1,1,'22.52459','113.873619'),
('2019-05-08',null,null,'112313',7,54,54,54,'22.51644502','113.9074763'),
('2019-05-08',null,null,'112313',7,110,120,135,'22.54528264','113.9450687');
地图查询SQL示例:

以下SQL中的{}表示变量,使用地图时 region_id,slat,elat,slng,elng,fpid均为必须参数

postgresql写法:

SELECT
   a.region_name,
   a.fid as fpid,
   a.lat,
   a.lng,
   a.value1,
   a.value2,
   a.value3
from  map_testdata a
WHERE region_id = {region_id}
  AND cast(lat AS decimal(20, 10)) > {slat}
  AND cast(lat AS decimal(20, 10))< {elat}
  AND cast(lng AS decimal(20, 10)) > {slng}
  AND cast(lng AS decimal(20, 10))< {elng}
  AND CASE cast( {fpid} AS bool ) WHEN TRUE THEN fpid={fpid} ELSE 1=1 END

mysql写法:

SELECT
   a.region_name,
   a.fid as fpid,
   a.lat,
   a.lng,
   a.value1,
   a.value2,
   a.value3
from  map_testdata a
WHERE region_id = {region_id}
  AND cast(lat AS decimal(20, 10)) > {slat}
  AND cast(lat AS decimal(20, 10))< {elat}
  AND cast(lng AS decimal(20, 10)) > {slng}
  AND cast(lng AS decimal(20, 10))< {elng}
  AND CASE {fpid}=true WHEN TRUE THEN fpid={fpid} ELSE 1=1 END

seed's People

Contributors

charles-yurun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

seed's Issues

python3 setup.py install

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'auther'
warnings.warn(msg)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'auther_email'
warnings.warn(msg)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_assets
initializing git submodules
command failed [git submodule init] via [.]
Traceback (most recent call last):
File "setup.py", line 93, in
"Operating System :: OS Independent"
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/init.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 57, in run
InstallCommand.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/install.py", line 65, in run
orig.install.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 46, in run
self.run_command('build_assets')
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/levi_yu/Documents/Dev/Python/seed/src/seed/utils/distutils/base.py", line 66, in run
self._setup_git()
File "/Users/levi_yu/Documents/Dev/Python/seed/src/seed/utils/distutils/base.py", line 29, in _setup_git
self._run_command(['git', 'submodule', 'init'])
File "/Users/levi_yu/Documents/Dev/Python/seed/src/seed/utils/distutils/base.py", line 57, in _run_command
return check_output(cmd, cwd=self.work_path, env=env, shell=True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 389, in check_output
**kwargs).stdout
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 481, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'submodule', 'init']' returned non-zero exit status 1.

安装失败

报错如下:
ERROR: requests 2.22.0 has requirement urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1, but you'll have urllib3 1.25 which is incompatible.
Installing collected packages: redis, typed-ast, certifi, uWSGI, marshmallow, marshmallow-sqlalchemy, rope, bcrypt, python-editor, Mako, alembic, Flask-SQLAlchemy, Flask-Migrate, psycopg2, pycodestyle, thriftpy, impyla, PyMySQL, flask-marshmallow, Flask-Script, urllib3, astroid, idna, Flask-Cors, sqlparse, flake8, Jinja2, pylint, boyaa-seed
Found existing installation: certifi 2018.4.16
ERROR: Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

即使加上ignore参数,可以成功安装,但还是无法执行。

pip install boyaa-seed 报错

Could not find a version that satisfies the requirement boyaa-seed (from versions: )
No matching distribution found for boyaa-seed

npm run buildProd

[email protected] buildProd /data/easyops_report/seed/seed_static
ng build --prod --env=prod --aot

The build command requires to be run in an Angular project, but a project definition could not be found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] buildProd: ng build --prod --env=prod --aot
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] buildProd script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-05-09T15_25_11_251Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/opt/node-v10.15.3-linux-x64/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'buildProd' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuildProd', 'buildProd', 'postbuildProd' ]
5 info lifecycle [email protected]prebuildProd: [email protected]
6 info lifecycle [email protected]
buildProd: [email protected]
7 verbose lifecycle [email protected]buildProd: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
buildProd: PATH: /opt/node-v10.15.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/data/easyops_report/seed/seed_stati
c/node_modules/.bin:/usr/local/easyops/python/tools:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/nginx/sbin/:/usr/local/mysql
/bin/:/root/bin:/root/bin
9 verbose lifecycle [email protected]buildProd: CWD: /data/easyops_report/seed/seed_static
10 silly lifecycle [email protected]
buildProd: Args: [ '-c', 'ng build --prod --env=prod --aot' ]
11 silly lifecycle [email protected]buildProd: Returned: code: 1 signal: null
12 info lifecycle [email protected]
buildProd: Failed to exec buildProd script
13 verbose stack Error: [email protected] buildProd: ng build --prod --env=prod --aot
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/opt/node-v10.15.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess. (/opt/node-v10.15.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /data/easyops_report/seed/seed_static
16 verbose Linux 2.6.32-754.3.5.el6.x86_64
17 verbose argv "/opt/node-v10.15.3-linux-x64/bin/node" "/usr/local/bin/npm" "run" "buildProd"
18 verbose node v10.15.3
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] buildProd: ng build --prod --env=prod --aot
22 error Exit status 1
23 error Failed at the [email protected] buildProd script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

有bug希望修复

进系统, 默认业务任意字段排序 表格数据有重复数据。点击菜单不会刷新页面 只是在本页面上增加内容。极其严重。望修复

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.