@mwater/visualization 5.2.0 → 5.3.0
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/lib/ColorComponent.d.ts +10 -11
- package/lib/ColorComponent.js +78 -29
- package/lib/ColorSchemeFactory.d.ts +13 -2
- package/lib/ColorSchemeFactory.js +7 -5
- package/lib/CustomColorsContext.d.ts +6 -0
- package/lib/CustomColorsContext.js +6 -0
- package/lib/FiltersDesignerComponent.d.ts +1 -4
- package/lib/FiltersDesignerComponent.js +2 -3
- package/lib/LocaleContextInjector.d.ts +5 -11
- package/lib/LocaleContextInjector.js +4 -12
- package/lib/MWaterAddRelatedFormComponent.js +3 -3
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +1 -4
- package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
- package/lib/MWaterCompleteTableSelectComponent.d.ts +5 -16
- package/lib/MWaterCompleteTableSelectComponent.js +36 -36
- package/lib/MWaterContextComponent.d.ts +4 -6
- package/lib/MWaterContextComponent.js +4 -13
- package/lib/MWaterLoaderComponent.d.ts +5 -3
- package/lib/MWaterLoaderComponent.js +2 -1
- package/lib/MWaterTableSelectComponent.d.ts +1 -4
- package/lib/MWaterTableSelectComponent.js +10 -12
- package/lib/UIComponents.d.ts +2 -2
- package/lib/UIComponents.js +4 -12
- package/lib/axes/AxisBuilder.d.ts +7 -4
- package/lib/axes/AxisBuilder.js +3 -1
- package/lib/axes/AxisComponent.d.ts +2 -5
- package/lib/axes/AxisComponent.js +1 -2
- package/lib/axes/ColorPaletteCollectionComponent.d.ts +5 -12
- package/lib/axes/ColorPaletteCollectionComponent.js +67 -36
- package/lib/dashboards/DashboardComponent.d.ts +4 -12
- package/lib/dashboards/DashboardComponent.js +18 -38
- package/lib/dashboards/DashboardDesign.d.ts +3 -3
- package/lib/dashboards/DashboardUpgrader.js +36 -1
- package/lib/dashboards/DashboardViewComponent.d.ts +5 -34
- package/lib/dashboards/DashboardViewComponent.js +109 -132
- package/lib/dashboards/FontStyleEditor.d.ts +8 -0
- package/lib/dashboards/FontStyleEditor.js +130 -0
- package/lib/dashboards/LayoutOptionsComponent.d.ts +0 -1
- package/lib/dashboards/LayoutOptionsComponent.js +211 -42
- package/lib/dashboards/ServerDashboardDataSource.d.ts +1 -2
- package/lib/dashboards/ServerDashboardDataSource.js +52 -33
- package/lib/dashboards/WidgetComponent.d.ts +3 -3
- package/lib/dashboards/WidgetComponent.js +3 -6
- package/lib/dashboards/WidgetDataSourcePrioritizer.d.ts +20 -0
- package/lib/dashboards/WidgetDataSourcePrioritizer.js +72 -0
- package/lib/dashboards/layoutOptions.d.ts +83 -0
- package/lib/dashboards/layoutOptions.js +436 -10
- package/lib/datagrids/DatagridDesign.d.ts +7 -6
- package/lib/datagrids/ServerDatagridDataSource.d.ts +7 -6
- package/lib/datagrids/ServerDatagridDataSource.js +87 -33
- package/lib/demo.js +3 -3
- package/lib/index.css +5 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -1
- package/lib/layouts/LayoutManager.d.ts +33 -29
- package/lib/layouts/LayoutManager.js +2 -8
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +26 -57
- package/lib/layouts/blocks/BlocksDisplayComponent.js +122 -205
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +6 -22
- package/lib/layouts/blocks/BlocksLayoutManager.js +5 -14
- package/lib/layouts/blocks/HorizontalBlockComponent.d.ts +5 -4
- package/lib/layouts/blocks/HorizontalBlockComponent.js +5 -5
- package/lib/mWaterLoader.d.ts +2 -0
- package/lib/mWaterLoader.js +2 -1
- package/lib/maps/AddLayerComponent.d.ts +6 -8
- package/lib/maps/AddLayerComponent.js +6 -6
- package/lib/maps/BingLayer.js +10 -20
- package/lib/maps/BufferLayer.js +2 -1
- package/lib/maps/ChoroplethLayer.js +2 -1
- package/lib/maps/DirectMapDataSource.d.ts +5 -2
- package/lib/maps/DirectMapDataSource.js +2 -1
- package/lib/maps/EditPopupComponent.js +2 -1
- package/lib/maps/MapComponent.d.ts +1 -4
- package/lib/maps/MapComponent.js +3 -3
- package/lib/maps/MarkersLayer.js +30 -25
- package/lib/maps/RasterMapViewComponent.d.ts +1 -4
- package/lib/maps/RasterMapViewComponent.js +3 -3
- package/lib/maps/ServerMapDataSource.d.ts +2 -3
- package/lib/maps/ServerMapDataSource.js +5 -5
- package/lib/maps/VectorMapViewComponent.js +2 -1
- package/lib/maps/mapSymbols.js +2 -0
- package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/lib/maps/vectorMaps.js +61 -55
- package/lib/quickfilter/QuickfiltersComponent.d.ts +1 -4
- package/lib/quickfilter/QuickfiltersComponent.js +3 -3
- package/lib/richtext/DropdownPaletteItem.d.ts +32 -0
- package/lib/richtext/DropdownPaletteItem.js +82 -0
- package/lib/richtext/FontColorPaletteItem.d.ts +1 -5
- package/lib/richtext/FontColorPaletteItem.js +32 -27
- package/lib/richtext/ItemsHtmlConverter.js +12 -3
- package/lib/richtext/RichTextComponent.d.ts +26 -52
- package/lib/richtext/RichTextComponent.js +166 -128
- package/lib/valueFormatter.js +6 -1
- package/lib/wellknown.d.ts +5 -0
- package/lib/wellknown.js +288 -0
- package/lib/widgets/DropdownWidgetComponent.d.ts +8 -25
- package/lib/widgets/DropdownWidgetComponent.js +48 -25
- package/lib/widgets/IFrameWidgetComponent.d.ts +1 -2
- package/lib/widgets/ImageWidgetComponent.d.ts +2 -3
- package/lib/widgets/MapWidget.d.ts +2 -0
- package/lib/widgets/MapWidget.js +2 -1
- package/lib/widgets/TOCWidget.js +2 -1
- package/lib/widgets/Widget.d.ts +2 -0
- package/lib/widgets/WidgetDataSource.d.ts +3 -1
- package/lib/widgets/charts/Chart.d.ts +0 -1
- package/lib/widgets/charts/ChartViewComponent.d.ts +4 -0
- package/lib/widgets/charts/ChartViewComponent.js +11 -3
- package/lib/widgets/charts/ChartWidget.d.ts +1 -62
- package/lib/widgets/charts/ChartWidget.js +4 -183
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +51 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +167 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +4 -4
- package/lib/widgets/charts/layered/LayeredChart.d.ts +5 -10
- package/lib/widgets/charts/layered/LayeredChart.js +6 -7
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +4 -2
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +46 -32
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +4 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +3 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +21 -3
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +1 -2
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +2 -1
- package/lib/widgets/charts/layered/LayeredChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +89 -38
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +5 -112
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +122 -166
- package/lib/widgets/charts/pivot/PivotChart.d.ts +6 -0
- package/lib/widgets/charts/pivot/PivotChart.js +47 -17
- package/lib/widgets/charts/pivot/PivotChartDesign.d.ts +11 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +1 -1
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +1 -1
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +20 -36
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +0 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +23 -2
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +215 -181
- package/lib/widgets/charts/pivot/PivotChartUtils.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +9 -28
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +20 -60
- package/lib/widgets/charts/table/TableChart.js +8 -4
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +3 -3
- package/lib/widgets/charts/table/TableChartViewComponent.js +11 -11
- package/lib/widgets/text/TextComponent.d.ts +5 -12
- package/lib/widgets/text/TextComponent.js +19 -39
- package/lib/widgets/text/TextWidget.d.ts +2 -1
- package/lib/widgets/text/TextWidget.js +5 -1
- package/lib/widgets/text/TextWidgetComponent.d.ts +15 -3
- package/lib/widgets/text/TextWidgetComponent.js +76 -19
- package/lib/widgets/text/TextWidgetDesign.d.ts +13 -1
- package/lib/widgets/text/TextWidgetDesign.js +6 -0
- package/package.json +4 -4
- package/src/ColorComponent.tsx +177 -0
- package/src/ColorSchemeFactory.ts +12 -6
- package/src/CustomColorsContext.tsx +8 -0
- package/src/FiltersDesignerComponent.ts +3 -4
- package/src/LocaleContextInjector.tsx +14 -13
- package/src/MWaterAddRelatedFormComponent.ts +3 -3
- package/src/MWaterAddRelatedIndicatorComponent.ts +6 -6
- package/src/MWaterCompleteTableSelectComponent.tsx +36 -36
- package/src/MWaterContextComponent.tsx +8 -17
- package/src/MWaterLoaderComponent.ts +6 -3
- package/src/MWaterTableSelectComponent.tsx +11 -12
- package/src/{UIComponents.ts → UIComponents.tsx} +7 -15
- package/src/axes/AxisBuilder.ts +7 -5
- package/src/axes/AxisComponent.ts +3 -4
- package/src/axes/{ColorPaletteCollectionComponent.ts → ColorPaletteCollectionComponent.tsx} +87 -61
- package/src/dashboards/DashboardComponent.tsx +71 -107
- package/src/dashboards/DashboardDesign.ts +3 -3
- package/src/dashboards/DashboardUpgrader.ts +41 -1
- package/src/dashboards/DashboardViewComponent.tsx +313 -0
- package/src/dashboards/FontStyleEditor.tsx +166 -0
- package/src/dashboards/LayoutOptionsComponent.tsx +379 -75
- package/src/dashboards/ServerDashboardDataSource.ts +52 -33
- package/src/dashboards/WidgetComponent.tsx +6 -12
- package/src/dashboards/WidgetDataSourcePrioritizer.ts +82 -0
- package/src/dashboards/layoutOptions.tsx +581 -0
- package/src/datagrids/DatagridDesign.ts +8 -3
- package/src/datagrids/ServerDatagridDataSource.ts +106 -43
- package/src/demo.ts +3 -3
- package/src/index.css +5 -0
- package/src/index.ts +1 -1
- package/src/layouts/LayoutManager.ts +44 -42
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +498 -0
- package/src/layouts/blocks/BlocksLayoutManager.ts +6 -15
- package/src/layouts/blocks/HorizontalBlockComponent.ts +9 -8
- package/src/mWaterLoader.ts +4 -1
- package/src/maps/AddLayerComponent.ts +9 -9
- package/src/maps/BingLayer.ts +16 -26
- package/src/maps/BufferLayer.ts +2 -1
- package/src/maps/ChoroplethLayer.ts +2 -1
- package/src/maps/DirectMapDataSource.ts +12 -3
- package/src/maps/EditPopupComponent.ts +2 -1
- package/src/maps/MapComponent.ts +3 -3
- package/src/maps/MarkersLayer.ts +38 -41
- package/src/maps/RasterMapViewComponent.ts +3 -3
- package/src/maps/ServerMapDataSource.ts +7 -7
- package/src/maps/VectorMapViewComponent.tsx +2 -1
- package/src/maps/mapSymbols.ts +2 -0
- package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/src/maps/vectorMaps.tsx +79 -74
- package/src/quickfilter/QuickfiltersComponent.ts +3 -3
- package/src/richtext/DropdownPaletteItem.tsx +144 -0
- package/src/richtext/FontColorPaletteItem.tsx +160 -0
- package/src/richtext/ItemsHtmlConverter.ts +15 -5
- package/src/richtext/RichTextComponent.tsx +274 -232
- package/src/valueFormatter.ts +5 -1
- package/src/wellknown.ts +286 -0
- package/src/widgets/DropdownWidgetComponent.tsx +75 -0
- package/src/widgets/MapWidget.ts +5 -2
- package/src/widgets/TOCWidget.ts +2 -1
- package/src/widgets/Widget.ts +3 -0
- package/src/widgets/WidgetDataSource.ts +3 -1
- package/src/widgets/charts/Chart.ts +1 -1
- package/src/widgets/charts/ChartViewComponent.ts +16 -3
- package/src/widgets/charts/ChartWidget.ts +3 -275
- package/src/widgets/charts/ChartWidgetComponent.tsx +281 -0
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +4 -4
- package/src/widgets/charts/layered/LayeredChart.ts +4 -6
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +80 -63
- package/src/widgets/charts/layered/LayeredChartDesign.ts +7 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +43 -10
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +6 -6
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +140 -88
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +305 -221
- package/src/widgets/charts/pivot/PivotChart.ts +56 -18
- package/src/widgets/charts/pivot/PivotChartDesign.ts +12 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +4 -3
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +39 -76
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +0 -1
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +230 -189
- package/src/widgets/charts/pivot/PivotChartUtils.ts +4 -4
- package/src/widgets/charts/pivot/{PivotChartViewComponent.ts → PivotChartViewComponent.tsx} +86 -89
- package/src/widgets/charts/table/TableChart.ts +8 -4
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +4 -4
- package/src/widgets/charts/table/TableChartViewComponent.ts +13 -14
- package/src/widgets/text/TextComponent.tsx +47 -49
- package/src/widgets/text/TextWidget.ts +8 -3
- package/src/widgets/text/TextWidgetComponent.tsx +249 -0
- package/src/widgets/text/TextWidgetDesign.ts +22 -1
- package/src/ColorComponent.ts +0 -117
- package/src/dashboards/DashboardViewComponent.ts +0 -303
- package/src/dashboards/layoutOptions.ts +0 -40
- package/src/layout-styles.css +0 -263
- package/src/layouts/blocks/BlocksDisplayComponent.ts +0 -461
- package/src/layouts/grid/GridLayoutComponent.ts +0 -67
- package/src/layouts/grid/GridLayoutManager.ts +0 -185
- package/src/layouts/grid/LegoLayoutEngine.ts +0 -142
- package/src/layouts/grid/PaletteItemComponent.ts +0 -28
- package/src/layouts/grid/README.md +0 -14
- package/src/layouts/grid/WidgetContainerComponent.ts +0 -420
- package/src/richtext/FontColorPaletteItem.ts +0 -172
- package/src/richtext/FontSizePaletteItem.ts +0 -110
- package/src/widgets/DropdownWidgetComponent.ts +0 -78
- package/src/widgets/text/TextWidgetComponent.ts +0 -120
|
@@ -381,6 +381,10 @@ class PivotChartLayoutBuilder {
|
|
|
381
381
|
;
|
|
382
382
|
({ backgroundColor } = intersection);
|
|
383
383
|
}
|
|
384
|
+
// Override to light red if segment value axis overrides are incomplete
|
|
385
|
+
if (intersection.tableOverride && !intersection.segmentValueAxisOverridesComplete) {
|
|
386
|
+
backgroundColor = "#FFCDCD";
|
|
387
|
+
}
|
|
384
388
|
if (backgroundColor) {
|
|
385
389
|
backgroundColor = (0, color_1.default)(backgroundColor).alpha(intersection.backgroundColorOpacity || 1).string();
|
|
386
390
|
cell.backgroundColor = backgroundColor;
|
|
@@ -389,29 +393,23 @@ class PivotChartLayoutBuilder {
|
|
|
389
393
|
}
|
|
390
394
|
// Determine summarize value for unconfigured cells
|
|
391
395
|
setupSummarize(design, layout) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
for (let rowIndex = 0, end = layout.rows.length, asc = 0 <= end; asc ? rowIndex < end : rowIndex > end; asc ? rowIndex++ : rowIndex--) {
|
|
396
|
+
for (let columnIndex = 0; columnIndex < layout.rows[0].cells.length; columnIndex++) {
|
|
397
|
+
for (let rowIndex = 0; rowIndex < layout.rows.length; rowIndex++) {
|
|
395
398
|
const cell = layout.rows[rowIndex].cells[columnIndex];
|
|
396
399
|
if (cell.unconfigured && cell.type === "row") {
|
|
397
400
|
cell.summarize = PivotChartUtils.canSummarizeSegment(design.rows, cell.section);
|
|
398
401
|
}
|
|
399
402
|
if (cell.unconfigured && cell.type === "column") {
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
result.push(undefined);
|
|
403
|
+
cell.summarize = PivotChartUtils.canSummarizeSegment(design.columns, cell.section);
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
|
|
407
|
-
})());
|
|
406
|
+
}
|
|
408
407
|
}
|
|
409
408
|
// Determine borders, mutating cells
|
|
410
409
|
setupBorders(layout) {
|
|
411
410
|
// Set up borders for row and column cells
|
|
412
411
|
let cell, columnIndex, rowIndex;
|
|
413
412
|
let asc, end;
|
|
414
|
-
let asc2, end2;
|
|
415
413
|
const borderTops = []; // Array of border top information for intersections. index is layout row number
|
|
416
414
|
const borderBottoms = []; // Array of border bottom information for intersections. index is layout row number
|
|
417
415
|
const borderLefts = []; // Array of border left information for intersections. index is layout column number
|
|
@@ -526,9 +524,8 @@ class PivotChartLayoutBuilder {
|
|
|
526
524
|
}
|
|
527
525
|
}
|
|
528
526
|
// Propagate borders across row cells and down column cells so that heavier border win
|
|
529
|
-
for (columnIndex = 1
|
|
530
|
-
|
|
531
|
-
for (rowIndex = 1, end3 = layout.rows.length, asc3 = 1 <= end3; asc3 ? rowIndex < end3 : rowIndex > end3; asc3 ? rowIndex++ : rowIndex--) {
|
|
527
|
+
for (let columnIndex = 1; columnIndex < layout.rows[0].cells.length; columnIndex++) {
|
|
528
|
+
for (let rowIndex = 1; rowIndex < layout.rows.length; rowIndex++) {
|
|
532
529
|
cell = layout.rows[rowIndex].cells[columnIndex];
|
|
533
530
|
if (cell.type === "row") {
|
|
534
531
|
cell.borderTop = Math.max(layout.rows[rowIndex].cells[columnIndex - 1].borderTop, cell.borderTop);
|
|
@@ -541,30 +538,17 @@ class PivotChartLayoutBuilder {
|
|
|
541
538
|
}
|
|
542
539
|
}
|
|
543
540
|
// Setup borders of intersections
|
|
544
|
-
|
|
545
|
-
let
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
if (cell.type === "intersection") {
|
|
554
|
-
cell.borderLeft = borderLefts[columnIndex];
|
|
555
|
-
cell.borderRight = borderRights[columnIndex];
|
|
556
|
-
cell.borderTop = borderTops[rowIndex];
|
|
557
|
-
result1.push((cell.borderBottom = borderBottoms[rowIndex]));
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
result1.push(undefined);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
return result1;
|
|
564
|
-
})());
|
|
541
|
+
for (let columnIndex = 0; columnIndex < layout.rows[0].cells.length; columnIndex++) {
|
|
542
|
+
for (let rowIndex = 0; rowIndex < layout.rows.length; rowIndex++) {
|
|
543
|
+
cell = layout.rows[rowIndex].cells[columnIndex];
|
|
544
|
+
if (cell.type === "intersection") {
|
|
545
|
+
cell.borderLeft = borderLefts[columnIndex];
|
|
546
|
+
cell.borderRight = borderRights[columnIndex];
|
|
547
|
+
cell.borderTop = borderTops[rowIndex];
|
|
548
|
+
cell.borderBottom = borderBottoms[rowIndex];
|
|
549
|
+
}
|
|
565
550
|
}
|
|
566
|
-
|
|
567
|
-
})();
|
|
551
|
+
}
|
|
568
552
|
}
|
|
569
553
|
// Get rows or columns in format of array of
|
|
570
554
|
// [{ segment:, label:, value: }, ...]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Schema } from "@mwater/expressions";
|
|
2
2
|
import { ExprUtils } from "@mwater/expressions";
|
|
3
3
|
import AxisBuilder from "../../../axes/AxisBuilder";
|
|
4
|
-
import { PivotChartDesign } from "./PivotChartDesign";
|
|
4
|
+
import { PivotChartDesign, PivotChartSegment } from "./PivotChartDesign";
|
|
5
5
|
import { JsonQLFilter } from "../../../JsonQLFilter";
|
|
6
|
-
import { JsonQLQuery } from "@mwater/jsonql";
|
|
6
|
+
import { JsonQLQuery, JsonQLSelectQuery } from "@mwater/jsonql";
|
|
7
7
|
/** Builds pivot table queries.
|
|
8
8
|
* Result is flat list for each intersection with each row being data for a single cell
|
|
9
9
|
* columns of result are:
|
|
@@ -28,4 +28,25 @@ export default class PivotChartQueryBuilder {
|
|
|
28
28
|
createQueries(design: PivotChartDesign, extraFilters: JsonQLFilter[]): {
|
|
29
29
|
[intersectionId: string]: JsonQLQuery;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Create a query for an intersection. Query has columns:
|
|
33
|
+
* value: value of the cell (aggregate)
|
|
34
|
+
* r0: row segment value (if present)
|
|
35
|
+
* r1: inner row segment value (if present)
|
|
36
|
+
* ...
|
|
37
|
+
* c0: column segment value (if present)
|
|
38
|
+
* c1: inner column segment value (if present)
|
|
39
|
+
* ...
|
|
40
|
+
* bc: background color of the cell (if present)
|
|
41
|
+
* bcc0: background color condition 0 of the cell (if present)
|
|
42
|
+
* bcc1: background color condition 1 of the cell (if present)
|
|
43
|
+
* ...
|
|
44
|
+
* @param design - Design of the chart
|
|
45
|
+
* @param rowPath - Row path
|
|
46
|
+
* @param columnPath - Column path
|
|
47
|
+
* @param extraFilters - Extra filters
|
|
48
|
+
* @returns Query for the intersection
|
|
49
|
+
*/
|
|
50
|
+
createIntersectionQuery(design: PivotChartDesign, rowPath: PivotChartSegment[], columnPath: PivotChartSegment[], extraFilters: JsonQLFilter[]): JsonQLSelectQuery | null;
|
|
51
|
+
createSegmentOrderQuery(design: PivotChartDesign, segment: PivotChartSegment, extraFilters: JsonQLFilter[]): JsonQLSelectQuery;
|
|
31
52
|
}
|
|
@@ -59,205 +59,239 @@ class PivotChartQueryBuilder {
|
|
|
59
59
|
// extraFilters: array of filters to apply. Each is { table: table id, jsonql: jsonql condition with {alias} for tableAlias. }
|
|
60
60
|
// Queries are indexed by intersection id, as one query is made for each intersection
|
|
61
61
|
createQueries(design, extraFilters) {
|
|
62
|
-
let filter, intersectionId, relevantFilters, whereClauses;
|
|
63
62
|
const exprCompiler = new expressions_1.ExprCompiler(this.schema);
|
|
64
63
|
const queries = {};
|
|
65
64
|
// For each intersection
|
|
66
65
|
for (let rowPath of PivotChartUtils.getSegmentPaths(design.rows)) {
|
|
67
66
|
for (let columnPath of PivotChartUtils.getSegmentPaths(design.columns)) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Get intersection
|
|
72
|
-
const intersection = design.intersections[intersectionId];
|
|
73
|
-
// Create shell of query
|
|
74
|
-
const query = {
|
|
75
|
-
type: "query",
|
|
76
|
-
selects: [],
|
|
77
|
-
from: exprCompiler.compileTable(design.table, "main"),
|
|
78
|
-
limit: 10000,
|
|
79
|
-
groupBy: []
|
|
80
|
-
};
|
|
81
|
-
// Filters to add (not yet compiled)
|
|
82
|
-
const filters = [];
|
|
83
|
-
const compileSegmentAxis = (axis) => {
|
|
84
|
-
// Get axis type
|
|
85
|
-
const axisType = this.axisBuilder.getAxisType(axis);
|
|
86
|
-
// Enumset needs to be unwrapped
|
|
87
|
-
if (axisType === "enumset") {
|
|
88
|
-
// Use to_jsonb(x) to convert to jsonb then jsonb_array_elements_text to convert to unnested array
|
|
89
|
-
return {
|
|
90
|
-
type: "op",
|
|
91
|
-
op: "jsonb_array_elements_text",
|
|
92
|
-
exprs: [
|
|
93
|
-
{
|
|
94
|
-
type: "op",
|
|
95
|
-
op: "to_jsonb",
|
|
96
|
-
exprs: [this.axisBuilder.compileAxis({ axis, tableAlias: "main" })]
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
return this.axisBuilder.compileAxis({ axis, tableAlias: "main" });
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
// Add segments
|
|
106
|
-
for (i = 0; i < rowPath.length; i++) {
|
|
107
|
-
const rowSegment = rowPath[i];
|
|
108
|
-
query.selects.push({
|
|
109
|
-
type: "select",
|
|
110
|
-
expr: compileSegmentAxis(rowSegment.valueAxis),
|
|
111
|
-
alias: `r${i}`
|
|
112
|
-
});
|
|
113
|
-
query.groupBy.push(i + 1);
|
|
114
|
-
if (rowSegment.filter) {
|
|
115
|
-
filters.push(rowSegment.filter);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
for (i = 0; i < columnPath.length; i++) {
|
|
119
|
-
const columnSegment = columnPath[i];
|
|
120
|
-
query.selects.push({
|
|
121
|
-
type: "select",
|
|
122
|
-
expr: compileSegmentAxis(columnSegment.valueAxis),
|
|
123
|
-
alias: `c${i}`
|
|
124
|
-
});
|
|
125
|
-
query.groupBy.push(i + 1 + rowPath.length);
|
|
126
|
-
if (columnSegment.filter) {
|
|
127
|
-
filters.push(columnSegment.filter);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// Add value
|
|
131
|
-
query.selects.push({
|
|
132
|
-
type: "select",
|
|
133
|
-
expr: this.axisBuilder.compileAxis({ axis: intersection?.valueAxis, tableAlias: "main" }),
|
|
134
|
-
alias: "value"
|
|
135
|
-
});
|
|
136
|
-
if (intersection?.filter) {
|
|
137
|
-
filters.push(intersection.filter);
|
|
138
|
-
}
|
|
139
|
-
// Add background color
|
|
140
|
-
if (intersection?.backgroundColorAxis) {
|
|
141
|
-
query.selects.push({
|
|
142
|
-
type: "select",
|
|
143
|
-
expr: this.axisBuilder.compileAxis({ axis: intersection?.backgroundColorAxis, tableAlias: "main" }),
|
|
144
|
-
alias: "bc"
|
|
145
|
-
});
|
|
67
|
+
const query = this.createIntersectionQuery(design, rowPath, columnPath, extraFilters);
|
|
68
|
+
if (query) {
|
|
69
|
+
queries[PivotChartUtils.getIntersectionId(rowPath, columnPath)] = query;
|
|
146
70
|
}
|
|
147
|
-
// Add background color conditions
|
|
148
|
-
const iterable = intersection.backgroundColorConditions || [];
|
|
149
|
-
for (i = 0; i < iterable.length; i++) {
|
|
150
|
-
const backgroundColorCondition = iterable[i];
|
|
151
|
-
query.selects.push({
|
|
152
|
-
type: "select",
|
|
153
|
-
expr: exprCompiler.compileExpr({ expr: backgroundColorCondition.condition ?? null, tableAlias: "main" }),
|
|
154
|
-
alias: `bcc${i}`
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
// If all selects are null, don't create query
|
|
158
|
-
if (lodash_1.default.all(query.selects, (select) => select.expr == null)) {
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
// Add where
|
|
162
|
-
whereClauses = [];
|
|
163
|
-
if (design.filter) {
|
|
164
|
-
whereClauses.push(exprCompiler.compileExpr({ expr: design.filter, tableAlias: "main" }));
|
|
165
|
-
}
|
|
166
|
-
// Add other filters
|
|
167
|
-
whereClauses = whereClauses.concat(lodash_1.default.map(filters, (filter) => exprCompiler.compileExpr({ expr: filter, tableAlias: "main" })));
|
|
168
|
-
// Add filters
|
|
169
|
-
if (extraFilters && extraFilters.length > 0) {
|
|
170
|
-
// Get relevant filters
|
|
171
|
-
relevantFilters = lodash_1.default.where(extraFilters, { table: design.table });
|
|
172
|
-
// Add filters
|
|
173
|
-
for (filter of relevantFilters) {
|
|
174
|
-
whereClauses.push((0, expressions_3.injectTableAlias)(filter.jsonql, "main"));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
whereClauses = lodash_1.default.compact(whereClauses);
|
|
178
|
-
if (whereClauses.length === 1) {
|
|
179
|
-
query.where = whereClauses[0];
|
|
180
|
-
}
|
|
181
|
-
else if (whereClauses.length > 1) {
|
|
182
|
-
query.where = { type: "op", op: "and", exprs: whereClauses };
|
|
183
|
-
}
|
|
184
|
-
queries[intersectionId] = query;
|
|
185
71
|
}
|
|
186
72
|
}
|
|
187
73
|
// For each segment
|
|
188
74
|
const segments = PivotChartUtils.getAllSegments(design.rows).concat(PivotChartUtils.getAllSegments(design.columns));
|
|
189
|
-
for (
|
|
75
|
+
for (const segment of segments) {
|
|
190
76
|
if (segment.orderExpr) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
whereClauses.push(exprCompiler.compileExpr({ expr: segment.filter, tableAlias: "main" }));
|
|
77
|
+
const query = this.createSegmentOrderQuery(design, segment, extraFilters);
|
|
78
|
+
if (query) {
|
|
79
|
+
queries[segment.id] = query;
|
|
195
80
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
where,
|
|
250
|
-
groupBy: [1],
|
|
251
|
-
orderBy: [
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return queries;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a query for an intersection. Query has columns:
|
|
87
|
+
* value: value of the cell (aggregate)
|
|
88
|
+
* r0: row segment value (if present)
|
|
89
|
+
* r1: inner row segment value (if present)
|
|
90
|
+
* ...
|
|
91
|
+
* c0: column segment value (if present)
|
|
92
|
+
* c1: inner column segment value (if present)
|
|
93
|
+
* ...
|
|
94
|
+
* bc: background color of the cell (if present)
|
|
95
|
+
* bcc0: background color condition 0 of the cell (if present)
|
|
96
|
+
* bcc1: background color condition 1 of the cell (if present)
|
|
97
|
+
* ...
|
|
98
|
+
* @param design - Design of the chart
|
|
99
|
+
* @param rowPath - Row path
|
|
100
|
+
* @param columnPath - Column path
|
|
101
|
+
* @param extraFilters - Extra filters
|
|
102
|
+
* @returns Query for the intersection
|
|
103
|
+
*/
|
|
104
|
+
createIntersectionQuery(design, rowPath, columnPath, extraFilters) {
|
|
105
|
+
const exprCompiler = new expressions_1.ExprCompiler(this.schema);
|
|
106
|
+
// Get id of intersection
|
|
107
|
+
const intersectionId = PivotChartUtils.getIntersectionId(rowPath, columnPath);
|
|
108
|
+
// Get intersection
|
|
109
|
+
const intersection = design.intersections[intersectionId];
|
|
110
|
+
// Get intersection table
|
|
111
|
+
const intersectionTable = intersection.tableOverride || design.table;
|
|
112
|
+
// Create shell of query
|
|
113
|
+
const query = {
|
|
114
|
+
type: "query",
|
|
115
|
+
selects: [],
|
|
116
|
+
from: exprCompiler.compileTable(intersectionTable, "main"),
|
|
117
|
+
limit: 10000,
|
|
118
|
+
groupBy: []
|
|
119
|
+
};
|
|
120
|
+
// Filters to add (not yet compiled)
|
|
121
|
+
const filters = [];
|
|
122
|
+
const compileSegmentAxis = (segment) => {
|
|
123
|
+
// Get axis type
|
|
124
|
+
const axisType = this.axisBuilder.getAxisType(segment.valueAxis);
|
|
125
|
+
// Get axis (which can be overridden)
|
|
126
|
+
const axis = intersection.tableOverride ? (intersection.segmentValueAxisOverrides || {})[segment.id] : segment.valueAxis;
|
|
127
|
+
// Enumset needs to be unwrapped
|
|
128
|
+
if (axisType === "enumset") {
|
|
129
|
+
// Use to_jsonb(x) to convert to jsonb then jsonb_array_elements_text to convert to unnested array
|
|
130
|
+
return {
|
|
131
|
+
type: "op",
|
|
132
|
+
op: "jsonb_array_elements_text",
|
|
133
|
+
exprs: [
|
|
252
134
|
{
|
|
253
|
-
|
|
254
|
-
|
|
135
|
+
type: "op",
|
|
136
|
+
op: "to_jsonb",
|
|
137
|
+
exprs: [this.axisBuilder.compileAxis({ axis, tableAlias: "main" })]
|
|
255
138
|
}
|
|
256
139
|
]
|
|
257
140
|
};
|
|
258
141
|
}
|
|
142
|
+
else {
|
|
143
|
+
return this.axisBuilder.compileAxis({ axis, tableAlias: "main" });
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
// Add segments
|
|
147
|
+
for (let i = 0; i < rowPath.length; i++) {
|
|
148
|
+
const rowSegment = rowPath[i];
|
|
149
|
+
query.selects.push({
|
|
150
|
+
type: "select",
|
|
151
|
+
expr: compileSegmentAxis(rowSegment),
|
|
152
|
+
alias: `r${i}`
|
|
153
|
+
});
|
|
154
|
+
query.groupBy.push(i + 1);
|
|
155
|
+
if (rowSegment.filter) {
|
|
156
|
+
filters.push(rowSegment.filter);
|
|
157
|
+
}
|
|
259
158
|
}
|
|
260
|
-
|
|
159
|
+
for (let i = 0; i < columnPath.length; i++) {
|
|
160
|
+
const columnSegment = columnPath[i];
|
|
161
|
+
query.selects.push({
|
|
162
|
+
type: "select",
|
|
163
|
+
expr: compileSegmentAxis(columnSegment),
|
|
164
|
+
alias: `c${i}`
|
|
165
|
+
});
|
|
166
|
+
query.groupBy.push(i + 1 + rowPath.length);
|
|
167
|
+
if (columnSegment.filter) {
|
|
168
|
+
filters.push(columnSegment.filter);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Add value
|
|
172
|
+
query.selects.push({
|
|
173
|
+
type: "select",
|
|
174
|
+
expr: this.axisBuilder.compileAxis({ axis: intersection?.valueAxis, tableAlias: "main" }),
|
|
175
|
+
alias: "value"
|
|
176
|
+
});
|
|
177
|
+
if (intersection?.filter) {
|
|
178
|
+
filters.push(intersection.filter);
|
|
179
|
+
}
|
|
180
|
+
// Add background color
|
|
181
|
+
if (intersection?.backgroundColorAxis) {
|
|
182
|
+
query.selects.push({
|
|
183
|
+
type: "select",
|
|
184
|
+
expr: this.axisBuilder.compileAxis({ axis: intersection?.backgroundColorAxis, tableAlias: "main" }),
|
|
185
|
+
alias: "bc"
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Add background color conditions
|
|
189
|
+
const iterable = intersection.backgroundColorConditions || [];
|
|
190
|
+
for (let i = 0; i < iterable.length; i++) {
|
|
191
|
+
const backgroundColorCondition = iterable[i];
|
|
192
|
+
query.selects.push({
|
|
193
|
+
type: "select",
|
|
194
|
+
expr: exprCompiler.compileExpr({ expr: backgroundColorCondition.condition ?? null, tableAlias: "main" }),
|
|
195
|
+
alias: `bcc${i}`
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// If all selects are null, don't create query
|
|
199
|
+
if (lodash_1.default.all(query.selects, (select) => select.expr == null)) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
// Add where
|
|
203
|
+
let whereClauses = [];
|
|
204
|
+
if (design.filter) {
|
|
205
|
+
whereClauses.push(exprCompiler.compileExpr({ expr: design.filter, tableAlias: "main" }));
|
|
206
|
+
}
|
|
207
|
+
// Add other filters
|
|
208
|
+
whereClauses = whereClauses.concat(lodash_1.default.map(filters, (filter) => exprCompiler.compileExpr({ expr: filter, tableAlias: "main" })));
|
|
209
|
+
// Add filters
|
|
210
|
+
if (extraFilters && extraFilters.length > 0) {
|
|
211
|
+
// Get relevant filters
|
|
212
|
+
const relevantFilters = lodash_1.default.where(extraFilters, { table: intersection.tableOverride ?? design.table });
|
|
213
|
+
// Add filters
|
|
214
|
+
for (const filter of relevantFilters) {
|
|
215
|
+
whereClauses.push((0, expressions_3.injectTableAlias)(filter.jsonql, "main"));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
whereClauses = lodash_1.default.compact(whereClauses);
|
|
219
|
+
if (whereClauses.length === 1) {
|
|
220
|
+
query.where = whereClauses[0];
|
|
221
|
+
}
|
|
222
|
+
else if (whereClauses.length > 1) {
|
|
223
|
+
query.where = { type: "op", op: "and", exprs: whereClauses };
|
|
224
|
+
}
|
|
225
|
+
return query;
|
|
226
|
+
}
|
|
227
|
+
createSegmentOrderQuery(design, segment, extraFilters) {
|
|
228
|
+
const exprCompiler = new expressions_1.ExprCompiler(this.schema);
|
|
229
|
+
// Create where which includes the segments filter (if present) and the "or" of all intersections that are present
|
|
230
|
+
let whereClauses = [];
|
|
231
|
+
if (segment.filter) {
|
|
232
|
+
whereClauses.push(exprCompiler.compileExpr({ expr: segment.filter, tableAlias: "main" }));
|
|
233
|
+
}
|
|
234
|
+
// Get all intersection filters
|
|
235
|
+
const intersectionFilters = [];
|
|
236
|
+
for (const intersectionId of lodash_1.default.keys(design.intersections)) {
|
|
237
|
+
if (intersectionId.includes(segment.id)) {
|
|
238
|
+
const { filter } = design.intersections[intersectionId];
|
|
239
|
+
if (filter) {
|
|
240
|
+
intersectionFilters.push(filter);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
// If intersection has no filter, still needs to "or" with true
|
|
244
|
+
intersectionFilters.push({ type: "literal", valueType: "boolean", value: true });
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (intersectionFilters.length > 0) {
|
|
249
|
+
whereClauses.push({
|
|
250
|
+
type: "op",
|
|
251
|
+
op: "or",
|
|
252
|
+
exprs: lodash_1.default.map(intersectionFilters, (filter) => exprCompiler.compileExpr({ expr: filter, tableAlias: "main" }))
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
if (design.filter) {
|
|
256
|
+
whereClauses.push(exprCompiler.compileExpr({ expr: design.filter, tableAlias: "main" }));
|
|
257
|
+
}
|
|
258
|
+
// Add extra filters
|
|
259
|
+
if (extraFilters && extraFilters.length > 0) {
|
|
260
|
+
// Get relevant filters
|
|
261
|
+
const relevantFilters = lodash_1.default.where(extraFilters, { table: design.table });
|
|
262
|
+
// Add filters
|
|
263
|
+
for (const filter of relevantFilters) {
|
|
264
|
+
whereClauses.push((0, expressions_3.injectTableAlias)(filter.jsonql, "main"));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
whereClauses = lodash_1.default.compact(whereClauses);
|
|
268
|
+
let where = null;
|
|
269
|
+
if (whereClauses.length === 1) {
|
|
270
|
+
where = whereClauses[0];
|
|
271
|
+
}
|
|
272
|
+
else if (whereClauses.length > 1) {
|
|
273
|
+
where = { type: "op", op: "and", exprs: whereClauses };
|
|
274
|
+
}
|
|
275
|
+
// Create query to get ordering
|
|
276
|
+
return {
|
|
277
|
+
type: "query",
|
|
278
|
+
selects: [
|
|
279
|
+
{
|
|
280
|
+
type: "select",
|
|
281
|
+
expr: this.axisBuilder.compileAxis({ axis: segment.valueAxis, tableAlias: "main" }),
|
|
282
|
+
alias: "value"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
from: exprCompiler.compileTable(design.table, "main"),
|
|
286
|
+
where,
|
|
287
|
+
groupBy: [1],
|
|
288
|
+
orderBy: [
|
|
289
|
+
{
|
|
290
|
+
expr: exprCompiler.compileExpr({ expr: segment.orderExpr, tableAlias: "main" }),
|
|
291
|
+
direction: segment.orderDir || "asc"
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
};
|
|
261
295
|
}
|
|
262
296
|
}
|
|
263
297
|
exports.default = PivotChartQueryBuilder;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PivotChartDesign, PivotChartSegment } from "./PivotChartDesign";
|
|
2
2
|
export declare function getSegmentPaths(segments: PivotChartSegment[]): PivotChartSegment[][];
|
|
3
3
|
export declare function getAllSegments(segments: PivotChartSegment[]): PivotChartSegment[];
|
|
4
|
-
export declare function getIntersectionId(rowPath:
|
|
4
|
+
export declare function getIntersectionId(rowPath: PivotChartSegment[], columnPath: PivotChartSegment[]): string;
|
|
5
5
|
export declare function findSegment(segments: PivotChartSegment[], id: any): PivotChartSegment | null | undefined;
|
|
6
|
-
export declare function canSummarizeSegment(segments:
|
|
6
|
+
export declare function canSummarizeSegment(segments: PivotChartSegment[], id: string): boolean;
|
|
7
7
|
export declare function summarizeSegment(design: PivotChartDesign, id: any, label: any): PivotChartDesign;
|
|
8
8
|
export declare function replaceSegment(segments: any, replacement: any): PivotChartSegment[];
|
|
9
9
|
export declare function removeSegment(segments: any, id: any): PivotChartSegment[];
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import PropTypes from "prop-types";
|
|
2
1
|
import React from "react";
|
|
3
|
-
import ActionCancelModalComponent from "@mwater/react-library/lib/ActionCancelModalComponent";
|
|
4
2
|
import { DataSource, Schema } from "@mwater/expressions";
|
|
5
3
|
import { JsonQLFilter, WidgetScope } from "../../..";
|
|
6
|
-
import { PivotChartDesign } from "./PivotChartDesign";
|
|
4
|
+
import { PivotChartDesign, PivotChartIntersection } from "./PivotChartDesign";
|
|
7
5
|
export interface PivotChartViewComponentProps {
|
|
8
6
|
schema: Schema;
|
|
9
7
|
dataSource: DataSource;
|
|
@@ -21,13 +19,11 @@ export interface PivotChartViewComponentProps {
|
|
|
21
19
|
}
|
|
22
20
|
interface PivotChartViewComponentState {
|
|
23
21
|
editSegment: any;
|
|
24
|
-
editIntersectionId:
|
|
25
|
-
editIntersection:
|
|
22
|
+
editIntersectionId: string | null;
|
|
23
|
+
editIntersection: PivotChartIntersection | null;
|
|
26
24
|
}
|
|
27
25
|
export default class PivotChartViewComponent extends React.Component<PivotChartViewComponentProps, PivotChartViewComponentState> {
|
|
28
|
-
static
|
|
29
|
-
locale: PropTypes.Requireable<string>;
|
|
30
|
-
};
|
|
26
|
+
static contextType: React.Context<string>;
|
|
31
27
|
constructor(props: any);
|
|
32
28
|
handleHeaderChange: (header: any) => void;
|
|
33
29
|
handleFooterChange: (footer: any) => void;
|
|
@@ -41,25 +37,10 @@ export default class PivotChartViewComponent extends React.Component<PivotChartV
|
|
|
41
37
|
handleInsertAfterSegment: (segmentId: any) => void;
|
|
42
38
|
handleAddChildSegment: (segmentId: any) => void;
|
|
43
39
|
handleSummarizeSegment: (segmentId: any) => void;
|
|
44
|
-
renderHeader(): React.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, HTMLElement>;
|
|
50
|
-
renderFooter(): React.DetailedReactHTMLElement<{
|
|
51
|
-
style: {
|
|
52
|
-
paddingLeft: number;
|
|
53
|
-
paddingRight: number;
|
|
54
|
-
};
|
|
55
|
-
}, HTMLElement>;
|
|
56
|
-
renderEditSegmentModal(): React.CElement<import("@mwater/react-library/lib/ActionCancelModalComponent").ActionCancelModalComponentProps, ActionCancelModalComponent> | undefined;
|
|
57
|
-
renderEditIntersectionModal(): React.CElement<import("@mwater/react-library/lib/ActionCancelModalComponent").ActionCancelModalComponentProps, ActionCancelModalComponent> | undefined;
|
|
58
|
-
render(): React.DetailedReactHTMLElement<{
|
|
59
|
-
style: {
|
|
60
|
-
width: number;
|
|
61
|
-
height: number | undefined;
|
|
62
|
-
};
|
|
63
|
-
}, HTMLElement>;
|
|
40
|
+
renderHeader(): React.JSX.Element;
|
|
41
|
+
renderFooter(): React.JSX.Element;
|
|
42
|
+
renderEditSegmentModal(): React.JSX.Element | null;
|
|
43
|
+
renderEditIntersectionModal(): React.JSX.Element | null;
|
|
44
|
+
render(): React.JSX.Element;
|
|
64
45
|
}
|
|
65
46
|
export {};
|