AppReports/src/template.js
Timo Hocker f57444a3d1
All checks were successful
continuous-integration/drone/push Build is passing
reduction job, chart duplicates
2020-08-25 15:24:20 +02:00

87 lines
2.1 KiB
JavaScript

/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of appreports which is released under GPL-3.0-or-later.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, August 2020
*/
export default {
type: 'object',
properties: [
{
type: 'array',
name: 'sources',
child: {
type: 'object',
properties: [
{
type: 'string',
name: 'name'
},
{
type: 'number',
name: 'limit'
},
{
type: 'number',
name: 'offset'
}
]
}
},
{
type: 'array',
name: 'displays',
child: {
type: 'object',
properties: [
{
type: 'string',
name: 'source'
},
{
type: 'string',
name: 'type',
choices: [
'table',
'chart'
]
},
{
name: 'columns',
type: 'array',
child: { type: 'string' },
if: { prop: 'type', op: '=', val: 'table' }
},
{
name: 'x',
type: 'string',
if: { prop: 'type', op: '=', val: 'chart' }
},
{
name: 'y',
type: 'array',
if: { prop: 'type', op: '=', val: 'chart' },
child: {
type: 'object',
properties: [
{ type: 'string', name: 'label' },
{ type: 'string', name: 'field' },
{ type: 'string', name: 'color' },
{ type: 'string', name: 'fill' },
{ type: 'number', name: 'min_value' },
{ type: 'number', name: 'max_value' }
]
}
},
{
name: 'remove_duplicates',
type: 'boolean',
if: { prop: 'type', op: '=', val: 'chart' }
}
]
}
}
]
};