Browse Source

docs(readme): readme,sparkline demo

readme
master
liurunze 5 years ago
parent
commit
d607fbcd6d
  1. 38
      README-zh.md
  2. 18
      README.md
  3. 4
      src/controllers/handler.js
  4. 2
      src/controllers/sheetmanage.js
  5. 4
      src/demoData/sheetComment.js
  6. 282
      src/demoData/sheetFormula.js
  7. 4
      src/demoData/sheetPivotTable.js
  8. 4
      src/demoData/sheetPivotTableData.js
  9. 790
      src/demoData/sheetSparkline.js
  10. 5
      src/index.html
  11. 4
      src/index.js
  12. 2
      src/plugins/js/jquery-ui.min.js

38
README-zh.md

@ -1,10 +1,10 @@
# Luckysheet
简体中文 | [English](./README.md)
## Introduction - 介绍
## 介绍
Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。
## Features - 特性
## 特性
1. Luckysheet支持表格设置包括冻结行列、合并单元格、筛选、排序、查询、条件格式、批注
2. 支持数据分析功能包括透视表、图表、分列、矩阵操作、内置385个计算函数
3. 支持一键截图、复制为json数据、共享编辑、excel与Luckysheet之间数据的复制粘贴
@ -15,28 +15,32 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置
![演示](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif)
## Plan - 计划
- 模块化(进行中)
- excel导入/导出
- 表单
## 计划
- 完善图表插件
- 插入图片
- 数据验证(复选框、下拉列表)
- 打印
- 单元格分段样式
- 树形菜单
- 表格功能:筛选,切片
- excel导入/导出
- 更多...
## Documentation - 文档
## 文档
[在线demo](https://mengshukeji.github.io/LuckysheetDemo/)
[在线文档](https://mengshukeji.github.io/LuckysheetDocs/)
## Requirements - 环境
## 环境
[Node.js](https://nodejs.org/en/) Version >= 6
## Installation - 安装
## 安装
```
npm install
npm install gulp -g
```
## Development - 开发
## 开发
开发
```
npm run dev
@ -49,7 +53,7 @@ npm run build
Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发者看源码只需要看这两个文件即可,接下来会讨论进行模块化方案,完善这个插件.
## Usage - 用法
## 用法
#### 第一步
`npm run build`后`dist`文件夹下的所有文件复制到项目目录
@ -82,10 +86,10 @@ Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发
</script>
```
## Contact - 联系
## 联系
mengshu@office2.cn
## communication - 交流
## 交流
- 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群
@ -97,11 +101,11 @@ mengshu@office2.cn
<img src="https://minio.cnbabylon.com/public/luckysheet/QQ%E7%BE%A4%E4%BA%8C%E7%BB%B4%E7%A0%81.jpg" width = "200" alt="微信群" align="center" />
## Authors and acknowledgment - 贡献者和感谢
- Bug Pan ([@wpxp123456](https://github.com/wpxp123456))
- Dushusir ([@Dushusir](https://github.com/Dushusir))
## 贡献者和感谢
- [@wpxp123456](https://github.com/wpxp123456)
- [@Dushusir](https://github.com/Dushusir)
## License - 版权信息
## 版权信息
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2020-present, mengshukeji

18
README.md

@ -1,4 +1,6 @@
# Luckysheet
[![Join the chat at https://gitter.im/mengshukeji/Luckysheet](https://badges.gitter.im/mengshukeji/Luckysheet.svg)](https://gitter.im/mengshukeji/Luckysheet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
English| [简体中文](./README-zh.md)
## Introduction
@ -17,10 +19,14 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi
![Demo](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif)
## Plan
- modularization (in progress)
- Excel import/export
- Form
- Improve chart plugin
- Insert picture
- Data validation (checkbox, drop-down list)
- Print
- Cell segmentation style
- Tree menu
- Table function: filter, slice
- Excel import/export
- More...
## Documentation
@ -88,11 +94,11 @@ mengshu@office2.cn
## communication
coming soon!
- [Gitter](https://gitter.im/mengshukeji/Luckysheet)
## Authors and acknowledgment
- Bug Pan ([@wpxp123456](https://github.com/wpxp123456))
- Dushusir ([@Dushusir](https://github.com/Dushusir))
- [@wpxp123456](https://github.com/wpxp123456)
- [@Dushusir](https://github.com/Dushusir)
## License
[MIT](http://opensource.org/licenses/MIT)

4
src/controllers/handler.js

@ -6651,8 +6651,8 @@ export default function luckysheetHandler() {
});
$("#luckysheetsheetconfigmoveleft").click(function () {
if (luckysheetcurrentSheetitem.prevAll(":visible").length > 0) {
luckysheetcurrentSheetitem.insertBefore(luckysheetcurrentSheetitem.prevAll(":visible").eq(0));
if (luckysheetcurrentSheetitem.preval(":visible").length > 0) {
luckysheetcurrentSheetitem.insertBefore(luckysheetcurrentSheetitem.preval(":visible").eq(0));
sheetmanage.reOrderAllSheet();
}
$("#luckysheet-input-box").removeAttr("style");

2
src/controllers/sheetmanage.js

@ -228,7 +228,7 @@ const sheetmanage = {
indicator = indicator.eq(0).data("index");
}
else {
indicator = luckysheetcurrentSheetitem.prevAll(":visible").eq(0).data("index");
indicator = luckysheetcurrentSheetitem.preval(":visible").eq(0).data("index");
}
$("#luckysheet-sheets-item" + indicator).addClass("luckysheet-sheets-item-active");

4
src/demoData/sheetComment.js

@ -6,7 +6,7 @@ const sheetComment = {
"2": 102
}
},
"index": "4",
"index": "5",
"chart": [{
"sheetIndex": "0",
"dataSheetIndex": "0",
@ -20,7 +20,7 @@ const sheetComment = {
"myTop": "11"
}],
"status": "0",
"order": "4",
"order": "5",
"column": 18,
"row": 36,
"celldata": [{

282
src/demoData/sheetFormula.js

@ -6928,6 +6928,288 @@ const sheetFormula = {
"c": 10,
"v": {}
}],
"calcChain":[
{
"r": 6,
"c": 3,
"index": 1,
"func": [
true,
23.75,
"=AVERAGE(D3:D6)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 7,
"c": 3,
"index": 1,
"func": [
true,
30,
"=MAX(D3:D6)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 8,
"c": 3,
"index": 1,
"func": [
true,
17,
"=MIN(D3:D6)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 5,
"c": 9,
"index": 1,
"func": [
true,
"J2",
"=INDIRECT(\"I2\")"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 6,
"c": 9,
"index": 1,
"func": [
true,
1,
"=INDIRECT(I2)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 7,
"c": 9,
"index": 1,
"func": [
true,
"I",
"=INDIRECT(\"I\"&(1+2))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 8,
"c": 9,
"index": 1,
"func": [
true,
1,
"=INDIRECT(I4&J3)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 9,
"c": 9,
"index": 1,
"func": [
true,
"#REF!",
"=INDIRECT(\"Formula!\"&I2)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 10,
"c": 9,
"index": 1,
"func": [
true,
"#REF!",
"=INDIRECT(\"Formula!I2\")"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 14,
"c": 7,
"index": 1,
"func": [
true,
207,
"=SUBTOTAL(9,OFFSET($D$15,ROW($D$15:$D$18)-ROW($D$15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 15,
"c": 7,
"index": 1,
"func": [
true,
182,
"=SUBTOTAL(9,OFFSET(E15,ROW(E15:E18)-ROW(E15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 16,
"c": 7,
"index": 1,
"func": [
true,
152,
"=SUBTOTAL(9,OFFSET(F15,ROW(F15:F18)-ROW(F15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 17,
"c": 7,
"index": 1,
"func": [
true,
541,
"=SUBTOTAL(9,OFFSET(G15,ROW(G15:G18)-ROW(G15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 22,
"c": 8,
"index": 1,
"func": [
true,
"#NAME?",
"=INDEX(D21:D25,MATCH(TRUE,ISNA(MATCH(D21:D25,C21:C27,0)),0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 23,
"c": 8,
"index": 1,
"func": [
true,
"#NAME?",
"=INDEX(D21:D25,MATCH(TRUE,ISNA(MATCH(D21:D25,C21:C27,0)),0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 38,
"c": 6,
"index": 1,
"func": [
true,
1,
"=SUM(IF((C31:C39=\"Fax\")+(D31:D39=\"Jones\")<>2,1,0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 30,
"c": 6,
"index": 1,
"func": [
true,
"#NAME?",
"=SUM((C31:C39=\"Fax\")*(D31:D39=\"Brown\")*(E31:E39))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 32,
"c": 6,
"index": 1,
"func": [
true,
"#NAME?",
"=SUM((C31:C39=\"Fax\")*(D31:D39=\"Brown\"))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 34,
"c": 6,
"index": 1,
"func": [
true,
1,
"=SUM(IF((C31:C39=\"Fax\")+(D31:D39=\"Jones\"),1,0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 36,
"c": 6,
"index": 1,
"func": [
true,
1,
"=SUM(IF(MOD((C31:C39=\"Fax\")+(D31:D39=\"Jones\"),2),1,0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
}
],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],

4
src/demoData/sheetPivotTable.js

@ -2,7 +2,7 @@ const sheetPivotTable = {
"name": "PivotTable",
"color": "",
"config": {},
"index": "6",
"index": "7",
"chart": [{
"sheetIndex": "0",
"dataSheetIndex": "0",
@ -16,7 +16,7 @@ const sheetPivotTable = {
"myTop": "11"
}],
"status": "0",
"order": "6",
"order": "7",
"column": 18,
"row": 36,
"celldata": [{

4
src/demoData/sheetPivotTableData.js

@ -4,7 +4,7 @@ const sheetPivotTableData = {
"config": {
"merge": {}
},
"index": "5",
"index": "6",
"chart": [{
"sheetIndex": "0",
"dataSheetIndex": "0",
@ -18,7 +18,7 @@ const sheetPivotTableData = {
"myTop": "11"
}],
"status": "0",
"order": "5",
"order": "6",
"hide": 1,
"column": 18,
"row": 36,

790
src/demoData/sheetSparkline.js

@ -0,0 +1,790 @@
const sheetSparkline = {
"name": "Sparkline",
"color": "",
"config": {
"merge": {
"1_2": {
"r": 1,
"c": 2,
"rs": 1,
"cs": 2
},
"1_4": {
"r": 1,
"c": 4,
"rs": 1,
"cs": 2
},
"0_0": {
"r": 0,
"c": 0,
"rs": 1,
"cs": 6
},
"2_2": {
"r": 2,
"c": 2,
"rs": 3,
"cs": 2
},
"2_4": {
"r": 2,
"c": 4,
"rs": 3,
"cs": 2
}
},
"rowlen": {
"0": 25
},
"columlen": {
"0": 101
}
},
"index": 4,
"chart": [
{
"sheetIndex": "0",
"dataSheetIndex": "0",
"chartType": "column",
"row": "[1,3]",
"column": "[3,3]",
"chartStyle": "default",
"myWidth": "480",
"myHeight": "288",
"myLeft": "67",
"myTop": "11"
}
],
"status": "0",
"order": 4,
"column": 18,
"row": 36,
"celldata": [
{
"r": 0,
"c": 0,
"v": {
"v": "The company revenue in 2014",
"ct": {
"fa": "General",
"t": "g"
},
"m": "The company revenue in 2014",
"mc": {
"r": 0,
"c": 0,
"rs": 1,
"cs": 6
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 1,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 2,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 3,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 4,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 5,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 0,
"v": {
"m": "Month",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Month",
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 1,
"v": {
"m": "Revenue",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Revenue",
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 2,
"v": {
"m": "Diagram 1",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Diagram 1",
"mc": {
"r": 1,
"c": 2,
"rs": 1,
"cs": 2
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 3,
"v": {
"mc": {
"r": 1,
"c": 2
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 4,
"v": {
"m": "Diagram 2",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Diagram 2",
"mc": {
"r": 1,
"c": 4,
"rs": 1,
"cs": 2
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 5,
"v": {
"mc": {
"r": 1,
"c": 4
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 2,
"c": 0,
"v": {
"m": "2014-02-01",
"ct": {
"fa": "yyyy-MM-dd",
"t": "d"
},
"v": 41671
}
},
{
"r": 2,
"c": 1,
"v": {
"v": 30,
"ct": {
"fa": "General",
"t": "n"
},
"m": "30",
"ht": "0",
"vt": "0"
}
},
{
"r": 2,
"c": 2,
"v": {
"mc": {
"r": 2,
"c": 2,
"rs": 3,
"cs": 2
},
"f": "=LINESPLINES(B3:B5,'pink',4,'avg','yellow','red','green',3)",
"spl": {
"shapes": {
"0": {
"id": 0,
"type": "Shape",
"args": [
0,
[
[
0,
20
],
[
0,
20
],
[
72,
51
],
[
144,
3
]
],
"pink",
null,
4
]
},
"1": {
"id": 1,
"type": "Rect",
"args": [
1,
0,
null,
144,
null,
null,
"yellow"
]
},
"2": {
"id": 2,
"type": "Circle",
"args": [
2,
72,
51,
3,
null,
"green",
null
]
},
"3": {
"id": 3,
"type": "Circle",
"args": [
3,
144,
3,
3,
null,
"red",
null
]
}
},
"shapeseq": [
0,
1,
2,
3
],
"offsetX": 0,
"offsetY": 5,
"pixelWidth": 147,
"pixelHeight": 55
}
}
},
{
"r": 2,
"c": 3,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 2,
"c": 4,
"v": {
"mc": {
"r": 2,
"c": 4,
"rs": 3,
"cs": 2
},
"f": "=COLUMNSPLINES(B3:B5,35,'red','green','auto','brown')",
"spl": {
"shapes": {
"0": {
"id": 0,
"type": "Rect",
"args": [
0,
98,
1,
13,
28,
"red",
"red"
]
},
"1": {
"id": 1,
"type": "Rect",
"args": [
1,
49,
30,
13,
20,
"green",
"green"
]
},
"2": {
"id": 2,
"type": "Rect",
"args": [
2,
0,
20,
13,
9,
"brown",
"brown"
]
}
},
"shapeseq": [
0,
1,
2
],
"offsetX": 0,
"offsetY": 0,
"pixelWidth": 147,
"pixelHeight": 60
}
}
},
{
"r": 2,
"c": 5,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 3,
"c": 0,
"v": {
"m": "2014-03-01",
"ct": {
"fa": "yyyy-MM-dd",
"t": "d"
},
"v": 41699
}
},
{
"r": 3,
"c": 1,
"v": {
"v": -60,
"ct": {
"fa": "General",
"t": "n"
},
"m": "-60",
"ht": "0",
"vt": "0"
}
},
{
"r": 3,
"c": 2,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 3,
"c": 3,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 3,
"c": 4,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 3,
"c": 5,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 4,
"c": 0,
"v": {
"m": "2014-04-01",
"ct": {
"fa": "yyyy-MM-dd",
"t": "d"
},
"v": 41730
}
},
{
"r": 4,
"c": 1,
"v": {
"v": 80,
"ct": {
"fa": "General",
"t": "n"
},
"m": "80",
"ht": "0",
"vt": "0"
}
},
{
"r": 4,
"c": 2,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 4,
"c": 3,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 4,
"c": 4,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 4,
"c": 5,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
}
],
"visibledatarow": [
26,
46,
66,
86,
106,
126,
146,
166,
186,
206,
226,
246,
266,
286,
306,
326,
346,
366,
386,
406,
426,
446,
466,
486,
506,
526,
546,
566,
586,
606,
626,
646,
666,
686,
706,
726,
746,
766,
786,
806,
826,
846,
866,
886,
906,
926,
946,
966,
986,
1006,
1026,
1046,
1066,
1086,
1106,
1126,
1146,
1166,
1186,
1206,
1226,
1246,
1266,
1286,
1306,
1326,
1346,
1366,
1386,
1406,
1426,
1446,
1466,
1486,
1506,
1526,
1546,
1566,
1586,
1606,
1626,
1646,
1666,
1686
],
"visibledatacolumn": [
102,
176,
250,
324,
398,
472,
546,
620,
694,
768,
842,
916,
990,
1064,
1138,
1212,
1286,
1360,
1434,
1508,
1582,
1656,
1730,
1804,
1878,
1952,
2026,
2100,
2174,
2248,
2322,
2396,
2470,
2544,
2618,
2692,
2766,
2840,
2914,
2988,
3062,
3136,
3210,
3284,
3358,
3432,
3506,
3580,
3654,
3728,
3802,
3876,
3950,
4024,
4098,
4172,
4246,
4320,
4394,
4468
],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"luckysheet_select_save": [
{
"row": [
0,
0
],
"column": [
0,
0
]
}
],
"luckysheet_selection_range": [],
"scrollLeft": 0,
"scrollTop": 0,
"calcChain": [
{
"r": 2,
"c": 2,
"index": "Sheet_a3wL60hb6ehl_1595574256825",
"func": [
true,
"",
"=LINESPLINES(B3:B5,'pink',4,'avg','yellow','red','green',3)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 2,
"c": 4,
"index": "Sheet_a3wL60hb6ehl_1595574256825",
"func": [
true,
"",
"=COLUMNSPLINES(B3:B5,35,'red','green','auto','brown')"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
}
]
}
export default sheetSparkline;

5
src/index.html

@ -27,13 +27,14 @@
import sheetComment from './demoData/sheetComment.js'
import sheetPivotTableData from './demoData/sheetPivotTableData.js'
import sheetPivotTable from './demoData/sheetPivotTable.js'
import sheetSparkline from './demoData/sheetSparkline.js'
$(function () {
luckysheet.create({
container: 'luckysheet',
lang: 'zh',
lang: 'en',
plugins: ['chart'],
data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable]
data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable]
})
})

4
src/index.js

@ -1,7 +1,9 @@
import './utils/math'
import { luckysheet } from './core'
import __firefox from './utils/polyfill'
debugger
// Prevent gulp warning: 'Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification'
// window.evall = window.eval;
// polyfill event in firefox
if(window.addEventListener && (navigator.userAgent.indexOf("Firefox") > 0)){
__firefox();

2
src/plugins/js/jquery-ui.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save