@isoftdata/utility-dashboard-backend 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -16
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -32,26 +32,10 @@ const handleChartTypeSpecificQuirks = (chartType, resultSet) => {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const loadChartData = async(mysqlConnection, { name, query: queryObject, formatting, chartWrapper, multiSeries, parameters, table, ...theRest }) => { // needs database connection
|
|
35
|
-
// let { results: queryResultSet, fields } = (queryObject && queryObject.sql) ? await queryWithFields(mysqlConnection, queryObject) : { fields: [], results: [] }
|
|
36
|
-
// let data = handleChartTypeSpecificQuirks(chartWrapper.chartType, queryResultSet)
|
|
37
35
|
const dataTable = await loadDataTable(mysqlConnection, { query: queryObject, multiSeries, formatting, chartType: chartWrapper.chartType })
|
|
38
|
-
// if (multiSeries) {
|
|
39
|
-
// ({ data, formatting, fields } = getMultiSeriesData({
|
|
40
|
-
// data,
|
|
41
|
-
// seriesOptions: multiSeries,
|
|
42
|
-
// formatting,
|
|
43
|
-
// fields,
|
|
44
|
-
// }))
|
|
45
|
-
// }
|
|
46
36
|
|
|
47
37
|
const proccessedFormatting = handleFormattingTemplates(formatting)
|
|
48
38
|
|
|
49
|
-
// let dataTable = getDataTableFormat(data, fields, multiSeries) //per the Google Charts docs, the DataTable object literal format is the most performant, so we'll turn it into that format before returning
|
|
50
|
-
|
|
51
|
-
// if (chartWrapper.chartType == 'AreaChart') {
|
|
52
|
-
// dataTable = makeDataCumulative(dataTable)
|
|
53
|
-
// }
|
|
54
|
-
|
|
55
39
|
if (chartWrapper.chartType === 'Table') {
|
|
56
40
|
return {
|
|
57
41
|
...theRest,
|
|
@@ -72,6 +56,7 @@ const loadChartData = async(mysqlConnection, { name, query: queryObject, formatt
|
|
|
72
56
|
/*
|
|
73
57
|
* Returns only the data needed to render out the chart. If chartType is 'Table', it will return it in the format consumed by the ractive table component.
|
|
74
58
|
* Otherwise, it will return data in the google chart Datatable object literal format.
|
|
59
|
+
* multiSeries, formatting properties should be deconstructed from the chart object, chartType should be deconstructed from the chart's chartWrapper property
|
|
75
60
|
*/
|
|
76
61
|
const loadDataTable = async(mysqlConnection, { query: queryObject, multiSeries, formatting, chartType }) => {
|
|
77
62
|
let { results: queryResultSet, fields } = (queryObject && queryObject.sql) ? await queryWithFields(mysqlConnection, queryObject) : { fields: [], results: [] }
|
package/package.json
CHANGED