diff --git a/package-lock.json b/package-lock.json index c791fb5a7..d1812d28d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "0.0.1", "dependencies": { "@aw-labs/icons": "^0.0.0-15", - "@aw-labs/ui": "^0.0.0-15" + "@aw-labs/ui": "^0.0.0-15", + "echarts": "^5.3.3" }, "devDependencies": { "@playwright/test": "^1.22.2", @@ -2700,6 +2701,20 @@ "node": ">=12" } }, + "node_modules/echarts": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.3.tgz", + "integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==", + "dependencies": { + "tslib": "2.3.0", + "zrender": "5.3.2" + } + }, + "node_modules/echarts/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + }, "node_modules/electron-to-chromium": { "version": "1.4.71", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz", @@ -7766,6 +7781,19 @@ "engines": { "node": ">=12" } + }, + "node_modules/zrender": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.2.tgz", + "integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==", + "dependencies": { + "tslib": "2.3.0" + } + }, + "node_modules/zrender/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } }, "dependencies": { @@ -9830,6 +9858,22 @@ "webidl-conversions": "^7.0.0" } }, + "echarts": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.3.tgz", + "integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==", + "requires": { + "tslib": "2.3.0", + "zrender": "5.3.2" + }, + "dependencies": { + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + } + } + }, "electron-to-chromium": { "version": "1.4.71", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz", @@ -13527,6 +13571,21 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true + }, + "zrender": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.2.tgz", + "integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==", + "requires": { + "tslib": "2.3.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + } + } } } } diff --git a/package.json b/package.json index e23fd0f0a..5e8b0624a 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,9 @@ "e2e": "playwright test tests/e2e" }, "dependencies": { + "@aw-labs/icons": "^0.0.0-15", "@aw-labs/ui": "^0.0.0-15", - "@aw-labs/icons": "^0.0.0-15" + "echarts": "^5.3.3" }, "devDependencies": { "@playwright/test": "^1.22.2", diff --git a/src/lib/charts/echartDark.json b/src/lib/charts/echartDark.json new file mode 100644 index 000000000..a0c9bd8f3 --- /dev/null +++ b/src/lib/charts/echartDark.json @@ -0,0 +1,354 @@ +{ + "color": ["#00a7c3", "#F02E65", "#00BC5D", "#F38500", "#FF453A"], + "backgroundColor": "rgba(0,0,0,0)", + "textStyle": {}, + "title": { + "textStyle": { + "color": "#eeeeee" + }, + "subtextStyle": { + "color": "#aaaaaa" + } + }, + "line": { + "itemStyle": { + "borderWidth": 1 + }, + "lineStyle": { + "width": 2 + }, + "symbolSize": 4, + "symbol": "circle", + "smooth": true + }, + "radar": { + "itemStyle": { + "borderWidth": 1 + }, + "lineStyle": { + "width": 2 + }, + "symbolSize": 4, + "symbol": "circle", + "smooth": true + }, + "bar": { + "itemStyle": { + "barBorderWidth": "0", + "barBorderColor": "#444444" + } + }, + "pie": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + } + }, + "scatter": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + } + }, + "boxplot": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + } + }, + "parallel": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + } + }, + "sankey": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + } + }, + "funnel": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + } + }, + "gauge": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + } + }, + "candlestick": { + "itemStyle": { + "color": "#fd1050", + "color0": "#0cf49b", + "borderColor": "#fd1050", + "borderColor0": "#0cf49b", + "borderWidth": 1 + } + }, + "graph": { + "itemStyle": { + "borderWidth": "0", + "borderColor": "#444444" + }, + "lineStyle": { + "width": 1, + "color": "#aaaaaa" + }, + "symbolSize": 4, + "symbol": "circle", + "smooth": true, + "color": ["#dd6b66", "#759aa0", "#e69d87", "#f38500", "#ff453a"], + "label": { + "color": "#444444" + } + }, + "map": { + "itemStyle": { + "areaColor": "#eee", + "borderColor": "#444", + "borderWidth": 0.5 + }, + "label": { + "color": "#000" + }, + "emphasis": { + "itemStyle": { + "areaColor": "rgba(255,215,0,0.8)", + "borderColor": "#444", + "borderWidth": 1 + }, + "label": { + "color": "rgb(100,0,0)" + } + } + }, + "geo": { + "itemStyle": { + "areaColor": "#eee", + "borderColor": "#444", + "borderWidth": 0.5 + }, + "label": { + "color": "#000" + }, + "emphasis": { + "itemStyle": { + "areaColor": "rgba(255,215,0,0.8)", + "borderColor": "#444", + "borderWidth": 1 + }, + "label": { + "color": "rgb(100,0,0)" + } + } + }, + "categoryAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisLabel": { + "show": true, + "color": "#444444" + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": ["#444444"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["#eeeeee"] + } + } + }, + "valueAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisLabel": { + "show": true, + "color": "#666666" + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": ["#333333"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["#666666"] + } + } + }, + "logAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisLabel": { + "show": true, + "color": "#666666" + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": ["#333333"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["#666666"] + } + } + }, + "timeAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#333333" + } + }, + "axisLabel": { + "show": true, + "color": "#666666" + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": ["#333333"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["#666666"] + } + } + }, + "toolbox": { + "iconStyle": { + "borderColor": "#999999" + }, + "emphasis": { + "iconStyle": { + "borderColor": "#444444" + } + } + }, + "legend": { + "textStyle": { + "color": "#eeeeee" + } + }, + "tooltip": { + "axisPointer": { + "lineStyle": { + "color": "#444444", + "width": "1" + }, + "crossStyle": { + "color": "#444444", + "width": "1" + } + } + }, + "timeline": { + "lineStyle": { + "color": "#444444", + "width": 1 + }, + "itemStyle": { + "color": "#dd6b66", + "borderWidth": 1 + }, + "controlStyle": { + "color": "#444444", + "borderColor": "#444444", + "borderWidth": 0.5 + }, + "checkpointStyle": { + "color": "#e43c59", + "borderColor": "#c23531" + }, + "label": { + "color": "#eeeeee" + }, + "emphasis": { + "itemStyle": { + "color": "#a9334c" + }, + "controlStyle": { + "color": "#444444", + "borderColor": "#444444", + "borderWidth": 0.5 + }, + "label": { + "color": "#eeeeee" + } + } + }, + "visualMap": { + "color": ["#bf444c", "#d88273", "#f6efa6"] + }, + "dataZoom": { + "backgroundColor": "rgba(47,69,84,0)", + "dataBackgroundColor": "rgba(255,255,255,0.3)", + "fillerColor": "rgba(167,183,204,0.4)", + "handleColor": "#a7b7cc", + "handleSize": "100%", + "textStyle": { + "color": "#eeeeee" + } + }, + "markPoint": { + "label": { + "color": "#444444" + }, + "emphasis": { + "label": { + "color": "#444444" + } + } + } +} diff --git a/src/lib/charts/echartLight.json b/src/lib/charts/echartLight.json new file mode 100644 index 000000000..e334832c4 --- /dev/null +++ b/src/lib/charts/echartLight.json @@ -0,0 +1,348 @@ +{ + "color": ["#00a7c3", "#F02E65", "#00BC5D", "#F38500", "#FF453A"], + "backgroundColor": "rgba(255,255,255,0)", + "textStyle": {}, + "title": { + "textStyle": { + "color": "#373b4d" + }, + "subtextStyle": { + "color": "#616b7c" + } + }, + "line": { + "itemStyle": { + "borderWidth": 1 + }, + "lineStyle": { + "width": 2 + }, + "symbolSize": 4, + "symbol": "emptyCircle", + "smooth": false + }, + "radar": { + "itemStyle": { + "borderWidth": 1 + }, + "lineStyle": { + "width": 2 + }, + "symbolSize": 4, + "symbol": "emptyCircle", + "smooth": false + }, + "bar": { + "itemStyle": { + "barBorderWidth": 0, + "barBorderColor": "#ccc" + } + }, + "pie": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "scatter": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "boxplot": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "parallel": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "sankey": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "funnel": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "gauge": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "candlestick": { + "itemStyle": { + "color": "#eb5454", + "color0": "#47b262", + "borderColor": "#eb5454", + "borderColor0": "#47b262", + "borderWidth": 1 + } + }, + "graph": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + }, + "lineStyle": { + "width": 1, + "color": "#aaa" + }, + "symbolSize": 4, + "symbol": "emptyCircle", + "smooth": false, + "color": ["#007187", "#da1a5b", "#fac858", "#ee6666", "#73c0de"], + "label": { + "color": "#eee" + } + }, + "map": { + "itemStyle": { + "areaColor": "#eee", + "borderColor": "#444", + "borderWidth": 0.5 + }, + "label": { + "color": "#000" + }, + "emphasis": { + "itemStyle": { + "areaColor": "rgba(255,215,0,0.8)", + "borderColor": "#444", + "borderWidth": 1 + }, + "label": { + "color": "rgb(100,0,0)" + } + } + }, + "geo": { + "itemStyle": { + "areaColor": "#eee", + "borderColor": "#444", + "borderWidth": 0.5 + }, + "label": { + "color": "#000" + }, + "emphasis": { + "itemStyle": { + "areaColor": "rgba(255,215,0,0.8)", + "borderColor": "#444", + "borderWidth": 1 + }, + "label": { + "color": "rgb(100,0,0)" + } + } + }, + "categoryAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisLabel": { + "show": true, + "color": "#6E7079" + }, + "splitLine": { + "show": false, + "lineStyle": { + "color": ["#E0E6F1"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"] + } + } + }, + "valueAxis": { + "axisLine": { + "show": false, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisTick": { + "show": false, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisLabel": { + "show": true, + "color": "#6E7079" + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": ["#E0E6F1"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"] + } + } + }, + "logAxis": { + "axisLine": { + "show": false, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisTick": { + "show": false, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisLabel": { + "show": true, + "color": "#6E7079" + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": ["#E0E6F1"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"] + } + } + }, + "timeAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#6E7079" + } + }, + "axisLabel": { + "show": true, + "color": "#6E7079" + }, + "splitLine": { + "show": false, + "lineStyle": { + "color": ["#E0E6F1"] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"] + } + } + }, + "toolbox": { + "iconStyle": { + "borderColor": "#999" + }, + "emphasis": { + "iconStyle": { + "borderColor": "#666" + } + } + }, + "legend": { + "textStyle": { + "color": "#333" + } + }, + "tooltip": { + "axisPointer": { + "lineStyle": { + "color": "#ccc", + "width": 1 + }, + "crossStyle": { + "color": "#ccc", + "width": 1 + } + } + }, + "timeline": { + "lineStyle": { + "color": "#DAE1F5", + "width": 2 + }, + "itemStyle": { + "color": "#A4B1D7", + "borderWidth": 1 + }, + "controlStyle": { + "color": "#A4B1D7", + "borderColor": "#A4B1D7", + "borderWidth": 1 + }, + "checkpointStyle": { + "color": "#316bf3", + "borderColor": "fff" + }, + "label": { + "color": "#A4B1D7" + }, + "emphasis": { + "itemStyle": { + "color": "#FFF" + }, + "controlStyle": { + "color": "#A4B1D7", + "borderColor": "#A4B1D7", + "borderWidth": 1 + }, + "label": { + "color": "#A4B1D7" + } + } + }, + "visualMap": { + "color": ["#bf444c", "#d88273", "#f6efa6"] + }, + "dataZoom": { + "handleSize": "undefined%", + "textStyle": {} + }, + "markPoint": { + "label": { + "color": "#eee" + }, + "emphasis": { + "label": { + "color": "#eee" + } + } + } +} diff --git a/src/lib/charts/echarts.svelte b/src/lib/charts/echarts.svelte new file mode 100644 index 000000000..deeec5c7b --- /dev/null +++ b/src/lib/charts/echarts.svelte @@ -0,0 +1,134 @@ + + +
+ + diff --git a/src/lib/charts/index.ts b/src/lib/charts/index.ts index b5ece6e20..50fb2499f 100644 --- a/src/lib/charts/index.ts +++ b/src/lib/charts/index.ts @@ -1 +1 @@ -export { default as Line } from './line.svelte'; +export { default as Chart } from './echarts.svelte'; diff --git a/src/lib/charts/line.svelte b/src/lib/charts/line.svelte deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/routes/console/[project]/index.svelte b/src/routes/console/[project]/index.svelte index 8cdc0cd74..10eec2fe8 100644 --- a/src/routes/console/[project]/index.svelte +++ b/src/routes/console/[project]/index.svelte @@ -5,7 +5,7 @@ import { project } from './store'; import { Card, List, ListItem } from '$lib/components'; import { Cover, Container } from '$lib/layout'; - import { Line } from '$lib/charts'; + // import { Line } from '$lib/charts'; // import { page } from '$app/stores'; import { base } from '$app/paths'; import CreatePlatform from './_createPlatform.svelte'; @@ -54,7 +54,7 @@Count of users over time
+Count of users create, read, update and delete operations over time
+