mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-27 16:06:23 +00:00
SYNC: timeline chart type
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
export type ChartTypeEnum = 'bar' | 'line' | 'pie' | 'polarArea';
|
export type ChartTypeEnum = 'bar' | 'line' | 'timeline' | 'pie' | 'polarArea';
|
||||||
export type ChartXTransformFunction =
|
export type ChartXTransformFunction =
|
||||||
| 'identity'
|
| 'identity'
|
||||||
| 'date:minute'
|
| 'date:minute'
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export class ChartProcessor {
|
|||||||
) {
|
) {
|
||||||
usedChart = {
|
usedChart = {
|
||||||
definition: {
|
definition: {
|
||||||
chartType: 'line',
|
chartType: 'timeline',
|
||||||
xdef: {
|
xdef: {
|
||||||
field: datecol,
|
field: datecol,
|
||||||
transformFunction: 'date:day',
|
transformFunction: 'date:day',
|
||||||
@@ -192,6 +192,9 @@ export class ChartProcessor {
|
|||||||
if (this.chartsProcessing[i].errorMessage) {
|
if (this.chartsProcessing[i].errorMessage) {
|
||||||
continue; // skip charts with errors
|
continue; // skip charts with errors
|
||||||
}
|
}
|
||||||
|
if (this.chartsProcessing[i].definition.chartType != 'timeline') {
|
||||||
|
continue; // skip non-timeline charts
|
||||||
|
}
|
||||||
this.chartsProcessing[i] = autoAggregateCompactTimelineChart(this.chartsProcessing[i]);
|
this.chartsProcessing[i] = autoAggregateCompactTimelineChart(this.chartsProcessing[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +247,7 @@ export class ChartProcessor {
|
|||||||
const sortOrder = chart.definition.xdef.sortOrder ?? 'ascKeys';
|
const sortOrder = chart.definition.xdef.sortOrder ?? 'ascKeys';
|
||||||
if (sortOrder != 'natural') {
|
if (sortOrder != 'natural') {
|
||||||
if (sortOrder == 'ascKeys' || sortOrder == 'descKeys') {
|
if (sortOrder == 'ascKeys' || sortOrder == 'descKeys') {
|
||||||
if (chart.definition.chartType == 'line' && chart.definition.xdef.transformFunction.startsWith('date:')) {
|
if (chart.definition.chartType == 'timeline' && chart.definition.xdef.transformFunction.startsWith('date:')) {
|
||||||
addedChart = autoAggregateCompactTimelineChart(addedChart);
|
addedChart = autoAggregateCompactTimelineChart(addedChart);
|
||||||
fillChartTimelineBuckets(addedChart);
|
fillChartTimelineBuckets(addedChart);
|
||||||
}
|
}
|
||||||
@@ -253,7 +256,7 @@ export class ChartProcessor {
|
|||||||
this.charts.push(addedChart);
|
this.charts.push(addedChart);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
''
|
||||||
addedChart.bucketKeysOrdered = _sortBy([...addedChart.bucketKeysSet]);
|
addedChart.bucketKeysOrdered = _sortBy([...addedChart.bucketKeysSet]);
|
||||||
if (sortOrder == 'descKeys') {
|
if (sortOrder == 'descKeys') {
|
||||||
addedChart.bucketKeysOrdered.reverse();
|
addedChart.bucketKeysOrdered.reverse();
|
||||||
|
|||||||
Reference in New Issue
Block a user