@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
|
@@ -117,8 +117,8 @@ class LayeredChartDesignerComponent extends react_1.default.Component {
|
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
const compiler = new LayeredChartCompiler_1.default({ schema: this.props.schema });
|
|
120
|
-
return R("div", null, R("div", { className: "form-text text-muted" },
|
|
121
|
-
? R("div", { className: "mb-3" }, R("span", null, R("label", { className: "text-muted" }, this.props.design.transpose ?
|
|
120
|
+
return R("div", null, R("div", { className: "form-text text-muted" }, T `To edit title of chart, click on it directly`), this.areAxesLabelsNeeded()
|
|
121
|
+
? R("div", { className: "mb-3" }, R("span", null, R("label", { className: "text-muted" }, this.props.design.transpose ? T `Vertical Axis Label` : T `Horizontal Axis Label`), " ", R("button", { className: "btn btn-secondary btn-sm", onClick: this.handleToggleXAxisLabelClick }, this.props.design.xAxisLabelText != null ? T `Hide` : T `Show`)), this.props.design.xAxisLabelText != null
|
|
122
122
|
? R("input", {
|
|
123
123
|
type: "text",
|
|
124
124
|
className: "form-control form-control-sm",
|
|
@@ -128,7 +128,7 @@ class LayeredChartDesignerComponent extends react_1.default.Component {
|
|
|
128
128
|
})
|
|
129
129
|
: undefined)
|
|
130
130
|
: undefined, this.areAxesLabelsNeeded()
|
|
131
|
-
? R("div", { className: "mb-3" }, R("span", null, R("label", { className: "text-muted" }, !this.props.design.transpose ?
|
|
131
|
+
? R("div", { className: "mb-3" }, R("span", null, R("label", { className: "text-muted" }, !this.props.design.transpose ? T `Vertical Axis Label` : T `Horizontal Axis Label`), " ", R("button", { className: "btn btn-secondary btn-sm", onClick: this.handleToggleYAxisLabelClick }, this.props.design.yAxisLabelText != null ? T `Hide` : T `Show`)), this.props.design.yAxisLabelText != null
|
|
132
132
|
? R("input", {
|
|
133
133
|
type: "text",
|
|
134
134
|
className: "form-control form-control-sm",
|
|
@@ -141,26 +141,26 @@ class LayeredChartDesignerComponent extends react_1.default.Component {
|
|
|
141
141
|
}
|
|
142
142
|
renderChartOptions() {
|
|
143
143
|
return (react_1.default.createElement("div", null,
|
|
144
|
-
react_1.default.createElement(bootstrap_1.Checkbox, { key: "hideLegend", value: this.props.design.hideLegend, onChange: this.handleHideLegendChange },
|
|
145
|
-
react_1.default.createElement(bootstrap_1.Checkbox, { key: "xAxisTickMultiline", value: this.props.design.xAxisTickMultiline ?? true, onChange: this.handleXAxisTickMultilineChange },
|
|
144
|
+
react_1.default.createElement(bootstrap_1.Checkbox, { key: "hideLegend", value: this.props.design.hideLegend, onChange: this.handleHideLegendChange }, T `Hide legend`),
|
|
145
|
+
react_1.default.createElement(bootstrap_1.Checkbox, { key: "xAxisTickMultiline", value: this.props.design.xAxisTickMultiline ?? true, onChange: this.handleXAxisTickMultilineChange }, T `Multiline X-Axis Labels`)));
|
|
146
146
|
}
|
|
147
147
|
renderType() {
|
|
148
148
|
const chartTypes = [
|
|
149
|
-
{ id: "bar", name:
|
|
150
|
-
{ id: "pie", name:
|
|
151
|
-
{ id: "donut", name:
|
|
152
|
-
{ id: "line", name:
|
|
153
|
-
{ id: "spline", name:
|
|
154
|
-
{ id: "scatter", name:
|
|
155
|
-
{ id: "area", name:
|
|
149
|
+
{ id: "bar", name: T `Bar`, desc: T `Best for most charts` },
|
|
150
|
+
{ id: "pie", name: T `Pie`, desc: T `Compare ratios of one variable` },
|
|
151
|
+
{ id: "donut", name: T `Donut`, desc: T `Pie chart with center removed` },
|
|
152
|
+
{ id: "line", name: T `Line`, desc: T `Show how data changes smoothly over time` },
|
|
153
|
+
{ id: "spline", name: T `Smoothed Line`, desc: T `For noisy data over time` },
|
|
154
|
+
{ id: "scatter", name: T `Scatter`, desc: T `Show correlation between two number variables` },
|
|
155
|
+
{ id: "area", name: T `Area`, desc: T `For cumulative data over time` }
|
|
156
156
|
];
|
|
157
157
|
const current = lodash_1.default.findWhere(chartTypes, { id: this.props.design.type });
|
|
158
|
-
return R(uiComponents.SectionComponent, { icon: "glyphicon-th", label:
|
|
158
|
+
return R(uiComponents.SectionComponent, { icon: "glyphicon-th", label: T `Chart Type` }, R(uiComponents.ToggleEditComponent, {
|
|
159
159
|
forceOpen: !this.props.design.type,
|
|
160
160
|
label: current ? current.name : "",
|
|
161
161
|
editor: (onClose) => {
|
|
162
162
|
return R(uiComponents.OptionListComponent, {
|
|
163
|
-
hint:
|
|
163
|
+
hint: T `Select a Chart Type`,
|
|
164
164
|
items: lodash_1.default.map(chartTypes, ct => ({
|
|
165
165
|
name: ct.name,
|
|
166
166
|
desc: ct.desc,
|
|
@@ -195,7 +195,7 @@ class LayeredChartDesignerComponent extends react_1.default.Component {
|
|
|
195
195
|
return R("div", null, lodash_1.default.map(this.props.design.layers, (layer, i) => this.renderLayer(i)),
|
|
196
196
|
// Only add if last has table
|
|
197
197
|
this.props.design.layers.length > 0 && lodash_1.default.last(this.props.design.layers).table
|
|
198
|
-
? R("button", { className: "btn btn-link", type: "button", onClick: this.handleAddLayer }, R("span", { className: "fas fa-plus" }),
|
|
198
|
+
? R("button", { className: "btn btn-link", type: "button", onClick: this.handleAddLayer }, R("span", { className: "fas fa-plus" }), T ` Add Another Series`)
|
|
199
199
|
: undefined);
|
|
200
200
|
}
|
|
201
201
|
renderOptions() {
|
|
@@ -210,23 +210,23 @@ class LayeredChartDesignerComponent extends react_1.default.Component {
|
|
|
210
210
|
}
|
|
211
211
|
// Don't include if transpose
|
|
212
212
|
const canTranspose = !["pie", "donut"].includes(design.type);
|
|
213
|
-
return R("div", { className: "text-muted" }, canTranspose ? (react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, key: "transpose", value: design.transpose, onChange: this.handleTransposeChange },
|
|
213
|
+
return R("div", { className: "text-muted" }, canTranspose ? (react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, key: "transpose", value: design.transpose, onChange: this.handleTransposeChange }, T `Horizontal`)) : undefined, canStack ? (react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, key: "stacked", value: design.stacked, onChange: this.handleStackedChange }, T `Stacked`)) : undefined, canStack ? (react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, key: "proportional", value: design.proportional, onChange: this.handleProportionalChange }, T `Proportional`)) : undefined, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, key: "labels", value: design.labels || false, onChange: this.handleLabelsChange }, T `Show Values`), ["pie", "donut"].includes(design.type)
|
|
214
214
|
? [
|
|
215
|
-
react_1.default.createElement(bootstrap_1.Checkbox, { key: "percentVisible", inline: true, value: design.hidePercentage, onChange: this.handlePercentageVisibilityChange },
|
|
215
|
+
react_1.default.createElement(bootstrap_1.Checkbox, { key: "percentVisible", inline: true, value: design.hidePercentage, onChange: this.handlePercentageVisibilityChange }, T `Hide Percentage`),
|
|
216
216
|
react_1.default.createElement(bootstrap_1.Select, { size: "sm", value: design.polarOrder ?? "desc", onChange: this.handlePolarOrderChange, options: [
|
|
217
|
-
{ value: "desc", label:
|
|
218
|
-
{ value: "asc", label:
|
|
219
|
-
{ value: "natural", label:
|
|
217
|
+
{ value: "desc", label: T `Descending Order` },
|
|
218
|
+
{ value: "asc", label: T `Ascending Order` },
|
|
219
|
+
{ value: "natural", label: T `Natural Order` }
|
|
220
220
|
], inline: true })
|
|
221
221
|
]
|
|
222
222
|
: undefined, design.labels && design.type === "bar" && !design.transpose
|
|
223
|
-
? R("div", null, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, key: "labels", value: design.popoutSmallValues || false, onChange: this.handleLabelsPopoutChange },
|
|
223
|
+
? R("div", null, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, key: "labels", value: design.popoutSmallValues || false, onChange: this.handleLabelsPopoutChange }, T `Show Popout labels for small values`))
|
|
224
224
|
: undefined);
|
|
225
225
|
}
|
|
226
226
|
renderThresholds() {
|
|
227
227
|
// Doesn't apply to polar
|
|
228
228
|
if (this.props.design.type && !["pie", "donut"].includes(this.props.design.type)) {
|
|
229
|
-
return R(uiComponents.SectionComponent, { label:
|
|
229
|
+
return R(uiComponents.SectionComponent, { label: T `Y Threshold Lines` }, R(ThresholdsComponent, {
|
|
230
230
|
thresholds: this.props.design.yThresholds,
|
|
231
231
|
onThresholdsChange: this.handleYThresholdsChange,
|
|
232
232
|
showHighlightColor: this.props.design.type === "bar"
|
|
@@ -237,20 +237,20 @@ class LayeredChartDesignerComponent extends react_1.default.Component {
|
|
|
237
237
|
renderYRange() {
|
|
238
238
|
// Doesn't apply to polar
|
|
239
239
|
if (this.props.design.type && !["pie", "donut"].includes(this.props.design.type)) {
|
|
240
|
-
return R(uiComponents.SectionComponent, { label:
|
|
240
|
+
return R(uiComponents.SectionComponent, { label: T `Y Axis Range` }, R(LabeledInlineComponent, { key: "min", label: T `Min:` }, R(ui.NumberInput, {
|
|
241
241
|
decimal: true,
|
|
242
242
|
style: { display: "inline-block" },
|
|
243
243
|
size: "sm",
|
|
244
244
|
value: this.props.design.yMin,
|
|
245
245
|
onChange: this.handleYMinChange,
|
|
246
|
-
placeholder:
|
|
247
|
-
})), " ", R(LabeledInlineComponent, { key: "label", label:
|
|
246
|
+
placeholder: T `Auto`
|
|
247
|
+
})), " ", R(LabeledInlineComponent, { key: "label", label: T `Max:` }, R(ui.NumberInput, {
|
|
248
248
|
decimal: true,
|
|
249
249
|
style: { display: "inline-block" },
|
|
250
250
|
size: "sm",
|
|
251
251
|
value: this.props.design.yMax,
|
|
252
252
|
onChange: this.handleYMaxChange,
|
|
253
|
-
placeholder:
|
|
253
|
+
placeholder: T `Auto`
|
|
254
254
|
})));
|
|
255
255
|
}
|
|
256
256
|
return null;
|
|
@@ -259,19 +259,19 @@ class LayeredChartDesignerComponent extends react_1.default.Component {
|
|
|
259
259
|
const tabs = [];
|
|
260
260
|
tabs.push({
|
|
261
261
|
id: "design",
|
|
262
|
-
label:
|
|
262
|
+
label: T `Design`,
|
|
263
263
|
elem: R("div", { style: { paddingBottom: 200 } }, R("br"), this.renderType(), this.renderLayers(), this.renderThresholds(), this.renderYRange())
|
|
264
264
|
});
|
|
265
265
|
if (this.props.design.type) {
|
|
266
266
|
tabs.push({
|
|
267
267
|
id: "labels",
|
|
268
|
-
label:
|
|
268
|
+
label: T `Labels`,
|
|
269
269
|
elem: R("div", null, R("br"), this.renderLabels())
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
272
|
tabs.push({
|
|
273
273
|
id: "options",
|
|
274
|
-
label:
|
|
274
|
+
label: T `Options`,
|
|
275
275
|
elem: R("div", null, R("br"), this.renderChartOptions())
|
|
276
276
|
});
|
|
277
277
|
return R(TabbedComponent_1.default, {
|
|
@@ -306,24 +306,24 @@ class ThresholdsComponent extends react_1.default.Component {
|
|
|
306
306
|
onRemove: this.handleRemove.bind(null, index),
|
|
307
307
|
showHighlightColor: this.props.showHighlightColor
|
|
308
308
|
});
|
|
309
|
-
}), R("button", { type: "button", className: "btn btn-sm btn-link", onClick: this.handleAdd }, R("i", { className: "fa fa-plus" }),
|
|
309
|
+
}), R("button", { type: "button", className: "btn btn-sm btn-link", onClick: this.handleAdd }, R("i", { className: "fa fa-plus" }), T ` Add Y Threshold`));
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
class ThresholdComponent extends react_1.default.Component {
|
|
313
313
|
render() {
|
|
314
|
-
return R("div", null, R(LabeledInlineComponent, { key: "value", label:
|
|
314
|
+
return R("div", null, R(LabeledInlineComponent, { key: "value", label: T `Value:` }, R(ui.NumberInput, {
|
|
315
315
|
decimal: true,
|
|
316
316
|
style: { display: "inline-block" },
|
|
317
317
|
size: "sm",
|
|
318
318
|
value: this.props.threshold.value,
|
|
319
319
|
onChange: v => this.props.onThresholdChange(lodash_1.default.extend({}, this.props.threshold, { value: v }))
|
|
320
|
-
})), " ", R(LabeledInlineComponent, { key: "label", label:
|
|
320
|
+
})), " ", R(LabeledInlineComponent, { key: "label", label: T `Label:` }, R(ui.TextInput, {
|
|
321
321
|
style: { display: "inline-block", width: "8em" },
|
|
322
322
|
size: "sm",
|
|
323
323
|
value: this.props.threshold.label,
|
|
324
324
|
onChange: (v) => this.props.onThresholdChange(lodash_1.default.extend({}, this.props.threshold, { label: v }))
|
|
325
325
|
})), " ", this.props.showHighlightColor
|
|
326
|
-
? R(LabeledInlineComponent, { key: "color", label:
|
|
326
|
+
? R(LabeledInlineComponent, { key: "color", label: T `Highlight color:` }, R("div", { style: { verticalAlign: "middle", display: "inline-block" } }, R(ColorComponent_1.default, {
|
|
327
327
|
color: this.props.threshold.highlightColor,
|
|
328
328
|
onChange: (v) => this.props.onThresholdChange(lodash_1.default.extend({}, this.props.threshold, { highlightColor: v }))
|
|
329
329
|
})))
|
|
@@ -61,31 +61,31 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
61
61
|
// Determine icon/label for color axis
|
|
62
62
|
getXAxisLabel(layer) {
|
|
63
63
|
if (this.props.design.transpose) {
|
|
64
|
-
return this.getAxisLabel("resize-vertical",
|
|
64
|
+
return this.getAxisLabel("resize-vertical", T `Vertical Axis`);
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
|
-
return this.getAxisLabel("resize-horizontal",
|
|
67
|
+
return this.getAxisLabel("resize-horizontal", T `Horizontal Axis`);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
// Determine icon/label for color axis
|
|
71
71
|
getYAxisLabel(layer) {
|
|
72
72
|
if (this.isLayerPolar(layer)) {
|
|
73
|
-
return this.getAxisLabel("repeat",
|
|
73
|
+
return this.getAxisLabel("repeat", T `Angle Axis`);
|
|
74
74
|
}
|
|
75
75
|
else if (this.props.design.transpose) {
|
|
76
|
-
return this.getAxisLabel("resize-horizontal",
|
|
76
|
+
return this.getAxisLabel("resize-horizontal", T `Horizontal Axis`);
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
|
-
return this.getAxisLabel("resize-vertical",
|
|
79
|
+
return this.getAxisLabel("resize-vertical", T `Vertical Axis`);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
// Determine icon/label for color axis
|
|
83
83
|
getColorAxisLabel(layer) {
|
|
84
84
|
if (this.isLayerPolar(layer)) {
|
|
85
|
-
return this.getAxisLabel("text-color",
|
|
85
|
+
return this.getAxisLabel("text-color", T `Label Axis`);
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
return this.getAxisLabel("equalizer",
|
|
88
|
+
return this.getAxisLabel("equalizer", T `Split Axis`);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
// Updates layer with the specified changes
|
|
@@ -148,7 +148,7 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
148
148
|
const layer = this.props.design.layers[this.props.index];
|
|
149
149
|
// R 'div', className: "form-group",
|
|
150
150
|
// R 'label', className: "text-muted", "Series Name"
|
|
151
|
-
const placeholder = this.props.design.layers.length === 1 ?
|
|
151
|
+
const placeholder = this.props.design.layers.length === 1 ? T `Value` : T `Series ${this.props.index + 1}`;
|
|
152
152
|
return R("input", {
|
|
153
153
|
type: "text",
|
|
154
154
|
className: "form-control form-control-sm",
|
|
@@ -165,7 +165,7 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
165
165
|
}
|
|
166
166
|
renderTable() {
|
|
167
167
|
const layer = this.props.design.layers[this.props.index];
|
|
168
|
-
return R(uiComponents.SectionComponent, { icon: "fa-database", label:
|
|
168
|
+
return R(uiComponents.SectionComponent, { icon: "fa-database", label: T `Data Source` }, R(expressions_ui_2.TableSelectComponent, {
|
|
169
169
|
schema: this.props.schema,
|
|
170
170
|
value: layer.table,
|
|
171
171
|
onChange: this.handleTableChange,
|
|
@@ -214,7 +214,7 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
214
214
|
categoricalX ? R(ui.Checkbox, {
|
|
215
215
|
value: layer.xAxisOnlyValuesPresent,
|
|
216
216
|
onChange: this.handlexAxisOnlyValuesPresentChange
|
|
217
|
-
},
|
|
217
|
+
}, T `Only show values actually present `, R(PopoverHelpComponent_1.default, { placement: 'bottom' }, T `Limits values to those that are present in the data, as opposed to all choices or all dates within range`)) : null,
|
|
218
218
|
react_1.default.createElement("br", null)
|
|
219
219
|
];
|
|
220
220
|
}
|
|
@@ -264,7 +264,7 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
264
264
|
if (!layer.axes.y || !layer.axes.x || !axisBuilder.doesAxisSupportCumulative(layer.axes.x)) {
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
return R("div", { key: "cumulative" }, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, value: layer.cumulative, onChange: this.handleCumulativeChange },
|
|
267
|
+
return R("div", { key: "cumulative" }, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, value: layer.cumulative, onChange: this.handleCumulativeChange }, T `Cumulative`));
|
|
268
268
|
}
|
|
269
269
|
renderTrendline() {
|
|
270
270
|
const layer = this.props.design.layers[this.props.index];
|
|
@@ -273,14 +273,14 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
273
273
|
if (!layer.axes.y || !layer.axes.x || layer.cumulative || layer.stacked || this.props.design.stacked) {
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
return R("div", { key: "trendline" }, react_1.default.createElement(bootstrap_1.Checkbox, { value: layer.trendline === "linear", onChange: this.handleTrendlineChange },
|
|
276
|
+
return R("div", { key: "trendline" }, react_1.default.createElement(bootstrap_1.Checkbox, { value: layer.trendline === "linear", onChange: this.handleTrendlineChange }, T `Show linear trendline`));
|
|
277
277
|
}
|
|
278
278
|
renderStacked() {
|
|
279
279
|
const layer = this.props.design.layers[this.props.index];
|
|
280
280
|
// Only if has color axis and there are more than one layer
|
|
281
281
|
if (layer.axes.color && this.props.design.layers.length > 1) {
|
|
282
282
|
const stacked = layer.stacked != null ? layer.stacked : true;
|
|
283
|
-
return R("div", { key: "stacked" }, react_1.default.createElement(bootstrap_1.Checkbox, { value: stacked, onChange: this.handleStackedChange },
|
|
283
|
+
return R("div", { key: "stacked" }, react_1.default.createElement(bootstrap_1.Checkbox, { value: stacked, onChange: this.handleStackedChange }, T `Stacked`));
|
|
284
284
|
}
|
|
285
285
|
return null;
|
|
286
286
|
}
|
|
@@ -291,10 +291,10 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
293
|
const categoricalX = new LayeredChartCompiler_1.default({ schema: this.props.schema }).isCategoricalX(this.props.design);
|
|
294
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, layer.axes.color ?
|
|
294
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, layer.axes.color ? T `Default Color` : T `Color`), R("div", { style: { marginLeft: 8 } }, R(ColorComponent_1.default, { color: layer.color, onChange: this.handleColorChange }),
|
|
295
295
|
// Allow toggling of colors
|
|
296
296
|
layer.axes.x && categoricalX && !layer.axes.color
|
|
297
|
-
? R(ui.Checkbox, { value: layer.xColorMap, onChange: this.handleXColorMapChange },
|
|
297
|
+
? R(ui.Checkbox, { value: layer.xColorMap, onChange: this.handleXColorMapChange }, T `Set Individual Colors`)
|
|
298
298
|
: undefined));
|
|
299
299
|
}
|
|
300
300
|
renderFilter() {
|
|
@@ -303,7 +303,7 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
303
303
|
if (!layer.table) {
|
|
304
304
|
return null;
|
|
305
305
|
}
|
|
306
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ",
|
|
306
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ", T `Filters`), R("div", { style: { marginLeft: 8 } }, R(expressions_ui_1.FilterExprComponent, {
|
|
307
307
|
schema: this.props.schema,
|
|
308
308
|
dataSource: this.props.dataSource,
|
|
309
309
|
onChange: this.handleFilterChange,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Sanity-check the conversion and remove this comment.
|
|
4
4
|
// Misc utils for layered charts
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getAxisTypes =
|
|
6
|
+
exports.getAxisTypes = getAxisTypes;
|
|
7
7
|
// Get possible types for axis of a layer
|
|
8
8
|
function getAxisTypes(design, layer, axis) {
|
|
9
9
|
// If categorical
|
|
@@ -22,4 +22,3 @@ function getAxisTypes(design, layer, axis) {
|
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
exports.getAxisTypes = getAxisTypes;
|
|
@@ -33,17 +33,17 @@ const LayeredChartCompiler_1 = __importDefault(require("./LayeredChartCompiler")
|
|
|
33
33
|
const TextComponent_1 = __importDefault(require("../../text/TextComponent"));
|
|
34
34
|
const d3 = __importStar(require("d3"));
|
|
35
35
|
const billboard_js_1 = __importDefault(require("billboard.js"));
|
|
36
|
-
const
|
|
36
|
+
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
37
37
|
const TextWidgetDesign_1 = require("../../text/TextWidgetDesign");
|
|
38
38
|
// Displays a layered chart
|
|
39
39
|
class LayeredChartViewComponent extends react_1.default.Component {
|
|
40
|
-
static contextType =
|
|
40
|
+
static contextType = expressions_ui_1.LocaleContext;
|
|
41
41
|
header;
|
|
42
42
|
footer;
|
|
43
43
|
constructor(props) {
|
|
44
44
|
super(props);
|
|
45
45
|
this.state = {
|
|
46
|
-
headerHeight: null,
|
|
46
|
+
headerHeight: null, // Height of header
|
|
47
47
|
footerHeight: null // Height of footer
|
|
48
48
|
};
|
|
49
49
|
}
|
|
@@ -268,7 +268,7 @@ class C3ChartComponent extends react_1.default.Component {
|
|
|
268
268
|
})
|
|
269
269
|
.each(function (_p) {
|
|
270
270
|
smalls.push({
|
|
271
|
-
origin_x: box.x,
|
|
271
|
+
origin_x: box.x, // + box.width,
|
|
272
272
|
origin_y: box.y,
|
|
273
273
|
series: map.get(p.id),
|
|
274
274
|
textY: box.y - 12 * map.get(p.id) - 10,
|
|
@@ -26,6 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.default = IntersectionDesignerComponent;
|
|
29
30
|
const react_1 = __importDefault(require("react"));
|
|
30
31
|
const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
31
32
|
const update_1 = __importDefault(require("@mwater/react-library/lib/update"));
|
|
@@ -64,39 +65,40 @@ function IntersectionDesignerComponent(props) {
|
|
|
64
65
|
props.onChange({ ...props.intersection, tableOverride });
|
|
65
66
|
};
|
|
66
67
|
const renderValueAxis = () => {
|
|
67
|
-
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
68
|
+
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Calculation`, help: T `This is the calculated value that is displayed. Leave as blank to make an empty section` },
|
|
68
69
|
react_1.default.createElement(AxisComponent_1.default, { schema: props.schema, dataSource: props.dataSource, table: table, types: ["enum", "text", "boolean", "date", "number"], aggrNeed: "required", value: props.intersection.valueAxis, onChange: valueAxis => props.onChange({ ...props.intersection, valueAxis }), showFormat: true, filters: props.filters })));
|
|
69
70
|
};
|
|
70
71
|
const renderNullValue = () => {
|
|
71
72
|
if (props.intersection.valueAxis) {
|
|
72
|
-
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
73
|
-
react_1.default.createElement(ui.TextInput, { value: props.intersection.valueAxis.nullLabel ?? null, emptyNull: true, onChange: nullLabel => props.onChange({ ...props.intersection, valueAxis: { ...props.intersection.valueAxis, nullLabel: nullLabel ?? undefined } }), placeholder:
|
|
73
|
+
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Show Empty Cells as` },
|
|
74
|
+
react_1.default.createElement(ui.TextInput, { value: props.intersection.valueAxis.nullLabel ?? null, emptyNull: true, onChange: nullLabel => props.onChange({ ...props.intersection, valueAxis: { ...props.intersection.valueAxis, nullLabel: nullLabel ?? undefined } }), placeholder: T `Blank` })));
|
|
74
75
|
}
|
|
75
76
|
return null;
|
|
76
77
|
};
|
|
77
78
|
const renderFilter = () => {
|
|
78
79
|
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: react_1.default.createElement(react_1.default.Fragment, null,
|
|
79
80
|
react_1.default.createElement(ui.Icon, { id: "glyphicon-filter" }),
|
|
80
|
-
"
|
|
81
|
+
" ",
|
|
82
|
+
T `Filters`) },
|
|
81
83
|
react_1.default.createElement(expressions_ui_1.FilterExprComponent, { schema: props.schema, dataSource: props.dataSource, onChange: handleFilterChange, table: table, value: props.intersection.filter })));
|
|
82
84
|
};
|
|
83
85
|
const renderStyling = () => {
|
|
84
|
-
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, key: "styling", label:
|
|
85
|
-
react_1.default.createElement(ui.Checkbox, { key: "bold", inline: true, value: props.intersection.bold, onChange: bold => props.onChange({ ...props.intersection, bold }) },
|
|
86
|
-
react_1.default.createElement(ui.Checkbox, { key: "italic", inline: true, value: props.intersection.italic, onChange: italic => props.onChange({ ...props.intersection, italic }) },
|
|
86
|
+
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, key: "styling", label: T `Styling` },
|
|
87
|
+
react_1.default.createElement(ui.Checkbox, { key: "bold", inline: true, value: props.intersection.bold, onChange: bold => props.onChange({ ...props.intersection, bold }) }, T `Bold`),
|
|
88
|
+
react_1.default.createElement(ui.Checkbox, { key: "italic", inline: true, value: props.intersection.italic, onChange: italic => props.onChange({ ...props.intersection, italic }) }, T `Italic`)));
|
|
87
89
|
};
|
|
88
90
|
const renderBackgroundColorConditions = () => {
|
|
89
91
|
return (react_1.default.createElement(BackgroundColorConditionsComponent, { schema: props.schema, dataSource: props.dataSource, table: table, colorConditions: props.intersection.backgroundColorConditions, onChange: handleBackgroundColorConditionsChange }));
|
|
90
92
|
};
|
|
91
93
|
const renderBackgroundColorAxis = () => {
|
|
92
|
-
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
94
|
+
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Background Color From Values`, help: T `This is an optional background color to set on cells that is controlled by the data` },
|
|
93
95
|
react_1.default.createElement(AxisComponent_1.default, { schema: props.schema, dataSource: props.dataSource, table: table, types: ["enum", "text", "boolean", "date"], aggrNeed: "required", value: props.intersection.backgroundColorAxis, onChange: handleBackgroundColorAxisChange, showColorMap: true, filters: props.filters })));
|
|
94
96
|
};
|
|
95
97
|
const renderBackgroundColor = () => {
|
|
96
98
|
if (props.intersection.backgroundColorAxis) {
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
99
|
-
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
101
|
+
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Background Color`, help: T `This is an optional background color to set on all cells` },
|
|
100
102
|
react_1.default.createElement(ColorComponent_1.default, { color: props.intersection.backgroundColor, onChange: handleBackgroundColorChange })));
|
|
101
103
|
};
|
|
102
104
|
const renderBackgroundColorOpacityControl = () => {
|
|
@@ -105,7 +107,7 @@ function IntersectionDesignerComponent(props) {
|
|
|
105
107
|
!props.intersection.backgroundColorConditions?.[0]) {
|
|
106
108
|
return;
|
|
107
109
|
}
|
|
108
|
-
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: `Background Opacity: ${Math.round((props.intersection.backgroundColorOpacity ?? 1) * 100)}%` },
|
|
110
|
+
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Background Opacity: ${Math.round((props.intersection.backgroundColorOpacity ?? 1) * 100)}%` },
|
|
109
111
|
react_1.default.createElement(rc_slider_1.default, { min: 0, max: 100, step: 1, tipTransitionName: "rc-slider-tooltip-zoom-down", value: (props.intersection.backgroundColorOpacity ?? 1) * 100, onChange: handleBackgroundColorOpacityChange })));
|
|
110
112
|
};
|
|
111
113
|
const renderSegmentValueAxisOverride = (segment) => {
|
|
@@ -131,10 +133,10 @@ function IntersectionDesignerComponent(props) {
|
|
|
131
133
|
// Filter out segments that are not intersecting
|
|
132
134
|
const intersectingSegmentIds = props.intersectionId.split(/[,:]/).filter(id => id !== "");
|
|
133
135
|
const intersectingSegments = segments.filter(segment => intersectingSegmentIds.includes(segment.id) && segment.valueAxis);
|
|
134
|
-
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
136
|
+
return (react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Fields to disaggregate data by (required)` }, intersectingSegments.map(segment => renderSegmentValueAxisOverride(segment))));
|
|
135
137
|
};
|
|
136
138
|
const renderOverrideTable = () => {
|
|
137
|
-
return (react_1.default.createElement(ui.CollapsibleSection, { label:
|
|
139
|
+
return (react_1.default.createElement(ui.CollapsibleSection, { label: T `Advanced: Override Data Source`, hint: T `Use a different data source for this cell`, labelMuted: true, initiallyOpen: props.intersection.tableOverride != null },
|
|
138
140
|
react_1.default.createElement(expressions_ui_1.TableSelectComponent, { schema: props.schema, value: props.intersection.tableOverride, onChange: handleTableOverrideChange }),
|
|
139
141
|
react_1.default.createElement("br", null),
|
|
140
142
|
renderSegmentValueAxisOverrides()));
|
|
@@ -150,7 +152,6 @@ function IntersectionDesignerComponent(props) {
|
|
|
150
152
|
renderBackgroundColorOpacityControl(),
|
|
151
153
|
renderOverrideTable()));
|
|
152
154
|
}
|
|
153
|
-
exports.default = IntersectionDesignerComponent;
|
|
154
155
|
/** Displays background color conditions */
|
|
155
156
|
class BackgroundColorConditionsComponent extends react_1.default.Component {
|
|
156
157
|
handleAdd = () => {
|
|
@@ -160,13 +161,13 @@ class BackgroundColorConditionsComponent extends react_1.default.Component {
|
|
|
160
161
|
};
|
|
161
162
|
render() {
|
|
162
163
|
// List conditions
|
|
163
|
-
return (react_1.default.createElement(ui.FormGroup, { label:
|
|
164
|
+
return (react_1.default.createElement(ui.FormGroup, { label: T `Color Conditions`, labelMuted: true, help: T `Add conditions that, if met, set the color of the cell. Useful for flagging certain values` },
|
|
164
165
|
react_1.default.createElement(ListEditorComponent_1.ListEditorComponent, { items: this.props.colorConditions || [], renderItem: (item, index, onItemChange) => {
|
|
165
166
|
return (react_1.default.createElement(BackgroundColorConditionComponent, { key: index, colorCondition: item, table: this.props.table, schema: this.props.schema, dataSource: this.props.dataSource, onChange: onItemChange }));
|
|
166
167
|
}, onItemsChange: this.props.onChange }),
|
|
167
168
|
react_1.default.createElement(ui.Button, { type: "link", size: "sm", onClick: this.handleAdd },
|
|
168
169
|
react_1.default.createElement(ui.Icon, { id: "fa-plus" }),
|
|
169
|
-
|
|
170
|
+
T `Add Condition`)));
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
/**
|
|
@@ -183,9 +184,9 @@ class BackgroundColorConditionComponent extends react_1.default.Component {
|
|
|
183
184
|
}
|
|
184
185
|
render() {
|
|
185
186
|
return (react_1.default.createElement("div", null,
|
|
186
|
-
react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
187
|
+
react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Condition` },
|
|
187
188
|
react_1.default.createElement(expressions_ui_2.ExprComponent, { schema: this.props.schema, dataSource: this.props.dataSource, onChange: this.update("condition"), types: ["boolean"], aggrStatuses: ["aggregate", "literal"], table: this.props.table, value: this.props.colorCondition.condition })),
|
|
188
|
-
react_1.default.createElement(ui.FormGroup, { labelMuted: true, label:
|
|
189
|
+
react_1.default.createElement(ui.FormGroup, { labelMuted: true, label: T `Color`, hint: T `Color to display when condition is met` },
|
|
189
190
|
react_1.default.createElement(ColorComponent_1.default, { color: this.props.colorCondition.color, onChange: this.update("color") }))));
|
|
190
191
|
}
|
|
191
192
|
}
|
|
@@ -37,6 +37,6 @@ export default class PivotChart extends Chart {
|
|
|
37
37
|
createViewElement(options: ChartCreateViewElementOptions): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
38
38
|
createDropdownItems(design: any, schema: Schema, widgetDataSource: WidgetDataSource, filters: any): never[];
|
|
39
39
|
createDataTable(design: PivotChartDesign, schema: Schema, dataSource: DataSource, data: any, locale: string): (string | undefined)[][];
|
|
40
|
-
getFilterableTables(design:
|
|
40
|
+
getFilterableTables(design: PivotChartDesign, schema: Schema): string[];
|
|
41
41
|
getPlaceholderIcon(): string;
|
|
42
42
|
}
|
|
@@ -198,15 +198,15 @@ class PivotChart extends Chart_1.default {
|
|
|
198
198
|
const axisBuilder = new AxisBuilder_1.default({ schema });
|
|
199
199
|
// Check that has table
|
|
200
200
|
if (!design.table || !schema.getTable(design.table)) {
|
|
201
|
-
return
|
|
201
|
+
return T `Missing data source`;
|
|
202
202
|
}
|
|
203
203
|
// Check that has rows
|
|
204
204
|
if (design.rows.length === 0) {
|
|
205
|
-
return
|
|
205
|
+
return T `Missing rows`;
|
|
206
206
|
}
|
|
207
207
|
// Check that has columns
|
|
208
208
|
if (design.columns.length === 0) {
|
|
209
|
-
return
|
|
209
|
+
return T `Missing columns`;
|
|
210
210
|
}
|
|
211
211
|
let error = null;
|
|
212
212
|
// Validate axes
|
|
@@ -246,7 +246,7 @@ class PivotChart extends Chart_1.default {
|
|
|
246
246
|
}
|
|
247
247
|
// Label for the edit gear dropdown
|
|
248
248
|
getEditLabel() {
|
|
249
|
-
return
|
|
249
|
+
return T `Configure Table`;
|
|
250
250
|
}
|
|
251
251
|
// Creates a design element with specified options
|
|
252
252
|
// options include:
|
|
@@ -359,10 +359,18 @@ class PivotChart extends Chart_1.default {
|
|
|
359
359
|
// Get a list of table ids that can be filtered on
|
|
360
360
|
getFilterableTables(design, schema) {
|
|
361
361
|
let filterableTables = design.table ? [design.table] : [];
|
|
362
|
+
// Add any table overrides from intersections
|
|
363
|
+
for (const intersection of Object.values(design.intersections)) {
|
|
364
|
+
if (intersection.tableOverride) {
|
|
365
|
+
filterableTables.push(intersection.tableOverride);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
362
368
|
// Get filterable tables from header and footer
|
|
363
369
|
const textWidget = new TextWidget_1.default();
|
|
364
370
|
filterableTables = lodash_1.default.union(filterableTables, textWidget.getFilterableTables(design.header, schema));
|
|
365
371
|
filterableTables = lodash_1.default.union(filterableTables, textWidget.getFilterableTables(design.footer, schema));
|
|
372
|
+
// Remove duplicates
|
|
373
|
+
filterableTables = lodash_1.default.uniq(filterableTables);
|
|
366
374
|
return filterableTables;
|
|
367
375
|
}
|
|
368
376
|
// Get the chart placeholder icon. fa-XYZ or glyphicon-XYZ
|
|
@@ -27,13 +27,13 @@ export default class PivotChartDesignerComponent extends React.Component<PivotCh
|
|
|
27
27
|
}, HTMLElement> | null;
|
|
28
28
|
renderStriping(): React.CElement<{
|
|
29
29
|
label: React.ReactNode;
|
|
30
|
-
labelMuted?: boolean
|
|
30
|
+
labelMuted?: boolean;
|
|
31
31
|
hint?: React.ReactNode;
|
|
32
32
|
help?: React.ReactNode;
|
|
33
|
-
required?: boolean
|
|
34
|
-
hasSuccess?: boolean
|
|
35
|
-
hasWarnings?: boolean
|
|
36
|
-
hasErrors?: boolean
|
|
33
|
+
required?: boolean;
|
|
34
|
+
hasSuccess?: boolean;
|
|
35
|
+
hasWarnings?: boolean;
|
|
36
|
+
hasErrors?: boolean;
|
|
37
37
|
}, ui.FormGroup> | null;
|
|
38
38
|
renderSetup(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
39
39
|
render(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
@@ -76,7 +76,7 @@ class PivotChartDesignerComponent extends react_1.default.Component {
|
|
|
76
76
|
return this.updateDesign({ intersections });
|
|
77
77
|
};
|
|
78
78
|
renderTable() {
|
|
79
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ",
|
|
79
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T `Data Source`), ": ", R(expressions_ui_2.TableSelectComponent, {
|
|
80
80
|
schema: this.props.schema,
|
|
81
81
|
value: this.props.design.table,
|
|
82
82
|
onChange: this.handleTableChange,
|
|
@@ -89,7 +89,7 @@ class PivotChartDesignerComponent extends react_1.default.Component {
|
|
|
89
89
|
if (!this.props.design.table) {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ",
|
|
92
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ", T `Filters`), R("div", { style: { marginLeft: 8 } }, R(expressions_ui_1.FilterExprComponent, {
|
|
93
93
|
schema: this.props.schema,
|
|
94
94
|
dataSource: this.props.dataSource,
|
|
95
95
|
onChange: this.handleFilterChange,
|
|
@@ -104,16 +104,16 @@ class PivotChartDesignerComponent extends react_1.default.Component {
|
|
|
104
104
|
}
|
|
105
105
|
return R(ui.FormGroup, {
|
|
106
106
|
labelMuted: true,
|
|
107
|
-
label:
|
|
108
|
-
}, react_1.default.createElement(ui.Radio, { key: "none", inline: true, radioValue: null, value: this.props.design.striping || null, onChange: (value) => this.updateDesign({ striping: value }) },
|
|
107
|
+
label: T `Striping`
|
|
108
|
+
}, react_1.default.createElement(ui.Radio, { key: "none", inline: true, radioValue: null, value: this.props.design.striping || null, onChange: (value) => this.updateDesign({ striping: value }) }, T `None`), react_1.default.createElement(ui.Radio, { key: "columns", inline: true, radioValue: "columns", value: this.props.design.striping, onChange: (value) => this.updateDesign({ striping: value }) }, T `Columns`), react_1.default.createElement(ui.Radio, { key: "rows", inline: true, value: this.props.design.striping, radioValue: "rows", onChange: (value) => this.updateDesign({ striping: value }) }, T `Rows`));
|
|
109
109
|
}
|
|
110
110
|
// Show setup options
|
|
111
111
|
renderSetup() {
|
|
112
112
|
const intersectionId = `${this.props.design.rows[0].id}:${this.props.design.columns[0].id}`;
|
|
113
113
|
return R("div", null, R(ui.FormGroup, {
|
|
114
114
|
labelMuted: true,
|
|
115
|
-
label:
|
|
116
|
-
help:
|
|
115
|
+
label: T `Columns`,
|
|
116
|
+
help: T `Field to optionally make columns out of`
|
|
117
117
|
}, R(AxisComponent_1.default, {
|
|
118
118
|
schema: this.props.schema,
|
|
119
119
|
dataSource: this.props.dataSource,
|
|
@@ -125,8 +125,8 @@ class PivotChartDesignerComponent extends react_1.default.Component {
|
|
|
125
125
|
filters: this.props.filters
|
|
126
126
|
})), R(ui.FormGroup, {
|
|
127
127
|
labelMuted: true,
|
|
128
|
-
label:
|
|
129
|
-
help:
|
|
128
|
+
label: T `Rows`,
|
|
129
|
+
help: T `Field to optionally make rows out of`
|
|
130
130
|
}, R(AxisComponent_1.default, {
|
|
131
131
|
schema: this.props.schema,
|
|
132
132
|
dataSource: this.props.dataSource,
|
|
@@ -138,8 +138,8 @@ class PivotChartDesignerComponent extends react_1.default.Component {
|
|
|
138
138
|
filters: this.props.filters
|
|
139
139
|
})), R(ui.FormGroup, {
|
|
140
140
|
labelMuted: true,
|
|
141
|
-
label:
|
|
142
|
-
help:
|
|
141
|
+
label: T `Value`,
|
|
142
|
+
help: T `Field show in cells`
|
|
143
143
|
}, R(AxisComponent_1.default, {
|
|
144
144
|
schema: this.props.schema,
|
|
145
145
|
dataSource: this.props.dataSource,
|