@mwater/visualization 5.3.2 → 5.4.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 +1 -1
- package/lib/ColorComponent.js +2 -2
- package/lib/CustomColorsContext.d.ts +0 -1
- package/lib/DateRangeComponent.js +10 -10
- package/lib/LocaleContextInjector.js +2 -2
- package/lib/MWaterAddRelatedFormComponent.js +8 -8
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +0 -1
- package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
- package/lib/MWaterAssetSystemsListComponent.d.ts +3 -3
- package/lib/MWaterAssetSystemsListComponent.js +4 -3
- package/lib/MWaterCompleteTableSelectComponent.d.ts +33 -34
- package/lib/MWaterCompleteTableSelectComponent.js +39 -38
- package/lib/MWaterCustomTablesetListComponent.d.ts +3 -3
- package/lib/MWaterCustomTablesetListComponent.js +5 -4
- package/lib/MWaterGlobalFiltersComponent.js +4 -4
- package/lib/MWaterLoaderComponent.d.ts +5 -5
- package/lib/MWaterLoaderComponent.js +1 -1
- package/lib/MWaterMetricsTableListComponent.d.ts +3 -3
- package/lib/MWaterMetricsTableListComponent.js +4 -3
- package/lib/MWaterResponsesFilterComponent.js +4 -4
- package/lib/MWaterTableSelectComponent.d.ts +1 -1
- package/lib/MWaterTableSelectComponent.js +5 -5
- package/lib/PopoverComponent.d.ts +4 -4
- package/lib/UIComponents.d.ts +5 -2
- package/lib/axes/AxisBuilder.js +42 -43
- package/lib/axes/AxisColorEditorComponent.d.ts +4 -4
- package/lib/axes/AxisColorEditorComponent.js +25 -60
- package/lib/axes/AxisComponent.d.ts +2 -3
- package/lib/axes/AxisComponent.js +20 -20
- package/lib/axes/BinsComponent.js +6 -6
- package/lib/axes/CategoryMapComponent.d.ts +2 -1
- package/lib/axes/CategoryMapComponent.js +7 -5
- package/lib/axes/ColorPaletteCollectionComponent.js +3 -3
- package/lib/axes/RangesComponent.js +12 -12
- package/lib/compressJson.js +1 -1
- package/lib/dashboards/DashboardComponent.d.ts +2 -0
- package/lib/dashboards/DashboardComponent.js +15 -8
- package/lib/dashboards/DashboardUtils.js +2 -3
- package/lib/dashboards/DashboardViewComponent.js +4 -4
- package/lib/dashboards/FontStyleEditor.js +8 -8
- package/lib/dashboards/LayoutOptionsComponent.js +101 -74
- package/lib/dashboards/SettingsModalComponent.d.ts +3 -4
- package/lib/dashboards/SettingsModalComponent.js +54 -40
- package/lib/dashboards/WidgetComponent.d.ts +0 -1
- package/lib/dashboards/WidgetComponent.js +1 -2
- package/lib/dashboards/layoutOptions.js +11 -7
- package/lib/datagrids/DatagridComponent.d.ts +1 -8
- package/lib/datagrids/DatagridComponent.js +14 -13
- package/lib/datagrids/DatagridDesignerComponent.js +18 -18
- package/lib/datagrids/DatagridQueryBuilder.d.ts +4 -4
- package/lib/datagrids/DatagridUtils.js +2 -2
- package/lib/datagrids/DatagridViewComponent.js +4 -4
- package/lib/datagrids/ExprCellComponent.js +1 -1
- package/lib/datagrids/FindReplaceModalComponent.js +17 -17
- package/lib/datagrids/OrderBysDesignerComponent.js +2 -2
- package/lib/languages.js +2 -2
- package/lib/layouts/DecoratedBlockComponent.js +2 -2
- package/lib/layouts/blocks/BlocksDisplayComponent.js +13 -13
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +2 -1
- package/lib/layouts/blocks/ClipboardPaletteItemComponent.js +3 -3
- package/lib/layouts/blocks/HorizontalBlockComponent.js +3 -3
- package/lib/layouts/blocks/blockUtils.js +4 -5
- package/lib/mWaterLoader.js +1 -1
- package/lib/maps/AddLayerComponent.js +13 -13
- package/lib/maps/AdminScopeAndDetailLevelComponent.js +5 -5
- package/lib/maps/BaseLayerDesignerComponent.js +2 -2
- package/lib/maps/BufferLayer.js +7 -7
- package/lib/maps/BufferLayerDesignerComponent.js +8 -8
- package/lib/maps/ChoroplethLayer.js +6 -6
- package/lib/maps/ChoroplethLayerDesigner.js +16 -16
- package/lib/maps/ClusterLayer.js +3 -3
- package/lib/maps/ClusterLayerDesignerComponent.js +5 -5
- package/lib/maps/DetailLevelSelectComponent.d.ts +11 -1
- package/lib/maps/DetailLevelSelectComponent.js +3 -3
- package/lib/maps/DirectMapDataSource.js +1 -2
- package/lib/maps/EditHoverOver.js +7 -5
- package/lib/maps/EditPopupComponent.js +2 -2
- package/lib/maps/GridLayer.js +5 -5
- package/lib/maps/GridLayerDesigner.js +15 -15
- package/lib/maps/LayerSwitcherComponent.js +1 -2
- package/lib/maps/LeafletMapComponent.d.ts +1 -1
- package/lib/maps/LeafletMapComponent.js +1 -1
- package/lib/maps/LegendComponent.js +1 -1
- package/lib/maps/MWaterServerLayer.d.ts +0 -1
- package/lib/maps/MWaterServerLayer.js +1 -1
- package/lib/maps/MapComponent.js +8 -8
- package/lib/maps/MapControlComponent.js +1 -1
- package/lib/maps/MapDesignerComponent.js +16 -16
- package/lib/maps/MapFiltersDesignerComponent.js +2 -2
- package/lib/maps/MapLayerViewDesignerComponent.js +8 -8
- package/lib/maps/MapUtils.js +6 -7
- package/lib/maps/MapViewComponent.js +1 -2
- package/lib/maps/MarkerSymbolSelectComponent.js +3 -3
- package/lib/maps/MarkersLayer.js +6 -7
- package/lib/maps/MarkersLayerDesignerComponent.js +22 -22
- package/lib/maps/PopupFilterJoinsEditComponent.js +4 -4
- package/lib/maps/PopupFilterJoinsUtils.js +2 -3
- package/lib/maps/RasterMapViewComponent.d.ts +3 -3
- package/lib/maps/RasterMapViewComponent.js +4 -4
- package/lib/maps/RegionSelectComponent.d.ts +1 -3
- package/lib/maps/RegionSelectComponent.js +1 -2
- package/lib/maps/ScopeAndDetailLevelComponent.js +3 -3
- package/lib/maps/TileUrlLayer.d.ts +1 -1
- package/lib/maps/TileUrlLayer.js +3 -3
- package/lib/maps/VectorMapViewComponent.js +6 -7
- package/lib/maps/ZoomLevelsComponent.js +5 -5
- package/lib/maps/mapSymbols.d.ts +1 -1
- package/lib/maps/mapSymbols.js +51 -50
- package/lib/maps/mapboxUtils.js +2 -3
- package/lib/maps/maps.d.ts +0 -1
- package/lib/maps/vectorMaps.js +14 -15
- package/lib/memoizedDebounce.js +1 -2
- package/lib/quickfilter/DateExprComponent.d.ts +4 -0
- package/lib/quickfilter/DateExprComponent.js +17 -16
- package/lib/quickfilter/IdArrayQuickfilterComponent.js +1 -1
- package/lib/quickfilter/QuickfilterUtils.js +1 -2
- package/lib/quickfilter/QuickfiltersComponent.d.ts +23 -2
- package/lib/quickfilter/QuickfiltersComponent.js +2 -2
- package/lib/quickfilter/QuickfiltersDesignComponent.js +8 -8
- package/lib/quickfilter/TextLiteralComponent.d.ts +35 -2
- package/lib/quickfilter/TextLiteralComponent.js +6 -6
- package/lib/richtext/DropdownPaletteItem.js +1 -1
- package/lib/richtext/ExprItemsHtmlConverter.js +8 -10
- package/lib/richtext/FontColorPaletteItem.js +7 -7
- package/lib/richtext/ItemsHtmlConverter.js +0 -1
- package/lib/richtext/RichTextComponent.d.ts +1 -0
- package/lib/richtext/RichTextComponent.js +33 -29
- package/lib/valueFormatter.js +18 -19
- package/lib/wellknown.js +2 -3
- package/lib/widgets/IFrameWidgetComponent.d.ts +9 -1
- package/lib/widgets/IFrameWidgetComponent.js +3 -3
- package/lib/widgets/ImageUploaderComponent.js +5 -5
- package/lib/widgets/ImageWidget.js +2 -2
- package/lib/widgets/ImageWidgetComponent.d.ts +9 -1
- package/lib/widgets/ImageWidgetComponent.js +20 -20
- package/lib/widgets/ImagelistCarouselComponent.js +1 -1
- package/lib/widgets/MapWidget.js +2 -2
- package/lib/widgets/MarkdownWidget.d.ts +1 -1
- package/lib/widgets/MarkdownWidget.js +1 -1
- package/lib/widgets/TOCWidget.js +11 -12
- package/lib/widgets/WidgetScopesViewComponent.js +1 -1
- package/lib/widgets/charts/Chart.js +1 -1
- package/lib/widgets/charts/ChartViewComponent.js +9 -9
- package/lib/widgets/charts/ChartWidgetComponent.js +4 -4
- package/lib/widgets/charts/calendar/CalendarChart.js +4 -4
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +7 -7
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +3 -3
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +18 -5
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +3 -4
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +5 -5
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.d.ts +5 -19
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.js +66 -70
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.js +1 -1
- package/lib/widgets/charts/layered/LayeredChart.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChart.js +9 -9
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +8 -8
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +15 -15
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +33 -33
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +16 -16
- package/lib/widgets/charts/layered/LayeredChartUtils.js +1 -2
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +4 -4
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +18 -17
- package/lib/widgets/charts/pivot/PivotChart.d.ts +1 -1
- package/lib/widgets/charts/pivot/PivotChart.js +12 -4
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -5
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +10 -10
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +5 -5
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +1 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +5 -6
- package/lib/widgets/charts/pivot/PivotChartUtils.js +11 -12
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +9 -9
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +30 -30
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +28 -26
- package/lib/widgets/charts/table/OrderingsComponent.js +2 -2
- package/lib/widgets/charts/table/TableChart.js +3 -3
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +17 -17
- package/lib/widgets/charts/table/TableChartViewComponent.js +3 -3
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -3
- package/lib/widgets/text/ExprInsertModalComponent.js +2 -14
- package/lib/widgets/text/ExprItemEditorComponent.js +4 -4
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -3
- package/lib/widgets/text/ExprUpdateModalComponent.js +3 -15
- package/lib/widgets/text/TextComponent.js +3 -3
- package/lib/widgets/text/TextWidget.d.ts +1 -1
- package/lib/widgets/text/TextWidgetComponent.js +11 -11
- package/lib/widgets/text/TextWidgetDesign.d.ts +2 -1
- package/lib/widgets/text/TextWidgetDesign.js +1 -2
- package/package.json +3 -3
- package/src/ColorComponent.tsx +2 -2
- package/src/DateRangeComponent.ts +10 -10
- package/src/LocaleContextInjector.tsx +1 -1
- package/src/MWaterAddRelatedFormComponent.ts +7 -7
- package/src/MWaterAddRelatedIndicatorComponent.ts +5 -5
- package/src/MWaterAssetSystemsListComponent.tsx +3 -3
- package/src/MWaterCompleteTableSelectComponent.tsx +36 -35
- package/src/MWaterCustomTablesetListComponent.tsx +4 -4
- package/src/MWaterGlobalFiltersComponent.ts +4 -4
- package/src/MWaterLoaderComponent.ts +1 -1
- package/src/MWaterMetricsTableListComponent.tsx +3 -3
- package/src/MWaterResponsesFilterComponent.ts +6 -6
- package/src/MWaterTableSelectComponent.tsx +6 -7
- package/src/axes/AxisBuilder.ts +42 -44
- package/src/axes/AxisColorEditorComponent.tsx +178 -0
- package/src/axes/AxisComponent.ts +20 -20
- package/src/axes/BinsComponent.tsx +6 -6
- package/src/axes/CategoryMapComponent.ts +10 -10
- package/src/axes/ColorPaletteCollectionComponent.tsx +3 -3
- package/src/axes/RangesComponent.ts +14 -14
- package/src/dashboards/DashboardComponent.tsx +21 -9
- package/src/dashboards/DashboardViewComponent.tsx +3 -3
- package/src/dashboards/FontStyleEditor.tsx +8 -8
- package/src/dashboards/LayoutOptionsComponent.tsx +74 -74
- package/src/dashboards/SettingsModalComponent.tsx +134 -107
- package/src/dashboards/layoutOptions.tsx +5 -1
- package/src/datagrids/DatagridComponent.ts +65 -62
- package/src/datagrids/DatagridDesignerComponent.tsx +17 -17
- package/src/datagrids/DatagridUtils.ts +2 -2
- package/src/datagrids/DatagridViewComponent.ts +3 -3
- package/src/datagrids/ExprCellComponent.ts +1 -1
- package/src/datagrids/FindReplaceModalComponent.ts +13 -13
- package/src/datagrids/OrderBysDesignerComponent.tsx +2 -2
- package/src/globals.d.ts +7 -1
- package/src/languages.ts +2 -2
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +13 -13
- package/src/layouts/blocks/BlocksLayoutManager.ts +3 -2
- package/src/layouts/blocks/ClipboardPaletteItemComponent.ts +3 -3
- package/src/maps/AddLayerComponent.ts +13 -13
- package/src/maps/AdminScopeAndDetailLevelComponent.ts +5 -5
- package/src/maps/BaseLayerDesignerComponent.ts +8 -8
- package/src/maps/BufferLayer.ts +5 -5
- package/src/maps/BufferLayerDesignerComponent.ts +8 -8
- package/src/maps/ChoroplethLayer.ts +3 -3
- package/src/maps/ChoroplethLayerDesigner.tsx +16 -16
- package/src/maps/ClusterLayer.ts +3 -3
- package/src/maps/ClusterLayerDesignerComponent.ts +5 -5
- package/src/maps/DetailLevelSelectComponent.ts +3 -3
- package/src/maps/EditHoverOver.tsx +5 -5
- package/src/maps/EditPopupComponent.ts +2 -2
- package/src/maps/GridLayer.ts +5 -5
- package/src/maps/GridLayerDesigner.tsx +15 -16
- package/src/maps/MWaterServerLayer.ts +1 -1
- package/src/maps/MapComponent.ts +6 -6
- package/src/maps/MapControlComponent.ts +1 -1
- package/src/maps/MapDesignerComponent.tsx +20 -20
- package/src/maps/MapFiltersDesignerComponent.tsx +3 -3
- package/src/maps/MapLayerViewDesignerComponent.ts +9 -9
- package/src/maps/MarkerSymbolSelectComponent.ts +4 -5
- package/src/maps/MarkersLayerDesignerComponent.ts +22 -22
- package/src/maps/PopupFilterJoinsEditComponent.ts +4 -4
- package/src/maps/RasterMapViewComponent.ts +2 -2
- package/src/maps/RegionSelectComponent.ts +1 -2
- package/src/maps/ScopeAndDetailLevelComponent.ts +3 -3
- package/src/maps/TileUrlLayer.tsx +3 -3
- package/src/maps/VectorMapViewComponent.tsx +5 -5
- package/src/maps/ZoomLevelsComponent.ts +6 -6
- package/src/maps/mapSymbols.ts +49 -49
- package/src/maps/vectorMaps.tsx +2 -2
- package/src/quickfilter/DateExprComponent.ts +19 -18
- package/src/quickfilter/IdArrayQuickfilterComponent.ts +1 -1
- package/src/quickfilter/QuickfiltersComponent.ts +1 -1
- package/src/quickfilter/QuickfiltersDesignComponent.tsx +9 -9
- package/src/quickfilter/TextLiteralComponent.ts +4 -4
- package/src/richtext/DropdownPaletteItem.tsx +1 -1
- package/src/richtext/ExprItemsHtmlConverter.ts +8 -10
- package/src/richtext/ItemsHtmlConverter.ts +0 -1
- package/src/richtext/RichTextComponent.tsx +31 -31
- package/src/valueFormatter.ts +14 -14
- package/src/widgets/IFrameWidgetComponent.ts +3 -3
- package/src/widgets/ImageUploaderComponent.tsx +5 -5
- package/src/widgets/ImageWidget.ts +2 -2
- package/src/widgets/ImageWidgetComponent.ts +26 -26
- package/src/widgets/ImagelistCarouselComponent.ts +2 -2
- package/src/widgets/MapWidget.ts +1 -1
- package/src/widgets/MarkdownWidget.ts +1 -1
- package/src/widgets/TOCWidget.ts +13 -14
- package/src/widgets/WidgetScopesViewComponent.ts +1 -1
- package/src/widgets/charts/Chart.ts +1 -1
- package/src/widgets/charts/ChartViewComponent.ts +4 -4
- package/src/widgets/charts/ChartWidgetComponent.tsx +3 -3
- package/src/widgets/charts/calendar/CalendarChart.ts +4 -4
- package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +7 -7
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +2 -2
- package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +25 -8
- package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +5 -5
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.tsx +128 -0
- package/src/widgets/charts/layered/LayeredChart.ts +9 -9
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +45 -45
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +39 -39
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +18 -19
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +1 -1
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +22 -23
- package/src/widgets/charts/pivot/PivotChart.ts +15 -5
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +12 -12
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +5 -5
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +7 -8
- package/src/widgets/charts/pivot/PivotChartViewComponent.tsx +6 -6
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +30 -30
- package/src/widgets/charts/table/OrderingsComponent.tsx +2 -2
- package/src/widgets/charts/table/TableChart.ts +3 -3
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +16 -16
- package/src/widgets/charts/table/TableChartViewComponent.ts +2 -2
- package/src/widgets/text/{ExprInsertModalComponent.ts → ExprInsertModalComponent.tsx} +18 -20
- package/src/widgets/text/ExprItemEditorComponent.tsx +4 -4
- package/src/widgets/text/{ExprUpdateModalComponent.ts → ExprUpdateModalComponent.tsx} +18 -20
- package/src/widgets/text/TextComponent.tsx +2 -2
- package/src/widgets/text/TextWidgetComponent.tsx +10 -10
- package/src/widgets/text/TextWidgetDesign.ts +3 -1
- package/src/axes/AxisColorEditorComponent.ts +0 -210
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.ts +0 -117
|
@@ -215,9 +215,9 @@ vertical-align: top;
|
|
|
215
215
|
.pivot-chart-table .br2 { border-right: solid 1px #ccc }
|
|
216
216
|
.pivot-chart-table .br3 { border-right: solid 1px #888 }\
|
|
217
217
|
`), this.props.layout.tooManyRows
|
|
218
|
-
? R("div", { className: "text-warning", style: { fontSize: 12 } }, R("i", { className: "fa fa-exclamation-circle" }),
|
|
218
|
+
? R("div", { className: "text-warning", style: { fontSize: 12 } }, R("i", { className: "fa fa-exclamation-circle" }), T `Warning: Too many rows in table to display`)
|
|
219
219
|
: undefined, this.props.layout.tooManyColumns
|
|
220
|
-
? R("div", { className: "text-warning", style: { fontSize: 12 } }, R("i", { className: "fa fa-exclamation-circle" }),
|
|
220
|
+
? R("div", { className: "text-warning", style: { fontSize: 12 } }, R("i", { className: "fa fa-exclamation-circle" }), T `Warning: Too many columns in table to display`)
|
|
221
221
|
: undefined, R("div", { style: { position: "relative" } }, R("table", { className: "pivot-chart-table" }, R("tbody", null, lodash_1.default.map(this.props.layout.rows, (row, rowIndex) => {
|
|
222
222
|
return this.renderRow(row, rowIndex);
|
|
223
223
|
}))), this.renderHoverControls()));
|
|
@@ -250,10 +250,10 @@ class LayoutCellComponent extends react_1.default.Component {
|
|
|
250
250
|
if (!cell.section) {
|
|
251
251
|
return null;
|
|
252
252
|
}
|
|
253
|
-
return R("span", { style: { fontSize: "90%" } }, R("a", { className: "link-plain", onClick: this.props.onEditSection },
|
|
253
|
+
return R("span", { style: { fontSize: "90%" } }, R("a", { className: "link-plain", onClick: this.props.onEditSection }, T `Edit`), cell.summarize
|
|
254
254
|
? [
|
|
255
|
-
R("span", { className: "text-muted" },
|
|
256
|
-
R("a", { className: "link-plain", onClick: this.props.onSummarizeSegment },
|
|
255
|
+
R("span", { className: "text-muted" }, T ` / `),
|
|
256
|
+
R("a", { className: "link-plain", onClick: this.props.onSummarizeSegment }, T `Summarize`)
|
|
257
257
|
]
|
|
258
258
|
: undefined);
|
|
259
259
|
}
|
|
@@ -39,7 +39,7 @@ export default class PivotChartQueryBuilder {
|
|
|
39
39
|
* ...
|
|
40
40
|
* bc: background color of the cell (if present)
|
|
41
41
|
* bcc0: background color condition 0 of the cell (if present)
|
|
42
|
-
* bcc1:
|
|
42
|
+
* bcc1: inner row segment value (if present)
|
|
43
43
|
* ...
|
|
44
44
|
* @param design - Design of the chart
|
|
45
45
|
* @param rowPath - Row path
|
|
@@ -59,7 +59,6 @@ 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
|
-
const exprCompiler = new expressions_1.ExprCompiler(this.schema);
|
|
63
62
|
const queries = {};
|
|
64
63
|
// For each intersection
|
|
65
64
|
for (let rowPath of PivotChartUtils.getSegmentPaths(design.rows)) {
|
|
@@ -93,7 +92,7 @@ class PivotChartQueryBuilder {
|
|
|
93
92
|
* ...
|
|
94
93
|
* bc: background color of the cell (if present)
|
|
95
94
|
* bcc0: background color condition 0 of the cell (if present)
|
|
96
|
-
* bcc1:
|
|
95
|
+
* bcc1: inner row segment value (if present)
|
|
97
96
|
* ...
|
|
98
97
|
* @param design - Design of the chart
|
|
99
98
|
* @param rowPath - Row path
|
|
@@ -152,7 +151,7 @@ class PivotChartQueryBuilder {
|
|
|
152
151
|
alias: `r${i}`
|
|
153
152
|
});
|
|
154
153
|
query.groupBy.push(i + 1);
|
|
155
|
-
if (rowSegment.filter) {
|
|
154
|
+
if (rowSegment.filter && !intersection.tableOverride) {
|
|
156
155
|
filters.push(rowSegment.filter);
|
|
157
156
|
}
|
|
158
157
|
}
|
|
@@ -164,7 +163,7 @@ class PivotChartQueryBuilder {
|
|
|
164
163
|
alias: `c${i}`
|
|
165
164
|
});
|
|
166
165
|
query.groupBy.push(i + 1 + rowPath.length);
|
|
167
|
-
if (columnSegment.filter) {
|
|
166
|
+
if (columnSegment.filter && !intersection.tableOverride) {
|
|
168
167
|
filters.push(columnSegment.filter);
|
|
169
168
|
}
|
|
170
169
|
}
|
|
@@ -199,9 +198,9 @@ class PivotChartQueryBuilder {
|
|
|
199
198
|
if (lodash_1.default.all(query.selects, (select) => select.expr == null)) {
|
|
200
199
|
return null;
|
|
201
200
|
}
|
|
202
|
-
// Add where
|
|
203
201
|
let whereClauses = [];
|
|
204
|
-
if
|
|
202
|
+
// Add overall where if no table override. If table override, would be for the wrong table
|
|
203
|
+
if (design.filter && !intersection.tableOverride) {
|
|
205
204
|
whereClauses.push(exprCompiler.compileExpr({ expr: design.filter, tableAlias: "main" }));
|
|
206
205
|
}
|
|
207
206
|
// Add other filters
|
|
@@ -3,7 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getSegmentPaths = getSegmentPaths;
|
|
7
|
+
exports.getAllSegments = getAllSegments;
|
|
8
|
+
exports.getIntersectionId = getIntersectionId;
|
|
9
|
+
exports.findSegment = findSegment;
|
|
10
|
+
exports.canSummarizeSegment = canSummarizeSegment;
|
|
11
|
+
exports.summarizeSegment = summarizeSegment;
|
|
12
|
+
exports.replaceSegment = replaceSegment;
|
|
13
|
+
exports.removeSegment = removeSegment;
|
|
14
|
+
exports.insertBeforeSegment = insertBeforeSegment;
|
|
15
|
+
exports.insertAfterSegment = insertAfterSegment;
|
|
16
|
+
exports.addChildSegment = addChildSegment;
|
|
7
17
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
18
|
const uuid_1 = __importDefault(require("uuid"));
|
|
9
19
|
// Misc utils for working with pivot charts
|
|
@@ -21,7 +31,6 @@ function getSegmentPaths(segments) {
|
|
|
21
31
|
}
|
|
22
32
|
return paths;
|
|
23
33
|
}
|
|
24
|
-
exports.getSegmentPaths = getSegmentPaths;
|
|
25
34
|
// Get all paths through a set of segments (e.g. if a contains b, c, then [[a,b], [a,c]])
|
|
26
35
|
function getAllSegments(segments) {
|
|
27
36
|
let allSegments = [];
|
|
@@ -34,16 +43,13 @@ function getAllSegments(segments) {
|
|
|
34
43
|
}
|
|
35
44
|
return allSegments;
|
|
36
45
|
}
|
|
37
|
-
exports.getAllSegments = getAllSegments;
|
|
38
46
|
// Gets the id of the intersection of the two paths
|
|
39
47
|
function getIntersectionId(rowPath, columnPath) {
|
|
40
48
|
return `${lodash_1.default.pluck(rowPath, "id").join(",")}:${lodash_1.default.pluck(columnPath, "id").join(",")}`;
|
|
41
49
|
}
|
|
42
|
-
exports.getIntersectionId = getIntersectionId;
|
|
43
50
|
function findSegment(segments, id) {
|
|
44
51
|
return lodash_1.default.findWhere(getAllSegments(segments), { id });
|
|
45
52
|
}
|
|
46
|
-
exports.findSegment = findSegment;
|
|
47
53
|
// Determine if can summarize segment (if segment before has a value axis and has no children)
|
|
48
54
|
function canSummarizeSegment(segments, id) {
|
|
49
55
|
const prevSegment = findPreviousSegment(segments, id);
|
|
@@ -52,7 +58,6 @@ function canSummarizeSegment(segments, id) {
|
|
|
52
58
|
}
|
|
53
59
|
return false;
|
|
54
60
|
}
|
|
55
|
-
exports.canSummarizeSegment = canSummarizeSegment;
|
|
56
61
|
// Finds the segment before one with id
|
|
57
62
|
function findPreviousSegment(segments, id) {
|
|
58
63
|
// Find in list (shallow)
|
|
@@ -129,7 +134,6 @@ function summarizeSegment(design, id, label) {
|
|
|
129
134
|
}
|
|
130
135
|
return design;
|
|
131
136
|
}
|
|
132
|
-
exports.summarizeSegment = summarizeSegment;
|
|
133
137
|
// Recursively map segments, flattening and compacting
|
|
134
138
|
function mapSegments(segments, mapFunc) {
|
|
135
139
|
let segments2 = lodash_1.default.map(segments, mapFunc);
|
|
@@ -152,7 +156,6 @@ function replaceSegment(segments, replacement) {
|
|
|
152
156
|
return segment;
|
|
153
157
|
});
|
|
154
158
|
}
|
|
155
|
-
exports.replaceSegment = replaceSegment;
|
|
156
159
|
// Remove segment
|
|
157
160
|
function removeSegment(segments, id) {
|
|
158
161
|
return mapSegments(segments, function (segment) {
|
|
@@ -162,7 +165,6 @@ function removeSegment(segments, id) {
|
|
|
162
165
|
return segment;
|
|
163
166
|
});
|
|
164
167
|
}
|
|
165
|
-
exports.removeSegment = removeSegment;
|
|
166
168
|
// Inserts before
|
|
167
169
|
function insertBeforeSegment(segments, id) {
|
|
168
170
|
return mapSegments(segments, function (segment) {
|
|
@@ -172,7 +174,6 @@ function insertBeforeSegment(segments, id) {
|
|
|
172
174
|
return segment;
|
|
173
175
|
});
|
|
174
176
|
}
|
|
175
|
-
exports.insertBeforeSegment = insertBeforeSegment;
|
|
176
177
|
// Inserts after
|
|
177
178
|
function insertAfterSegment(segments, id) {
|
|
178
179
|
return mapSegments(segments, function (segment) {
|
|
@@ -182,7 +183,6 @@ function insertAfterSegment(segments, id) {
|
|
|
182
183
|
return segment;
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
|
-
exports.insertAfterSegment = insertAfterSegment;
|
|
186
186
|
// Adds child
|
|
187
187
|
function addChildSegment(segments, id) {
|
|
188
188
|
return mapSegments(segments, function (segment) {
|
|
@@ -192,4 +192,3 @@ function addChildSegment(segments, id) {
|
|
|
192
192
|
return segment;
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
exports.addChildSegment = addChildSegment;
|
|
@@ -35,15 +35,15 @@ const PivotChartLayoutComponent_1 = __importDefault(require("./PivotChartLayoutC
|
|
|
35
35
|
const PivotChartLayoutBuilder_1 = __importDefault(require("./PivotChartLayoutBuilder"));
|
|
36
36
|
const SegmentDesignerComponent_1 = __importDefault(require("./SegmentDesignerComponent"));
|
|
37
37
|
const IntersectionDesignerComponent_1 = __importDefault(require("./IntersectionDesignerComponent"));
|
|
38
|
-
const
|
|
38
|
+
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
39
39
|
// Displays a pivot chart
|
|
40
40
|
class PivotChartViewComponent extends react_1.default.Component {
|
|
41
|
-
static contextType =
|
|
41
|
+
static contextType = expressions_ui_1.LocaleContext;
|
|
42
42
|
constructor(props) {
|
|
43
43
|
super(props);
|
|
44
44
|
this.state = {
|
|
45
|
-
editSegment: null,
|
|
46
|
-
editIntersectionId: null,
|
|
45
|
+
editSegment: null, // Segment being edited
|
|
46
|
+
editIntersectionId: null, // id of intersection being edited
|
|
47
47
|
editIntersection: null // value of intersection being edited
|
|
48
48
|
};
|
|
49
49
|
}
|
|
@@ -123,7 +123,7 @@ class PivotChartViewComponent extends react_1.default.Component {
|
|
|
123
123
|
return this.props.onDesignChange(design);
|
|
124
124
|
};
|
|
125
125
|
handleSummarizeSegment = (segmentId) => {
|
|
126
|
-
const design = PivotChartUtils.summarizeSegment(this.props.design, segmentId,
|
|
126
|
+
const design = PivotChartUtils.summarizeSegment(this.props.design, segmentId, T `Summary`);
|
|
127
127
|
return this.props.onDesignChange(design);
|
|
128
128
|
};
|
|
129
129
|
renderHeader() {
|
|
@@ -139,16 +139,16 @@ class PivotChartViewComponent extends react_1.default.Component {
|
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
141
141
|
const segmentType = PivotChartUtils.findSegment(this.props.design.rows, this.state.editSegment.id)
|
|
142
|
-
?
|
|
143
|
-
:
|
|
144
|
-
return (react_1.default.createElement(ActionCancelModalComponent_1.default, { title: `Edit ${segmentType}`, onAction: this.handleSaveEditSegment, onCancel: this.handleCancelEditSegment, size: "large" },
|
|
142
|
+
? T `row`
|
|
143
|
+
: T `column`;
|
|
144
|
+
return (react_1.default.createElement(ActionCancelModalComponent_1.default, { title: T `Edit ${segmentType}`, onAction: this.handleSaveEditSegment, onCancel: this.handleCancelEditSegment, size: "large" },
|
|
145
145
|
react_1.default.createElement(SegmentDesignerComponent_1.default, { segment: this.state.editSegment, table: this.props.design.table, schema: this.props.schema, dataSource: this.props.dataSource, segmentType: segmentType, onChange: (segment) => this.setState({ editSegment: segment }), filters: this.props.filters })));
|
|
146
146
|
}
|
|
147
147
|
renderEditIntersectionModal() {
|
|
148
148
|
if (!this.state.editIntersectionId) {
|
|
149
149
|
return null;
|
|
150
150
|
}
|
|
151
|
-
return (react_1.default.createElement(ActionCancelModalComponent_1.default, { title:
|
|
151
|
+
return (react_1.default.createElement(ActionCancelModalComponent_1.default, { title: T `Edit Value`, onAction: this.handleSaveEditIntersection, onCancel: this.handleCancelEditIntersection, size: "large" },
|
|
152
152
|
react_1.default.createElement(IntersectionDesignerComponent_1.default, { design: this.props.design, intersectionId: this.state.editIntersectionId, intersection: this.state.editIntersection, table: this.props.design.table, schema: this.props.schema, dataSource: this.props.dataSource, onChange: (intersection) => this.setState({ editIntersection: intersection }), filters: this.props.filters })));
|
|
153
153
|
}
|
|
154
154
|
render() {
|
|
@@ -29,64 +29,64 @@ export default class SegmentDesignerComponent extends React.Component<SegmentDes
|
|
|
29
29
|
handleOrderDirChange: (orderDir: any) => any;
|
|
30
30
|
renderMode(): React.CElement<{
|
|
31
31
|
label: React.ReactNode;
|
|
32
|
-
labelMuted?: boolean
|
|
32
|
+
labelMuted?: boolean;
|
|
33
33
|
hint?: React.ReactNode;
|
|
34
34
|
help?: React.ReactNode;
|
|
35
|
-
required?: boolean
|
|
36
|
-
hasSuccess?: boolean
|
|
37
|
-
hasWarnings?: boolean
|
|
38
|
-
hasErrors?: boolean
|
|
35
|
+
required?: boolean;
|
|
36
|
+
hasSuccess?: boolean;
|
|
37
|
+
hasWarnings?: boolean;
|
|
38
|
+
hasErrors?: boolean;
|
|
39
39
|
}, ui.FormGroup>;
|
|
40
40
|
renderLabel(): React.CElement<{
|
|
41
41
|
label: React.ReactNode;
|
|
42
|
-
labelMuted?: boolean
|
|
42
|
+
labelMuted?: boolean;
|
|
43
43
|
hint?: React.ReactNode;
|
|
44
44
|
help?: React.ReactNode;
|
|
45
|
-
required?: boolean
|
|
46
|
-
hasSuccess?: boolean
|
|
47
|
-
hasWarnings?: boolean
|
|
48
|
-
hasErrors?: boolean
|
|
45
|
+
required?: boolean;
|
|
46
|
+
hasSuccess?: boolean;
|
|
47
|
+
hasWarnings?: boolean;
|
|
48
|
+
hasErrors?: boolean;
|
|
49
49
|
}, ui.FormGroup>;
|
|
50
50
|
renderValueAxis(): React.JSX.Element;
|
|
51
51
|
renderFilter(): React.CElement<{
|
|
52
52
|
label: React.ReactNode;
|
|
53
|
-
labelMuted?: boolean
|
|
53
|
+
labelMuted?: boolean;
|
|
54
54
|
hint?: React.ReactNode;
|
|
55
55
|
help?: React.ReactNode;
|
|
56
|
-
required?: boolean
|
|
57
|
-
hasSuccess?: boolean
|
|
58
|
-
hasWarnings?: boolean
|
|
59
|
-
hasErrors?: boolean
|
|
56
|
+
required?: boolean;
|
|
57
|
+
hasSuccess?: boolean;
|
|
58
|
+
hasWarnings?: boolean;
|
|
59
|
+
hasErrors?: boolean;
|
|
60
60
|
}, ui.FormGroup>;
|
|
61
61
|
renderStyling(): React.CElement<{
|
|
62
62
|
label: React.ReactNode;
|
|
63
|
-
labelMuted?: boolean
|
|
63
|
+
labelMuted?: boolean;
|
|
64
64
|
hint?: React.ReactNode;
|
|
65
65
|
help?: React.ReactNode;
|
|
66
|
-
required?: boolean
|
|
67
|
-
hasSuccess?: boolean
|
|
68
|
-
hasWarnings?: boolean
|
|
69
|
-
hasErrors?: boolean
|
|
66
|
+
required?: boolean;
|
|
67
|
+
hasSuccess?: boolean;
|
|
68
|
+
hasWarnings?: boolean;
|
|
69
|
+
hasErrors?: boolean;
|
|
70
70
|
}, ui.FormGroup>;
|
|
71
71
|
renderBorders(): React.CElement<{
|
|
72
72
|
label: React.ReactNode;
|
|
73
|
-
labelMuted?: boolean
|
|
73
|
+
labelMuted?: boolean;
|
|
74
74
|
hint?: React.ReactNode;
|
|
75
75
|
help?: React.ReactNode;
|
|
76
|
-
required?: boolean
|
|
77
|
-
hasSuccess?: boolean
|
|
78
|
-
hasWarnings?: boolean
|
|
79
|
-
hasErrors?: boolean
|
|
76
|
+
required?: boolean;
|
|
77
|
+
hasSuccess?: boolean;
|
|
78
|
+
hasWarnings?: boolean;
|
|
79
|
+
hasErrors?: boolean;
|
|
80
80
|
}, ui.FormGroup>;
|
|
81
81
|
renderOrderExpr(): React.CElement<{
|
|
82
82
|
label: React.ReactNode;
|
|
83
|
-
labelMuted?: boolean
|
|
83
|
+
labelMuted?: boolean;
|
|
84
84
|
hint?: React.ReactNode;
|
|
85
85
|
help?: React.ReactNode;
|
|
86
|
-
required?: boolean
|
|
87
|
-
hasSuccess?: boolean
|
|
88
|
-
hasWarnings?: boolean
|
|
89
|
-
hasErrors?: boolean
|
|
86
|
+
required?: boolean;
|
|
87
|
+
hasSuccess?: boolean;
|
|
88
|
+
hasWarnings?: boolean;
|
|
89
|
+
hasErrors?: boolean;
|
|
90
90
|
}, ui.FormGroup>;
|
|
91
91
|
render(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
92
92
|
}
|
|
@@ -80,18 +80,18 @@ class SegmentDesignerComponent extends react_1.default.Component {
|
|
|
80
80
|
renderMode() {
|
|
81
81
|
return R(ui.FormGroup, {
|
|
82
82
|
labelMuted: true,
|
|
83
|
-
label:
|
|
83
|
+
label: T `Type`
|
|
84
84
|
}, react_1.default.createElement(ui.Radio, { key: "single", value: this.state.mode, radioValue: "single", onChange: this.handleMode },
|
|
85
|
-
`Single ${this.props.segmentType}`,
|
|
86
|
-
react_1.default.createElement("span", { className: "text-muted" }, ` - used for summary ${this.props.segmentType}s and empty ${this.props.segmentType}s`)), react_1.default.createElement(ui.Radio, { key: "multiple", value: this.state.mode, radioValue: "multiple", onChange: this.handleMode },
|
|
87
|
-
`Multiple ${this.props.segmentType}s`,
|
|
88
|
-
react_1.default.createElement("span", { className: "text-muted" }, ` - disaggregate data by a field`)));
|
|
85
|
+
T `Single ${this.props.segmentType}`,
|
|
86
|
+
react_1.default.createElement("span", { className: "text-muted" }, T ` - used for summary ${this.props.segmentType}s and empty ${this.props.segmentType}s`)), react_1.default.createElement(ui.Radio, { key: "multiple", value: this.state.mode, radioValue: "multiple", onChange: this.handleMode },
|
|
87
|
+
T `Multiple ${this.props.segmentType}s`,
|
|
88
|
+
react_1.default.createElement("span", { className: "text-muted" }, T ` - disaggregate data by a field`)));
|
|
89
89
|
}
|
|
90
90
|
renderLabel() {
|
|
91
91
|
return R(ui.FormGroup, {
|
|
92
92
|
labelMuted: true,
|
|
93
|
-
label:
|
|
94
|
-
help: this.state.mode === "multiple" ? `Optional label for the ${this.props.segmentType}s` : undefined
|
|
93
|
+
label: T `Label`,
|
|
94
|
+
help: this.state.mode === "multiple" ? T `Optional label for the ${this.props.segmentType}s` : undefined
|
|
95
95
|
}, R("input", {
|
|
96
96
|
ref: (elem) => {
|
|
97
97
|
this.labelElem = elem;
|
|
@@ -107,7 +107,7 @@ class SegmentDesignerComponent extends react_1.default.Component {
|
|
|
107
107
|
const axisBuilder = new __1.AxisBuilder({ schema: this.props.schema });
|
|
108
108
|
const axisType = axisBuilder.getAxisType(this.props.segment.valueAxis);
|
|
109
109
|
const allowValueAxisOnlyValuesPresent = axisType == "enum" || axisType == "enumset" || axisType == "date";
|
|
110
|
-
return react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
110
|
+
return react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Field`, help: T `Field to disaggregate data by` },
|
|
111
111
|
react_1.default.createElement("div", { style: { marginLeft: 8 } },
|
|
112
112
|
R(AxisComponent_1.default, {
|
|
113
113
|
schema: this.props.schema,
|
|
@@ -123,15 +123,17 @@ class SegmentDesignerComponent extends react_1.default.Component {
|
|
|
123
123
|
}),
|
|
124
124
|
allowValueAxisOnlyValuesPresent ?
|
|
125
125
|
react_1.default.createElement(ui.Checkbox, { value: this.props.segment.valueAxisOnlyValuesPresent, onChange: this.handleValueAxisOnlyValuesPresentChange },
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
T `Only show values actually present`,
|
|
127
|
+
"\u00A0",
|
|
128
|
+
react_1.default.createElement(PopoverHelpComponent_1.default, { placement: "bottom" }, T `Limits values to those that are present in the data, as opposed
|
|
129
|
+
to all choices or all dates within range`))
|
|
128
130
|
: null));
|
|
129
131
|
}
|
|
130
132
|
renderFilter() {
|
|
131
133
|
return R(ui.FormGroup, {
|
|
132
134
|
labelMuted: true,
|
|
133
|
-
label: [R(ui.Icon, { id: "glyphicon-filter" }),
|
|
134
|
-
hint: `Filters all data associated with this ${this.props.segmentType}`
|
|
135
|
+
label: [R(ui.Icon, { id: "glyphicon-filter" }), T ` Filters`],
|
|
136
|
+
hint: T `Filters all data associated with this ${this.props.segmentType}`
|
|
135
137
|
}, R(expressions_ui_2.FilterExprComponent, {
|
|
136
138
|
schema: this.props.schema,
|
|
137
139
|
dataSource: this.props.dataSource,
|
|
@@ -143,15 +145,15 @@ class SegmentDesignerComponent extends react_1.default.Component {
|
|
|
143
145
|
renderStyling() {
|
|
144
146
|
return R(ui.FormGroup, {
|
|
145
147
|
labelMuted: true,
|
|
146
|
-
label:
|
|
148
|
+
label: T `Styling`
|
|
147
149
|
}, react_1.default.createElement("div", null,
|
|
148
|
-
react_1.default.createElement(ui.Checkbox, { key: "bold", inline: true, value: this.props.segment.bold === true, onChange: (value) => this.update({ bold: value }) },
|
|
149
|
-
react_1.default.createElement(ui.Checkbox, { key: "italic", inline: true, value: this.props.segment.italic === true, onChange: (value) => this.update({ italic: value }) },
|
|
150
|
+
react_1.default.createElement(ui.Checkbox, { key: "bold", inline: true, value: this.props.segment.bold === true, onChange: (value) => this.update({ bold: value }) }, T `Bold`),
|
|
151
|
+
react_1.default.createElement(ui.Checkbox, { key: "italic", inline: true, value: this.props.segment.italic === true, onChange: (value) => this.update({ italic: value }) }, T `Italic`),
|
|
150
152
|
this.props.segment.valueAxis && this.props.segment.label ?
|
|
151
|
-
react_1.default.createElement(ui.Checkbox, { key: "valueLabelBold", inline: true, value: this.props.segment.valueLabelBold === true, onChange: (value) => this.update({ valueLabelBold: value }) },
|
|
153
|
+
react_1.default.createElement(ui.Checkbox, { key: "valueLabelBold", inline: true, value: this.props.segment.valueLabelBold === true, onChange: (value) => this.update({ valueLabelBold: value }) }, T `Header Bold`)
|
|
152
154
|
: undefined,
|
|
153
155
|
this.props.segment.valueAxis && this.props.segment.label
|
|
154
|
-
? R("div", { style: { paddingTop: 5 } },
|
|
156
|
+
? R("div", { style: { paddingTop: 5 } }, T `Shade filler cells: `, R(ColorComponent_1.default, {
|
|
155
157
|
color: this.props.segment.fillerColor,
|
|
156
158
|
onChange: (color) => this.update({ fillerColor: color })
|
|
157
159
|
}))
|
|
@@ -160,16 +162,16 @@ class SegmentDesignerComponent extends react_1.default.Component {
|
|
|
160
162
|
renderBorders() {
|
|
161
163
|
return R(ui.FormGroup, {
|
|
162
164
|
labelMuted: true,
|
|
163
|
-
label:
|
|
164
|
-
}, R("div", { key: "before" }, this.props.segmentType === "row" ?
|
|
165
|
+
label: T `Borders`
|
|
166
|
+
}, R("div", { key: "before" }, this.props.segmentType === "row" ? T `Top: ` : T `Left: `), R(BorderComponent, {
|
|
165
167
|
value: this.props.segment.borderBefore,
|
|
166
168
|
defaultValue: 2,
|
|
167
169
|
onChange: (value) => this.update({ borderBefore: value })
|
|
168
|
-
}), R("div", { key: "within" },
|
|
170
|
+
}), R("div", { key: "within" }, T `Within: `), R(BorderComponent, {
|
|
169
171
|
value: this.props.segment.borderWithin,
|
|
170
172
|
defaultValue: 1,
|
|
171
173
|
onChange: (value) => this.update({ borderWithin: value })
|
|
172
|
-
}), R("div", { key: "after" }, this.props.segmentType === "row" ?
|
|
174
|
+
}), R("div", { key: "after" }, this.props.segmentType === "row" ? T `Bottom: ` : T `Right: `), R(BorderComponent, {
|
|
173
175
|
value: this.props.segment.borderAfter,
|
|
174
176
|
defaultValue: 2,
|
|
175
177
|
onChange: (value) => this.update({ borderAfter: value })
|
|
@@ -178,8 +180,8 @@ class SegmentDesignerComponent extends react_1.default.Component {
|
|
|
178
180
|
renderOrderExpr() {
|
|
179
181
|
return R(ui.FormGroup, {
|
|
180
182
|
labelMuted: true,
|
|
181
|
-
label: [R(ui.Icon, { id: "fa-sort-amount-asc" }),
|
|
182
|
-
hint: `Sorts the display of this ${this.props.segmentType}`
|
|
183
|
+
label: [R(ui.Icon, { id: "fa-sort-amount-asc" }), T ` Sort`],
|
|
184
|
+
hint: T `Sorts the display of this ${this.props.segmentType}`
|
|
183
185
|
}, R(expressions_ui_1.ExprComponent, {
|
|
184
186
|
schema: this.props.schema,
|
|
185
187
|
dataSource: this.props.dataSource,
|
|
@@ -194,12 +196,12 @@ class SegmentDesignerComponent extends react_1.default.Component {
|
|
|
194
196
|
radioValue: "asc",
|
|
195
197
|
onChange: this.handleOrderDirChange,
|
|
196
198
|
inline: true
|
|
197
|
-
},
|
|
199
|
+
}, T `Ascending`), R(ui.Radio, {
|
|
198
200
|
value: this.props.segment.orderDir || "asc",
|
|
199
201
|
radioValue: "desc",
|
|
200
202
|
onChange: this.handleOrderDirChange,
|
|
201
203
|
inline: true
|
|
202
|
-
},
|
|
204
|
+
}, T `Descending`))
|
|
203
205
|
: undefined);
|
|
204
206
|
}
|
|
205
207
|
render() {
|
|
@@ -211,6 +213,6 @@ exports.default = SegmentDesignerComponent;
|
|
|
211
213
|
class BorderComponent extends react_1.default.Component {
|
|
212
214
|
render() {
|
|
213
215
|
const value = this.props.value != null ? this.props.value : this.props.defaultValue;
|
|
214
|
-
return R("span", null, react_1.default.createElement(bootstrap_1.Radio, { inline: true, value: value, radioValue: 0, onChange: () => this.props.onChange(0) },
|
|
216
|
+
return R("span", null, react_1.default.createElement(bootstrap_1.Radio, { inline: true, value: value, radioValue: 0, onChange: () => this.props.onChange(0) }, T `None`), react_1.default.createElement(bootstrap_1.Radio, { inline: true, value: value, radioValue: 1, onChange: () => this.props.onChange(1) }, T `Light`), react_1.default.createElement(bootstrap_1.Radio, { inline: true, value: value, radioValue: 2, onChange: () => this.props.onChange(2) }, T `Medium`), react_1.default.createElement(bootstrap_1.Radio, { inline: true, value: value, radioValue: 3, onChange: () => this.props.onChange(3) }, T `Heavy`));
|
|
215
217
|
}
|
|
216
218
|
}
|
|
@@ -37,7 +37,7 @@ class OrderingsComponent extends react_1.default.Component {
|
|
|
37
37
|
onOrderingChange: this.handleOrderingChange.bind(null, i),
|
|
38
38
|
onOrderingRemove: this.handleOrderingRemove.bind(null, i)
|
|
39
39
|
});
|
|
40
|
-
}), R("button", { type: "button", className: "btn btn-sm btn-secondary", onClick: this.handleAdd, key: "add" }, R("span", { className: "fas fa-plus" }),
|
|
40
|
+
}), R("button", { type: "button", className: "btn btn-sm btn-secondary", onClick: this.handleAdd, key: "add" }, R("span", { className: "fas fa-plus" }), T ` Add Ordering`));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
exports.default = OrderingsComponent;
|
|
@@ -61,6 +61,6 @@ class OrderingComponent extends react_1.default.Component {
|
|
|
61
61
|
aggrStatuses: ["individual", "aggregate"],
|
|
62
62
|
value: this.props.ordering.axis?.expr,
|
|
63
63
|
onChange: this.handleExprChange
|
|
64
|
-
}), R("div", null, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, value: this.props.ordering.direction === "desc", onChange: this.handleDirectionChange },
|
|
64
|
+
}), R("div", null, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, value: this.props.ordering.direction === "desc", onChange: this.handleDirectionChange }, T `Reverse`)));
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -72,19 +72,19 @@ class TableChart extends Chart_1.default {
|
|
|
72
72
|
const axisBuilder = new AxisBuilder_1.default({ schema });
|
|
73
73
|
// Check that has table
|
|
74
74
|
if (!design.table) {
|
|
75
|
-
return
|
|
75
|
+
return T `Missing data source`;
|
|
76
76
|
}
|
|
77
77
|
let error = null;
|
|
78
78
|
for (let column of design.columns) {
|
|
79
79
|
// Check that has textAxis
|
|
80
80
|
if (!column.textAxis) {
|
|
81
|
-
error = error ||
|
|
81
|
+
error = error || T `Missing text`;
|
|
82
82
|
}
|
|
83
83
|
error = error || axisBuilder.validateAxis({ axis: column.textAxis });
|
|
84
84
|
}
|
|
85
85
|
for (let ordering of design.orderings) {
|
|
86
86
|
if (!ordering.axis) {
|
|
87
|
-
error = error ||
|
|
87
|
+
error = error || T `Missing order expression`;
|
|
88
88
|
}
|
|
89
89
|
error = error || axisBuilder.validateAxis({ axis: ordering.axis });
|
|
90
90
|
}
|
|
@@ -41,7 +41,7 @@ const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
|
41
41
|
const valueFormatter_1 = require("../../../valueFormatter");
|
|
42
42
|
const valueFormatter_2 = require("../../../valueFormatter");
|
|
43
43
|
const AxisComponent_1 = __importDefault(require("../../../axes/AxisComponent"));
|
|
44
|
-
const
|
|
44
|
+
const expressions_ui_4 = require("@mwater/expressions-ui");
|
|
45
45
|
class TableChartDesignerComponent extends react_1.default.Component {
|
|
46
46
|
// Updates design with the specified changes
|
|
47
47
|
updateDesign(changes) {
|
|
@@ -79,7 +79,7 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
79
79
|
this.updateDesign({ columns });
|
|
80
80
|
};
|
|
81
81
|
renderTable() {
|
|
82
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ",
|
|
82
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T `Data Source`), ": ", R(expressions_ui_3.TableSelectComponent, {
|
|
83
83
|
schema: this.props.schema,
|
|
84
84
|
value: this.props.design.table,
|
|
85
85
|
onChange: this.handleTableChange,
|
|
@@ -88,12 +88,12 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
88
88
|
}));
|
|
89
89
|
}
|
|
90
90
|
renderTitle() {
|
|
91
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" },
|
|
91
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, T `Title`), R("input", {
|
|
92
92
|
type: "text",
|
|
93
93
|
className: "form-control form-control-sm",
|
|
94
94
|
value: this.props.design.titleText,
|
|
95
95
|
onChange: this.handleTitleTextChange,
|
|
96
|
-
placeholder:
|
|
96
|
+
placeholder: T `Untitled`
|
|
97
97
|
}));
|
|
98
98
|
}
|
|
99
99
|
renderColumn = (column, index, connectDragSource, connectDragPreview, connectDropTarget) => {
|
|
@@ -124,7 +124,7 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
124
124
|
onReorder: this.handleReorder,
|
|
125
125
|
renderItem: this.renderColumn,
|
|
126
126
|
getItemId: (item) => item.id
|
|
127
|
-
}), R("button", { className: "btn btn-secondary btn-sm", type: "button", onClick: this.handleAddColumn }, R("span", { className: "fas fa-plus" }), " Add Column
|
|
127
|
+
}), R("button", { className: "btn btn-secondary btn-sm", type: "button", onClick: this.handleAddColumn }, R("span", { className: "fas fa-plus" }), " ", T `Add Column`));
|
|
128
128
|
}
|
|
129
129
|
// return R 'div', className: "form-group",
|
|
130
130
|
// _.map(@props.design.columns, (column, i) => @renderColumn(i))
|
|
@@ -134,7 +134,7 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
134
134
|
if (!this.props.design.table) {
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-sort-amount-down" }), " ",
|
|
137
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-sort-amount-down" }), " ", T `Ordering`), R("div", { style: { marginLeft: 8 } }, react_1.default.createElement(OrderingsComponent_1.default, {
|
|
138
138
|
schema: this.props.schema,
|
|
139
139
|
dataSource: this.props.dataSource,
|
|
140
140
|
orderings: this.props.design.orderings,
|
|
@@ -147,7 +147,7 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
147
147
|
if (!this.props.design.table) {
|
|
148
148
|
return null;
|
|
149
149
|
}
|
|
150
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ",
|
|
150
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ", T `Filters`), R("div", { style: { marginLeft: 8 } }, react_1.default.createElement(expressions_ui_2.FilterExprComponent, {
|
|
151
151
|
schema: this.props.schema,
|
|
152
152
|
dataSource: this.props.dataSource,
|
|
153
153
|
onChange: this.handleFilterChange,
|
|
@@ -160,7 +160,7 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
160
160
|
if (!this.props.design.table) {
|
|
161
161
|
return null;
|
|
162
162
|
}
|
|
163
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" },
|
|
163
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, T `Maximum Number of Rows (up to 1000)`), R("div", { style: { marginLeft: 8 } }, R(ui.NumberInput, {
|
|
164
164
|
value: this.props.design.limit,
|
|
165
165
|
onChange: this.handleLimitChange,
|
|
166
166
|
decimal: false,
|
|
@@ -173,7 +173,7 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
173
173
|
}
|
|
174
174
|
exports.default = TableChartDesignerComponent;
|
|
175
175
|
class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
176
|
-
static contextType =
|
|
176
|
+
static contextType = expressions_ui_4.LocaleContext;
|
|
177
177
|
// Updates column with the specified changes
|
|
178
178
|
updateColumn(changes) {
|
|
179
179
|
const column = lodash_1.default.extend({}, this.props.design.columns[this.props.index], changes);
|
|
@@ -203,7 +203,7 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
203
203
|
}
|
|
204
204
|
renderExpr() {
|
|
205
205
|
const column = this.props.design.columns[this.props.index];
|
|
206
|
-
const title =
|
|
206
|
+
const title = T `Value`;
|
|
207
207
|
return R("div", null, R("label", { className: "text-muted" }, title), ": ", react_1.default.createElement(expressions_ui_1.ExprComponent, {
|
|
208
208
|
schema: this.props.schema,
|
|
209
209
|
dataSource: this.props.dataSource,
|
|
@@ -225,7 +225,7 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
225
225
|
if (!formats) {
|
|
226
226
|
return null;
|
|
227
227
|
}
|
|
228
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" },
|
|
228
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, T `Format`), ": ", R("select", {
|
|
229
229
|
value: column.format != null ? column.format : (0, valueFormatter_2.getDefaultFormat)(exprType),
|
|
230
230
|
className: "form-select",
|
|
231
231
|
style: { width: "auto", display: "inline-block" },
|
|
@@ -236,7 +236,7 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
236
236
|
const column = this.props.design.columns[this.props.index];
|
|
237
237
|
const axisBuilder = new AxisBuilder_1.default({ schema: this.props.schema });
|
|
238
238
|
const placeholder = column.textAxis ? axisBuilder.summarizeAxis(column.textAxis ?? null, this.context) : "";
|
|
239
|
-
return R("div", null, R("label", { className: "text-muted" },
|
|
239
|
+
return R("div", null, R("label", { className: "text-muted" }, T `Header`), ": ", R("input", {
|
|
240
240
|
type: "text",
|
|
241
241
|
className: "form-control form-control-sm",
|
|
242
242
|
style: { display: "inline-block", width: "15em" },
|
|
@@ -252,12 +252,12 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
252
252
|
if (!exprType || exprType !== 'number') {
|
|
253
253
|
return null;
|
|
254
254
|
}
|
|
255
|
-
return R('div', null, R(ui.Checkbox, { value: column.summarize, inline: true, onChange: (summarize) => this.updateColumn({ summarize, summaryType: column.summaryType ?? 'sum' }) },
|
|
256
|
-
R('div', null, R("label", { className: "text-muted" },
|
|
255
|
+
return R('div', null, R(ui.Checkbox, { value: column.summarize, inline: true, onChange: (summarize) => this.updateColumn({ summarize, summaryType: column.summaryType ?? 'sum' }) }, T `Summarize`), column.summarize ?
|
|
256
|
+
R('div', null, R("label", { className: "text-muted" }, T `Summary Type`), ": ", R(ui.Select, {
|
|
257
257
|
inline: true,
|
|
258
258
|
value: column.summaryType,
|
|
259
259
|
onChange: (summaryType) => this.updateColumn({ summaryType }),
|
|
260
|
-
options: [{ value: 'avg', label:
|
|
260
|
+
options: [{ value: 'avg', label: T `Average` }, { value: 'sum', label: T `Sum` }, { value: 'min', label: T `Minimum` }, { value: 'max', label: T `Maximum` }]
|
|
261
261
|
})) : undefined);
|
|
262
262
|
}
|
|
263
263
|
renderBackgroundColorAxis() {
|
|
@@ -265,7 +265,7 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
265
265
|
if (!column.textAxis)
|
|
266
266
|
return null;
|
|
267
267
|
return R(ui.CollapsibleSection, {
|
|
268
|
-
label:
|
|
268
|
+
label: T `Background color by data`,
|
|
269
269
|
labelMuted: true
|
|
270
270
|
}, R(AxisComponent_1.default, {
|
|
271
271
|
schema: this.props.schema,
|
|
@@ -286,6 +286,6 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
286
286
|
fontSize: 12,
|
|
287
287
|
height: 20
|
|
288
288
|
};
|
|
289
|
-
return R("div", null, this.props.connectDragSource(R("i", { className: "fa fa-bars", style: iconStyle })), this.renderRemove(), R("label", null, `Column ${this.props.index + 1}`), R("div", { style: { marginLeft: 5 } }, this.renderExpr(), this.renderFormat(), this.renderHeader(), this.renderSummarize(), this.renderBackgroundColorAxis()));
|
|
289
|
+
return R("div", null, this.props.connectDragSource(R("i", { className: "fa fa-bars", style: iconStyle })), this.renderRemove(), R("label", null, T `Column ${this.props.index + 1}`), R("div", { style: { marginLeft: 5 } }, this.renderExpr(), this.renderFormat(), this.renderHeader(), this.renderSummarize(), this.renderBackgroundColorAxis()));
|
|
290
290
|
}
|
|
291
291
|
}
|