From c3c19a2620188db0bf372d37b179a77774c94dd4 Mon Sep 17 00:00:00 2001 From: sinisaos Date: Sat, 13 May 2023 14:59:39 +0200 Subject: [PATCH 01/14] add charts support --- admin_ui/package-lock.json | 79 ++++++++++++- admin_ui/package.json | 3 + admin_ui/src/components/ChartsNav.vue | 31 +++++ admin_ui/src/components/ChartsPage.vue | 44 +++++++ admin_ui/src/components/SidebarNav.vue | 27 ++++- admin_ui/src/fontawesome.ts | 2 + admin_ui/src/interfaces.ts | 7 ++ admin_ui/src/main.ts | 5 +- admin_ui/src/router.ts | 7 ++ admin_ui/src/store.ts | 15 +++ admin_ui/src/views/GetCharts.vue | 27 +++++ docs/source/charts/examples/app.py | 38 ++++++ docs/source/charts/examples/home/tables.py | 9 ++ docs/source/charts/images/chart.png | Bin 0 -> 19323 bytes docs/source/charts/images/charts_sidebar.png | Bin 0 -> 26551 bytes docs/source/charts/index.rst | 32 +++++ docs/source/index.rst | 1 + piccolo_admin/endpoints.py | 117 ++++++++++++++++++- piccolo_admin/example.py | 17 +++ piccolo_admin/translations/data.py | 12 ++ tests/test_endpoints.py | 83 ++++++++++++- 21 files changed, 547 insertions(+), 9 deletions(-) create mode 100644 admin_ui/src/components/ChartsNav.vue create mode 100644 admin_ui/src/components/ChartsPage.vue create mode 100644 admin_ui/src/views/GetCharts.vue create mode 100644 docs/source/charts/examples/app.py create mode 100644 docs/source/charts/examples/home/tables.py create mode 100644 docs/source/charts/images/chart.png create mode 100644 docs/source/charts/images/charts_sidebar.png create mode 100644 docs/source/charts/index.rst diff --git a/admin_ui/package-lock.json b/admin_ui/package-lock.json index 3c8d1c1f..74bdf496 100644 --- a/admin_ui/package-lock.json +++ b/admin_ui/package-lock.json @@ -14,13 +14,16 @@ "@fortawesome/vue-fontawesome": "^0.1.10", "@types/js-cookie": "^2.2.6", "axios": "^0.21.2", + "chart.js": "^4.3.0", "core-js": "^3.6.5", "flatpickr": "^4.6.9", + "highcharts": "^11.0.1", "is-svg": "^4.3.1", "js-cookie": "^2.2.1", "json-bigint": "^1.0.0", "ssri": "^8.0.1", "vue": "^2.7.14", + "vue-chartkick": "^0.6.1", "vue-class-component": "^7.2.6", "vue-flatpickr-component": "^8.1.7", "vue-i18n": "^8.27.2", @@ -2431,6 +2434,11 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@kurkle/color": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz", + "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==" + }, "node_modules/@mdx-js/mdx": { "version": "1.6.22", "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-1.6.22.tgz", @@ -8860,6 +8868,22 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/chart.js": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.3.0.tgz", + "integrity": "sha512-ynG0E79xGfMaV2xAHdbhwiPLczxnNNnasrmPEXriXsPJGjmhOBYzFVEsB65w2qMDz+CaBJJuJD0inE/ab/h36g==", + "dependencies": { + "@kurkle/color": "^0.3.0" + }, + "engines": { + "pnpm": ">=7" + } + }, + "node_modules/chartkick": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/chartkick/-/chartkick-3.2.1.tgz", + "integrity": "sha512-zV0kUeZNqrX28AmPt10QEDXHKadbVFOTAFkCMyJifHzGFkKzGCDXxVR8orZ0fC1HbePzRn5w6kLCOVxDQbMUCg==" + }, "node_modules/check-types": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/check-types/-/check-types-8.0.3.tgz", @@ -10750,7 +10774,6 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -13824,6 +13847,11 @@ "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", "dev": true }, + "node_modules/highcharts": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/highcharts/-/highcharts-11.0.1.tgz", + "integrity": "sha512-KRwNwm6kJsp3JxNSpORuWLzvLnPuqCR3n0qbGjw+0m6MIxrlkUWnFaZJ2uXjMur6j3RUC66te36tldlSheYydQ==" + }, "node_modules/highlight.js": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", @@ -23583,6 +23611,19 @@ "csstype": "^3.1.0" } }, + "node_modules/vue-chartkick": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/vue-chartkick/-/vue-chartkick-0.6.1.tgz", + "integrity": "sha512-upUJKnx3irrRiMWudCkEVRpFvfy1hiVDKqv1e11Ap0qcFYCHJ231+SRDmQPcCypnKhfwc/Tm6REvsHkqRfc+Zg==", + "dependencies": { + "chartkick": "^3.2.0", + "deep-equal": "^1.0.1", + "deepmerge": "^4.2.0" + }, + "peerDependencies": { + "vue": ">=2.0.0" + } + }, "node_modules/vue-class-component": { "version": "7.2.6", "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.2.6.tgz", @@ -27495,6 +27536,11 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@kurkle/color": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz", + "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==" + }, "@mdx-js/mdx": { "version": "1.6.22", "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-1.6.22.tgz", @@ -32466,6 +32512,19 @@ "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", "dev": true }, + "chart.js": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.3.0.tgz", + "integrity": "sha512-ynG0E79xGfMaV2xAHdbhwiPLczxnNNnasrmPEXriXsPJGjmhOBYzFVEsB65w2qMDz+CaBJJuJD0inE/ab/h36g==", + "requires": { + "@kurkle/color": "^0.3.0" + } + }, + "chartkick": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/chartkick/-/chartkick-3.2.1.tgz", + "integrity": "sha512-zV0kUeZNqrX28AmPt10QEDXHKadbVFOTAFkCMyJifHzGFkKzGCDXxVR8orZ0fC1HbePzRn5w6kLCOVxDQbMUCg==" + }, "check-types": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/check-types/-/check-types-8.0.3.tgz", @@ -33935,8 +33994,7 @@ "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" }, "default-browser-id": { "version": "1.0.4", @@ -36320,6 +36378,11 @@ "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", "dev": true }, + "highcharts": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/highcharts/-/highcharts-11.0.1.tgz", + "integrity": "sha512-KRwNwm6kJsp3JxNSpORuWLzvLnPuqCR3n0qbGjw+0m6MIxrlkUWnFaZJ2uXjMur6j3RUC66te36tldlSheYydQ==" + }, "highlight.js": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", @@ -44144,6 +44207,16 @@ } } }, + "vue-chartkick": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/vue-chartkick/-/vue-chartkick-0.6.1.tgz", + "integrity": "sha512-upUJKnx3irrRiMWudCkEVRpFvfy1hiVDKqv1e11Ap0qcFYCHJ231+SRDmQPcCypnKhfwc/Tm6REvsHkqRfc+Zg==", + "requires": { + "chartkick": "^3.2.0", + "deep-equal": "^1.0.1", + "deepmerge": "^4.2.0" + } + }, "vue-class-component": { "version": "7.2.6", "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.2.6.tgz", diff --git a/admin_ui/package.json b/admin_ui/package.json index 4f34b8cf..53bedc60 100644 --- a/admin_ui/package.json +++ b/admin_ui/package.json @@ -18,13 +18,16 @@ "@fortawesome/vue-fontawesome": "^0.1.10", "@types/js-cookie": "^2.2.6", "axios": "^0.21.2", + "chart.js": "^4.3.0", "core-js": "^3.6.5", "flatpickr": "^4.6.9", + "highcharts": "^11.0.1", "is-svg": "^4.3.1", "js-cookie": "^2.2.1", "json-bigint": "^1.0.0", "ssri": "^8.0.1", "vue": "^2.7.14", + "vue-chartkick": "^0.6.1", "vue-class-component": "^7.2.6", "vue-flatpickr-component": "^8.1.7", "vue-i18n": "^8.27.2", diff --git a/admin_ui/src/components/ChartsNav.vue b/admin_ui/src/components/ChartsNav.vue new file mode 100644 index 00000000..3f2c1d70 --- /dev/null +++ b/admin_ui/src/components/ChartsNav.vue @@ -0,0 +1,31 @@ + + + \ No newline at end of file diff --git a/admin_ui/src/components/ChartsPage.vue b/admin_ui/src/components/ChartsPage.vue new file mode 100644 index 00000000..0a7ae2fd --- /dev/null +++ b/admin_ui/src/components/ChartsPage.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/admin_ui/src/components/SidebarNav.vue b/admin_ui/src/components/SidebarNav.vue index b715a428..09c9d195 100644 --- a/admin_ui/src/components/SidebarNav.vue +++ b/admin_ui/src/components/SidebarNav.vue @@ -33,6 +33,23 @@

+ +

+ {{ $t("Charts") }} + + + + +

+ @@ -40,21 +57,27 @@ import Vue from "vue" import TableNav from "./TableNav.vue" import FormNav from "./FormNav.vue" +import ChartsNav from "./ChartsNav.vue" export default Vue.extend({ data() { return { isHiddenTables: false, - isHiddenForms: false + isHiddenForms: false, + isHiddenCharts: false } }, components: { TableNav, - FormNav + FormNav, + ChartsNav }, computed: { formConfigs() { return this.$store.state.formConfigs + }, + chartConfigs() { + return this.$store.state.chartConfigs } } }) diff --git a/admin_ui/src/fontawesome.ts b/admin_ui/src/fontawesome.ts index 91ee50c8..9c19a5a4 100644 --- a/admin_ui/src/fontawesome.ts +++ b/admin_ui/src/fontawesome.ts @@ -11,6 +11,7 @@ import { faBars, faCaretUp, faCaretDown, + faChartBar, faCheck, faCircleNotch, faCogs, @@ -53,6 +54,7 @@ library.add( faBars, faCaretUp, faCaretDown, + faChartBar, faCheck, faCircleNotch, faCogs, diff --git a/admin_ui/src/interfaces.ts b/admin_ui/src/interfaces.ts index 358c14e2..dfad87d1 100644 --- a/admin_ui/src/interfaces.ts +++ b/admin_ui/src/interfaces.ts @@ -145,3 +145,10 @@ export interface FormConfig { slug: string description: string } + +export interface ChartConfig { + title: string + chart_slug: string + chart_type: string + data: any +} diff --git a/admin_ui/src/main.ts b/admin_ui/src/main.ts index 3197ba20..d69a17a0 100644 --- a/admin_ui/src/main.ts +++ b/admin_ui/src/main.ts @@ -4,6 +4,8 @@ import router from "./router" import store from "./store" import i18n from "./i18n" import "./fontawesome" +import Chartkick from 'vue-chartkick' +import Highcharts from 'highcharts' /*****************************************************************************/ @@ -30,7 +32,7 @@ axios.defaults.transformResponse = [ if (typeof data === "string") { try { data = JSONBig.parse(data) - } catch (e) {} + } catch (e) { } } return data } @@ -45,6 +47,7 @@ Vue.filter("readable", function (value) { /*****************************************************************************/ Vue.config.productionTip = false +Vue.use(Chartkick.use(Highcharts)) new Vue({ i18n, diff --git a/admin_ui/src/router.ts b/admin_ui/src/router.ts index e68d53f2..0eb3bc40 100644 --- a/admin_ui/src/router.ts +++ b/admin_ui/src/router.ts @@ -8,6 +8,7 @@ import Login from './views/Login.vue' import ChangePassword from './views/ChangePassword.vue' import RowListing from './views/RowListing.vue' import AddForm from './views/AddForm.vue' +import GetCharts from './views/GetCharts.vue' Vue.use(Router) @@ -37,6 +38,12 @@ export default new Router({ component: AddForm, props: true }, + { + path: '/charts/:chartSlug/', + name: 'getCharts', + component: GetCharts, + props: true + }, { path: '/:tableName/', name: 'rowListing', diff --git a/admin_ui/src/store.ts b/admin_ui/src/store.ts index 262044f4..7e81da1b 100644 --- a/admin_ui/src/store.ts +++ b/admin_ui/src/store.ts @@ -34,6 +34,7 @@ export default new Vuex.Store({ tableNames: [], tableGroups: {}, formConfigs: [] as i.FormConfig[], + chartConfigs: [] as i.ChartConfig[], user: undefined, loadingStatus: false }, @@ -62,6 +63,9 @@ export default new Vuex.Store({ updateFormSchema(state, formSchema) { state.formSchema = formSchema }, + updateChartConfigs(state, value) { + state.chartConfigs = value + }, updateApiResponseMessage(state, message: i.APIResponseMessage) { state.apiResponseMessage = message }, @@ -113,6 +117,17 @@ export default new Vuex.Store({ context.commit("updateFormSchema", response.data) return response }, + async fetchChartConfigs(context) { + const response = await axios.get(`${BASE_URL}charts/`) + context.commit("updateChartConfigs", response.data) + }, + async fetchChartConfig(context, chartSlug: string) { + const response = await axios.get( + `${BASE_URL}charts/${chartSlug}/` + ) + context.commit("updateChartConfigs", response.data) + return response + }, /*********************************************************************/ diff --git a/admin_ui/src/views/GetCharts.vue b/admin_ui/src/views/GetCharts.vue new file mode 100644 index 00000000..51ab9ab8 --- /dev/null +++ b/admin_ui/src/views/GetCharts.vue @@ -0,0 +1,27 @@ + + + + + + + diff --git a/docs/source/charts/examples/app.py b/docs/source/charts/examples/app.py new file mode 100644 index 00000000..c0cb9a2a --- /dev/null +++ b/docs/source/charts/examples/app.py @@ -0,0 +1,38 @@ +from fastapi import FastAPI +from fastapi.routing import Mount +from home.tables import Director, Movie + +from piccolo_admin.endpoints import ChartConfig, create_admin + + +# count directors movies +async def director_movie_count(): + movies = await Movie.select( + Movie.director.name.as_alias("director"), + Count(Movie.id), + ).group_by(Movie.director) + # Flatten the response so it's a list of lists + # like [['George Lucas', 3], ...] + return [[i["director"], i["count"]] for i in movies] + + +director_chart = ChartConfig( + title="Movie count", + chart_type="Pie", + data=director_movie_count, +) + + +app = FastAPI( + routes=[ + Mount( + "/admin/", + create_admin( + tables=[Director, Movie], + charts=[director_chart], + ), + ), + ], +) + +# For Starlette it is identical, just `app = Starlette(...)` diff --git a/docs/source/charts/examples/home/tables.py b/docs/source/charts/examples/home/tables.py new file mode 100644 index 00000000..dd033e47 --- /dev/null +++ b/docs/source/charts/examples/home/tables.py @@ -0,0 +1,9 @@ +from piccolo.columns.column_types import Varchar, ForeignKey +from piccolo.table import Table + +class Director(Table): + name = Varchar() + +class Movie(Table): + title = Varchar() + director = ForeignKey(references=Director) \ No newline at end of file diff --git a/docs/source/charts/images/chart.png b/docs/source/charts/images/chart.png new file mode 100644 index 0000000000000000000000000000000000000000..641fd4f696405903592ccf6c8a4a41d6ec5a2c08 GIT binary patch literal 19323 zcmdqJS6EX~*De~cfS`y+c(pG?>8-3MZP#hk1Ruaxc8U&0GyuRX0}QEzbF1kWwT*0{_`;@apw%6%}jQ zhFmK?C<9-;gd&$4O@}g=4$VTPJy&uTStXchm3oMIV?Nb7e4;Syu@{Q5BLj4KO!v$m z_y9>LL5)bNv2xRqeye%y3J9b!Vyp^`q4od2`jIi2ETUZR(emO(=lViB!>uCc8fV+c zud*#jAHjfx-Ra)_$iT9|3XFnKzV1FS#r@^_Zq5yXLWjt?0|~pe^sxuM4|*+Ov$7{d ztjOA40UG-j?Gm^xf_tOeUlKp%vCZ0R6|PHRd&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GPSn)(>aQ zmxnV(h3TA~o$}oiW{8X^-fs4(wGrvfOvzn+39>2sUgf9d~cr4L{C>WHM)ojvm)Bqzh)fFNQA~0uDyA!uCd*g?96ls)-3m>Z8G}VLX zAgtMLx;!Jhdyh2G#>c0_F8sX24iP3l3bP?lQ9Y_(4l_y5$meRz@lzs85K`xhe)eqo zrDcY0RFrV>%Kx+SxmPBdTMOA;VtM6akzqT;^-g7bk zc!z?AEO&QhELyi$FLv%+!==lLmRdJlZ0BH|5U_Xe-$_dj|F>Ap{M-L^e*3MfcV+!Q zgeafidVOj3!Rtn)k9!|KEwP$1=~NL=M=uAfK~hQSv6RZ#s>fgXOA`J|?yY)JJGb|X zYSo&S83qRz?}-f0_$D(y?Y!*rDvl|Kms$DHEQ{pl1(sx8cI|+v7j}u&mUXZe^WZ^*m&IpG@bgv-RaK&b*W>EjxDQ zs%Ut4x{s~x-|2ro+sZ9hd%8qJ{rKwaWlOZmqgHL&ym!~9RVg>iVt_`ds#-=yu{V4M zdMP9*$d+ltdqFPt~8PEU@hq1&Z}iGksO zMcH-G@g*{Xpo2Od1Fd9WkZ^~{D1kP89s{N-VB+fI0G=|`PzX#l3=BQWptFWXwTy-s d;RN%awZ7ueMX8O+>A-};;OXk;vd$@?2>?ptVygfE literal 0 HcmV?d00001 diff --git a/docs/source/charts/images/charts_sidebar.png b/docs/source/charts/images/charts_sidebar.png new file mode 100644 index 0000000000000000000000000000000000000000..f1202fdbd16933f4fa9fed6bda65dd97f09a89f9 GIT binary patch literal 26551 zcmcG#byQqW5GG1OfB-=f+=IKz;4UFJ1h?R>gKN+vxXa+~?(XjHgF6iFwv*q!J^R=G zvG1KX=gzq!_g2@fuIjF@>+8RY@=_>B_((7?FeuXB#Fb%S-pj$jytDlX5B(*TjzJfC z`T!J_{_zp|^7?4}2L|RVjI_AO54Y5lHD524xtIHk1sbkr7A%TSHgQWKAS9cRdJ$w* zKmX^X_a;A`e>y)u3ZDwnS6+w-DX-pd<~C|hA#!UcDL;H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 zm?xFG0G*=KON|P*R!n|n-*G(YSkcf+?(L;HSu|SFPKlLDx9F0Y+;CG`>gxg%^4rTK zip?Kn@aX~5IsM=N5#WHbx)iVuPdPy~NZDt(|AF5QL;W}8R1f&?$jS29VbY==`~e!j z{J-bOA@#dZ@IDL|7y~rsHWQzECu}cZ zuoA-;?eOa>68p|JFI_9!YxiDRs!84m@yCEWx|Uv;iv{lJF5%)d@tAzHptK7#w{-kc z$Kxuf1Dbf8UERA$gW?M}H-HpsC>wB7VR_$(u=ycO>%?eqBq7t_-K zl=xQMn|K5x2bYIcQA$K6uDB3n&J~XbLJ_`sUZuVjgKefr8TmI-FMFUH=4)A5ux&{u z(kfQhHuZ8x)*;Jh>(k~{j7J6T`kvb>L0hNvggxRVAz*44H^EY7Yos3?ivLbH%c zFO>;b>1YK@IYsumL_uOM8{96_Ela&B2~d7^QXo8eXM`m%*7Eu}z-k^1+vm^7ZMcz(gNjpJI|Nd`Dgt zn?f`y^F;YLw^12f}SW#<~n<}6}XsHfAbzp>u^(WePnJPgdr zoP}2~#WKr}ef~1-Az5Fb(Es4m1uHeR`QO;-W!w`v2eOjfN-kt&1Qrx5n(UvHjdn*a zmh0?%x`tYnGIU5Qa>-UMIuoz=5K^H{D&D$7KX=t8;)0J!6WX=)U-`uIc?vZ6i9pwvF(Ul!g3B%Zrr4=ov zdsg~$n*8MQfOxoep0)a)p);;3b|7m7oDUCUMMl_hC3gmIazbcaXrsH&XJsTBC;{)Kvr?sy25 ztx&>0607Eb8%X8iPhXMY%|5B77WP7>TLL;j=86}+WnJB6B@B~ee6P`lTi6WrNLp&~ z4Z5FgJ_f4MVa2?FOq1{`T|6@bA|0)&fzgDCA k|DXPUN$mT7^F>0(Z-HdGPyhe` literal 0 HcmV?d00001 diff --git a/docs/source/charts/index.rst b/docs/source/charts/index.rst new file mode 100644 index 00000000..5ea98881 --- /dev/null +++ b/docs/source/charts/index.rst @@ -0,0 +1,32 @@ +.. _Charts: + +Charts +====== + +Piccolo Admin can display different types of charts based on yours +data. Five chart types are supported: ``Pie``, ``Line``, ``Column``, +``Bar`` and ``Area``. + +Here's an example of charts usage, using FastAPI: + +.. literalinclude:: ./examples/app.py + +Piccolo Admin will then show a charts in the UI. + +.. image:: ./images/charts_sidebar.png + +.. image:: ./images/chart.png + +.. warning:: + + The data format must be a ``list of lists`` + (eg. ``[["Male", 7], ["Female", 3]]``). + +------------------------------------------------------------------------------- + +Source +------ + +.. currentmodule:: piccolo_admin.endpoints + +.. autoclass:: ChartConfig diff --git a/docs/source/index.rst b/docs/source/index.rst index 8ea42457..74def468 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -46,6 +46,7 @@ Table of Contents ../help_text/index ../table_config/index ../custom_forms/index + ../charts/index ../actions/index ../media_storage/index ../internationalization/index diff --git a/piccolo_admin/endpoints.py b/piccolo_admin/endpoints.py index ba02de98..0c951fc0 100644 --- a/piccolo_admin/endpoints.py +++ b/piccolo_admin/endpoints.py @@ -349,6 +349,60 @@ class FormConfigResponseModel(BaseModel): description: t.Optional[str] = None +@dataclass +class ChartConfig: + """ + Used to specify charts, which are passed into ``create_admin``. + + :param title: + This will be displayed in the UI in the sidebar. + :param chart_slug: + This determines which chart will be displayed. + :param chart_type: + Available chart types. There are five types: ``Pie``, ``Line``, + ``Column``, ``Bar`` and ``Area``. + :param data: + The data to be passed to the admin ui. The data format must be + a ``list of lists`` (eg. ``[["Male", 7], ["Female", 3]]``). + + Here's a full example: + + .. code-block:: python + + async def director_movie_count(): + movies = await Movie.select( + Movie.director.name.as_alias("director"), + Count(Movie.id) + ).group_by( + Movie.director + ) + # Flatten the response so it's a list of lists + # like [['George Lucas', 3], ...] + return [[i['director'], i['count']] for i in movies] + + director_chart = ChartConfig( + title='Movie count', + chart_type="Pie", # or Bar or Line etc. + data=director_movie_count, + + create_admin(charts=[director_chart]) + + """ + + def __init__(self, title: str, chart_type: str, data: t.List[t.Any]): + self.title = title + self.chart_slug = self.title.replace(" ", "-").lower() + self.chart_type = chart_type + self.data = data + + +class ChartConfigResponseModel(BaseModel): + title: str + chart_slug: str + chart_type: str + data: t.List[t.Any] + + def handle_auth_exception(request: Request, exc: Exception): return JSONResponse({"error": "Auth failed"}, status_code=401) @@ -401,6 +455,7 @@ def __init__( translations: t.List[Translation] = None, allowed_hosts: t.Sequence[str] = [], debug: bool = False, + charts: t.List[ChartConfig] = [], ) -> None: super().__init__( title=site_name, @@ -484,6 +539,10 @@ def __init__( self.site_name = site_name self.forms = forms self.read_only = read_only + self.charts = charts + self.chart_config_map = { + chart.chart_slug: chart for chart in self.charts + } self.form_config_map = {form.slug: form for form in self.forms} with open(os.path.join(ASSET_PATH, "index.html")) as f: @@ -584,6 +643,22 @@ def __init__( tags=["Forms"], ) + private_app.add_api_route( + path="/charts/", + endpoint=self.get_charts, # type: ignore + methods=["GET"], + tags=["Charts"], + response_model=t.List[ChartConfigResponseModel], + ) + + private_app.add_api_route( + path="/charts/{chart_slug:str}/", + endpoint=self.get_single_chart, # type: ignore + methods=["GET"], + tags=["Charts"], + response_model=ChartConfigResponseModel, + ) + private_app.add_api_route( path="/user/", endpoint=self.get_user, # type: ignore @@ -836,6 +911,38 @@ def get_user(self, request: Request) -> UserResponseModel: user_id=str(request.user.user_id), ) + ########################################################################### + # Custom charts + + def get_charts(self) -> t.List[ChartConfigResponseModel]: + """ + Returns all charts registered with the admin. + """ + return [ + ChartConfigResponseModel( + title=chart.title, + chart_slug=chart.chart_slug, + chart_type=chart.chart_type, + data=chart.data, + ) + for chart in self.charts + ] + + def get_single_chart(self, chart_slug: str) -> ChartConfigResponseModel: + """ + Returns single chart. + """ + chart = self.chart_config_map.get(chart_slug, None) + if chart is None: + raise HTTPException(status_code=404, detail="No such chart found") + else: + return ChartConfigResponseModel( + title=chart.title, + chart_slug=chart.chart_slug, + chart_type=chart.chart_type, + data=chart.data, + ) + ########################################################################### # Custom forms @@ -845,7 +952,9 @@ def get_forms(self) -> t.List[FormConfigResponseModel]: """ return [ FormConfigResponseModel( - name=form.name, slug=form.slug, description=form.description + name=form.name, + slug=form.slug, + description=form.description, ) for form in self.forms ] @@ -1034,6 +1143,7 @@ def create_admin( auto_include_related: bool = True, allowed_hosts: t.Sequence[str] = [], debug: bool = False, + charts: t.List[ChartConfig] = [], ): """ :param tables: @@ -1136,6 +1246,10 @@ def create_admin( If ``True``, debug mode is enabled. Any unhandled exceptions will return a stack trace, rather than a generic 500 error. Don't use this in production! + :param charts: + For each :class:`ChartConfig ` + specified, a chart will automatically be rendered in the user interface, + accessible via the sidebar. """ # noqa: E501 auth_table = auth_table or BaseUser @@ -1181,4 +1295,5 @@ def create_admin( translations=translations, allowed_hosts=allowed_hosts, debug=debug, + charts=charts, ) diff --git a/piccolo_admin/example.py b/piccolo_admin/example.py index 8f49d8f6..6e1ff36e 100644 --- a/piccolo_admin/example.py +++ b/piccolo_admin/example.py @@ -47,6 +47,7 @@ from starlette.requests import Request from piccolo_admin.endpoints import ( + ChartConfig, FormConfig, OrderBy, TableConfig, @@ -440,6 +441,22 @@ def booking_endpoint(request: Request, data: BookingModel) -> str: ], auth_table=User, session_table=Sessions, + charts=[ + ChartConfig( + title="Movie count", + chart_type="Pie", + data=[ + ["George Lucas", 4], + ["Peter Jackson", 6], + ["Ron Howard", 1], + ], + ), + ChartConfig( + title="Director gender", + chart_type="Column", + data=[["Male", 7], ["Female", 3]], + ), + ], ) diff --git a/piccolo_admin/translations/data.py b/piccolo_admin/translations/data.py index c8f41606..4f0c0f19 100644 --- a/piccolo_admin/translations/data.py +++ b/piccolo_admin/translations/data.py @@ -35,6 +35,7 @@ "Back to home page": "Back to home page", "Back": "Back", "Change password": "Change password", + "Charts": "Charts", "Clear filters": "Clear filters", "Close": "Close", "Create": "Create", @@ -104,6 +105,7 @@ "Back to home page": "Yn ôl i'r dudalen gartref", "Back": "Ol", "Change password": "Newid cyfrinair", + "Charts": "Siartiau", "Clear filters": "Clirio hidlwyr", "Close": "Cau", "Create": "Creu", @@ -172,6 +174,7 @@ "Back to home page": "Vrati se na početnu stranicu", "Back": "Natrag", "Change password": "Promijeni lozinku", + "Charts": "Grafikoni", "Clear filters": "Obriši filtere", "Close": "Zatvori", "Create": "Kreiraj", @@ -241,6 +244,7 @@ "Back to home page": "Voltar à página inicial", "Back": "Voltar atrás", "Change password": "Mudar senha", + "Charts": "Gráficos", "Clear filters": "Limpar Filtros", "Close": "Fechar", "Create": "Criar", @@ -310,6 +314,7 @@ "Back to home page": "Zurück zur Startseite", "Back": "Zurück", "Change password": "Passwort ändern", + "Charts": "Diagramme", "Clear filters": "Filter löschen", "Close": "Schließen", "Create": "Anlegen", @@ -379,6 +384,7 @@ "Back to home page": "Retour à la page d'accueil", "Back": "Retour", "Change password": "Changer le mot de passe", + "Charts": "Graphiques", "Clear filters": "Supprimer les filtres", "Close": "Fermer", "Create": "Créer", @@ -448,6 +454,7 @@ "Back to home page": "Volver a la página de inicio", "Back": "atrás", "Change password": "Cambia la contraseña", + "Charts": "Gráficos", "Clear filters": "Eliminar filtros", "Close": "Cerca", "Create": "Crear", @@ -516,6 +523,7 @@ "Back to home page": "Takaisin pääsivulle", "Back": "Takaisin", "Change password": "Vaihda salasana", + "Charts": "Kaaviot", "Clear filters": "Nollaa suodattimet", "Close": "Sulje", "Create": "Luo", @@ -584,6 +592,7 @@ "Back to home page": "Вернуться на главную страницу", "Back": "Назад", "Change password": "Сменить пароль", + "Charts": "Графики", "Clear filters": "Сбросить фильтры", "Close": "Закрыть", "Create": "Создать", @@ -652,6 +661,7 @@ "Back to home page": "Повернутися на головну сторінку", "Back": "Назад", "Change password": "Змінити пароль", + "Charts": "Діаграми", "Clear filters": "Очистити фільтри", "Close": "Закрити", "Create": "Створити", @@ -720,6 +730,7 @@ "Back to home page": "返回主页", "Back": "返回", "Change password": "修改密码", + "Charts": "图表", "Clear filters": "清除过滤器", "Close": "关闭", "Create": "创建", @@ -789,6 +800,7 @@ "Back to home page": "Anasayfaya geri dön", "Back": "Geri dön", "Change password": "Şifreyi değiştir", + "Charts": "Grafikler", "Clear filters": "Filtreleri temizle", "Close": "Kapat", "Create": "Oluştur", diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 2d4ee44b..ee002812 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -801,7 +801,6 @@ def test_get_language_failed(self): class TestHooks(TestCase): - credentials = {"username": "Bob", "password": "bob123"} def setUp(self): @@ -874,7 +873,6 @@ def hook(row, mock: MagicMock = mock): class TestValidators(TestCase): - credentials = {"username": "Bob", "password": "bob123"} def setUp(self): @@ -930,3 +928,84 @@ def post_single_validator(piccolo_crud, request): ) self.assertEqual(response.status_code, 403) self.assertEqual(response.content, b'{"detail":"Not allowed!"}') + + +class TestCharts(TestCase): + credentials = {"username": "Bob", "password": "bob123"} + + def setUp(self): + create_db_tables_sync(SessionsBase, BaseUser, if_not_exists=True) + BaseUser.create_user_sync( + **self.credentials, active=True, admin=True, superuser=True + ) + + def tearDown(self): + SessionsBase.alter().drop_table().run_sync() + BaseUser.alter().drop_table().run_sync() + + def test_charts(self): + """ + Make sure the charts listing can be retrieved. + """ + client = TestClient(APP) + + # To get a CSRF cookie + response = client.get("/") + csrftoken = response.cookies["csrftoken"] + + # Login + payload = dict(csrftoken=csrftoken, **self.credentials) + client.post( + "/public/login/", + json=payload, + headers={"X-CSRFToken": csrftoken}, + ) + + ####################################################################### + # List all forms + + response = client.get("/api/charts/") + self.assertEqual(response.status_code, 200) + self.assertEqual( + response.json(), + [ + { + "title": "Movie count", + "chart_slug": "movie-count", + "chart_type": "Pie", + "data": [ + ["George Lucas", 4], + ["Peter Jackson", 6], + ["Ron Howard", 1], + ], + }, + { + "title": "Director gender", + "chart_slug": "director-gender", + "chart_type": "Column", + "data": [["Male", 7], ["Female", 3]], + }, + ], + ) + + ####################################################################### + # Now get the ChartConfig for a single chart + + response = client.get("/api/charts/movie-count/") + self.assertEqual(response.status_code, 200) + self.assertEqual( + response.json(), + { + "title": "Movie count", + "chart_slug": "movie-count", + "chart_type": "Pie", + "data": [ + ["George Lucas", 4], + ["Peter Jackson", 6], + ["Ron Howard", 1], + ], + }, + ) + response = client.get("/api/charts/no-such-chart/") + self.assertEqual(response.status_code, 404) + self.assertEqual(response.content, b'{"detail":"No such chart found"}') From cafb5c4f89d84ed783de87a0141b40508de8aa00 Mon Sep 17 00:00:00 2001 From: sinisaos Date: Fri, 26 May 2023 15:41:19 +0200 Subject: [PATCH 02/14] fix Playwright tests --- e2e/test_codegen.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/e2e/test_codegen.py b/e2e/test_codegen.py index 6e2de28d..ca9ce269 100644 --- a/e2e/test_codegen.py +++ b/e2e/test_codegen.py @@ -37,8 +37,8 @@ def test_row_listing_filter(playwright: Playwright, dev_server) -> None: page.locator('input[name="username"]').press("Tab") page.locator('input[name="password"]').fill("piccolo123") page.locator('input[name="password"]').press("Enter") - page.get_by_role("link", name="director").click() - page.get_by_role("link", name="Show filters").click() + page.get_by_role("link", name="director", exact=True).click() + page.get_by_role("link", name="Show filters", exact=True).click() page.locator('input[name="name"]').click() page.locator('input[name="name"]').fill("Howard") page.locator('input[name="name"]').press("Enter") @@ -108,8 +108,8 @@ def test_file_upload(playwright: Playwright, dev_server) -> None: page.locator('input[name="username"]').press("Tab") page.locator('input[name="password"]').fill("piccolo123") page.locator('input[name="password"]').press("Enter") - page.get_by_role("link", name="director").click() - page.get_by_role("link", name="8").click() + page.get_by_role("link", name="director", exact=True).click() + page.get_by_role("link", name="8", exact=True).click() page.locator('input[type="file"]').click() page.locator('input[type="file"]').set_input_files( "./e2e/upload/piccolo.jpg" @@ -143,7 +143,7 @@ def test_bulk_update(playwright: Playwright, dev_server) -> None: page.locator('input[name="username"]').press("Tab") page.locator('input[name="password"]').fill("piccolo123") page.locator('input[name="password"]').press("Enter") - page.get_by_role("link", name="director").click() + page.get_by_role("link", name="director", exact=True).click() page.locator("th").first.click() page.get_by_role("row", name="id Name Gender Photo").get_by_role( "checkbox" @@ -171,9 +171,9 @@ def test_table_crud(playwright: Playwright, dev_server) -> None: page.locator('input[name="username"]').press("Tab") page.locator('input[name="password"]').fill("piccolo123") page.locator('input[name="password"]').press("Enter") - page.get_by_role("link", name="director").click() - page.get_by_role("cell", name="8").click() - page.get_by_role("link", name="8").click() + page.get_by_role("link", name="director", exact=True).click() + page.get_by_role("cell", name="8", exact=True).click() + page.get_by_role("link", name="8", exact=True).click() page.locator('input[name="name"]').click() page.locator('input[name="name"]').fill("Ronald William Howard") page.locator('input[name="name"]').press("Enter") From 9ff72829871c7a12444730202468916e36551e99 Mon Sep 17 00:00:00 2001 From: sinisaos Date: Sun, 28 May 2023 10:37:57 +0200 Subject: [PATCH 03/14] fix charts in dark mode --- admin_ui/src/components/TableNav.vue | 2 +- admin_ui/src/main.less | 23 +++++++++++++++++++ docs/source/charts/images/chart.png | Bin 19323 -> 11486 bytes docs/source/charts/images/charts_sidebar.png | Bin 26551 -> 27819 bytes 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/admin_ui/src/components/TableNav.vue b/admin_ui/src/components/TableNav.vue index 6133e410..3ed2b110 100644 --- a/admin_ui/src/components/TableNav.vue +++ b/admin_ui/src/components/TableNav.vue @@ -1,5 +1,5 @@