@mwater/visualization 5.3.1 → 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 +1 -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 +9 -9
- 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 +102 -75
- 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
|
@@ -78,7 +78,7 @@ export default class ImageWidgetComponent extends AsyncLoadComponent<ImageWidget
|
|
|
78
78
|
|
|
79
79
|
renderExpression() {
|
|
80
80
|
if (this.state.loading) {
|
|
81
|
-
return R("span", null,
|
|
81
|
+
return R("span", null, T`Loading`)
|
|
82
82
|
} else if (this.state.data) {
|
|
83
83
|
// Make into array if not
|
|
84
84
|
if (!_.isArray(this.state.data)) {
|
|
@@ -133,7 +133,7 @@ export default class ImageWidgetComponent extends AsyncLoadComponent<ImageWidget
|
|
|
133
133
|
render() {
|
|
134
134
|
const dropdownItems = []
|
|
135
135
|
if (this.props.onDesignChange != null) {
|
|
136
|
-
dropdownItems.push({ label:
|
|
136
|
+
dropdownItems.push({ label: T`Edit`, icon: "pencil", onClick: this.handleStartEditing })
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
const captionPosition = this.props.design.captionPosition || "bottom"
|
|
@@ -325,7 +325,7 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
325
325
|
return R(
|
|
326
326
|
"div",
|
|
327
327
|
{ className: "mb-3" },
|
|
328
|
-
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ",
|
|
328
|
+
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T`Data Source`),
|
|
329
329
|
": ",
|
|
330
330
|
R(TableSelectComponent, { schema: this.props.schema, value: this.state.table, onChange: this.handleTableChange }),
|
|
331
331
|
R("br"),
|
|
@@ -334,7 +334,7 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
334
334
|
? R(
|
|
335
335
|
"div",
|
|
336
336
|
{ className: "mb-3" },
|
|
337
|
-
R("label", { className: "text-muted" },
|
|
337
|
+
R("label", { className: "text-muted" }, T`Field`),
|
|
338
338
|
": ",
|
|
339
339
|
R(ExprComponent, {
|
|
340
340
|
schema: this.props.schema,
|
|
@@ -354,26 +354,26 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
354
354
|
return R(
|
|
355
355
|
"div",
|
|
356
356
|
{ style: { paddingTop: 10 } },
|
|
357
|
-
|
|
357
|
+
T`Rotation: `,
|
|
358
358
|
R(
|
|
359
359
|
ui.Radio,
|
|
360
360
|
{ value: this.state.rotation || null, radioValue: null, onChange: this.handleRotationChange, inline: true },
|
|
361
|
-
|
|
361
|
+
T`0 degrees`
|
|
362
362
|
),
|
|
363
363
|
R(
|
|
364
364
|
ui.Radio,
|
|
365
365
|
{ value: this.state.rotation || null, radioValue: 90, onChange: this.handleRotationChange, inline: true },
|
|
366
|
-
|
|
366
|
+
T`90 degrees`
|
|
367
367
|
),
|
|
368
368
|
R(
|
|
369
369
|
ui.Radio,
|
|
370
370
|
{ value: this.state.rotation || null, radioValue: 180, onChange: this.handleRotationChange, inline: true },
|
|
371
|
-
|
|
371
|
+
T`180 degrees`
|
|
372
372
|
),
|
|
373
373
|
R(
|
|
374
374
|
ui.Radio,
|
|
375
375
|
{ value: this.state.rotation || null, radioValue: 270, onChange: this.handleRotationChange, inline: true },
|
|
376
|
-
|
|
376
|
+
T`270 degrees`
|
|
377
377
|
)
|
|
378
378
|
)
|
|
379
379
|
}
|
|
@@ -382,14 +382,14 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
382
382
|
return R(
|
|
383
383
|
"div",
|
|
384
384
|
{ className: "mb-3" },
|
|
385
|
-
R("label", null,
|
|
385
|
+
R("label", null, T`URL of image`),
|
|
386
386
|
R("input", {
|
|
387
387
|
type: "text",
|
|
388
388
|
className: "form-control",
|
|
389
389
|
value: this.state.imageUrl || "",
|
|
390
390
|
onChange: this.handleImageUrlChange
|
|
391
391
|
}),
|
|
392
|
-
R("div", { className: "form-text text-muted" },
|
|
392
|
+
R("div", { className: "form-text text-muted" }, T`e.g. http://somesite.com/image.jpg`),
|
|
393
393
|
this.renderRotation()
|
|
394
394
|
)
|
|
395
395
|
}
|
|
@@ -398,20 +398,20 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
398
398
|
return R(
|
|
399
399
|
"div",
|
|
400
400
|
{ className: "mb-3" },
|
|
401
|
-
R("label", null,
|
|
401
|
+
R("label", null, T`URL to open`),
|
|
402
402
|
R("input", {
|
|
403
403
|
type: "text",
|
|
404
404
|
className: "form-control",
|
|
405
405
|
value: this.state.url || "",
|
|
406
406
|
onChange: this.handleUrlChange
|
|
407
407
|
}),
|
|
408
|
-
R("div", { className: "form-text text-muted" },
|
|
409
|
-
R("div", { className: "form-text text-muted" },
|
|
408
|
+
R("div", { className: "form-text text-muted" }, T`e.g. http://somesite.com/`),
|
|
409
|
+
R("div", { className: "form-text text-muted" }, T`When clicked on image, this link will open`),
|
|
410
410
|
R("div", null,
|
|
411
411
|
R(ui.Checkbox, {
|
|
412
412
|
value: !this.state.openUrlInSameTab,
|
|
413
413
|
onChange: this.handleOpenUrlInSameTabChange
|
|
414
|
-
},
|
|
414
|
+
}, T`Open link in new tab`)
|
|
415
415
|
)
|
|
416
416
|
)
|
|
417
417
|
}
|
|
@@ -427,13 +427,13 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
427
427
|
R(
|
|
428
428
|
"div",
|
|
429
429
|
{ className: "mb-3" },
|
|
430
|
-
R("label", null,
|
|
430
|
+
R("label", null, T`Caption`),
|
|
431
431
|
R("input", {
|
|
432
432
|
type: "text",
|
|
433
433
|
className: "form-control",
|
|
434
434
|
value: this.state.caption || "",
|
|
435
435
|
onChange: this.handleCaptionChange,
|
|
436
|
-
placeholder:
|
|
436
|
+
placeholder: T`Optional caption to display below image`
|
|
437
437
|
})
|
|
438
438
|
),
|
|
439
439
|
|
|
@@ -441,11 +441,11 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
441
441
|
? R(
|
|
442
442
|
"div",
|
|
443
443
|
{ className: "mb-3" },
|
|
444
|
-
R("label", null,
|
|
444
|
+
R("label", null, T`Caption position`),
|
|
445
445
|
R(ui.Select, {
|
|
446
446
|
options: [
|
|
447
|
-
{ value: "bottom", label:
|
|
448
|
-
{ value: "top", label:
|
|
447
|
+
{ value: "bottom", label: T`Bottom` },
|
|
448
|
+
{ value: "top", label: T`Top` }
|
|
449
449
|
],
|
|
450
450
|
value: this.state.captionPosition,
|
|
451
451
|
onChange: this.handleCaptionPositionChange
|
|
@@ -455,9 +455,9 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
455
455
|
|
|
456
456
|
R(TabbedComponent, {
|
|
457
457
|
tabs: [
|
|
458
|
-
{ id: "upload", label:
|
|
459
|
-
{ id: "expression", label:
|
|
460
|
-
{ id: "url", label:
|
|
458
|
+
{ id: "upload", label: T`Upload`, elem: this.renderUploadEditor() },
|
|
459
|
+
{ id: "expression", label: T`From Data`, elem: this.renderExpressionEditor() },
|
|
460
|
+
{ id: "url", label: T`From URL`, elem: this.renderImageUrlEditor() }
|
|
461
461
|
],
|
|
462
462
|
initialTabId: this.state.currentTab
|
|
463
463
|
}),
|
|
@@ -468,18 +468,18 @@ class ImageWidgetDesignComponent extends React.Component<
|
|
|
468
468
|
const footer = R(
|
|
469
469
|
"div",
|
|
470
470
|
null,
|
|
471
|
-
R("button", { key: "save", type: "button", className: "btn btn-primary me-2", onClick: this.handleSave },
|
|
471
|
+
R("button", { key: "save", type: "button", className: "btn btn-primary me-2", onClick: this.handleSave }, T`Save`),
|
|
472
472
|
R(
|
|
473
473
|
"button",
|
|
474
474
|
{ key: "cancel", type: "button", className: "btn btn-secondary", onClick: this.handleCancel },
|
|
475
|
-
|
|
475
|
+
T`Cancel`
|
|
476
476
|
)
|
|
477
477
|
)
|
|
478
478
|
|
|
479
479
|
return R(
|
|
480
480
|
ModalPopupComponent,
|
|
481
481
|
{
|
|
482
|
-
header:
|
|
482
|
+
header: T`Image`,
|
|
483
483
|
footer
|
|
484
484
|
},
|
|
485
485
|
content
|
|
@@ -97,12 +97,12 @@ export default class ImagelistCarouselComponent extends React.Component<
|
|
|
97
97
|
R(
|
|
98
98
|
"button",
|
|
99
99
|
{ className: "carousel-control-prev", onClick: this.handleLeft },
|
|
100
|
-
R("span", { className: "carousel-control-prev-icon" })
|
|
100
|
+
R("span", { className: "carousel-control-prev-icon", "aria-label": T`Previous` })
|
|
101
101
|
),
|
|
102
102
|
R(
|
|
103
103
|
"button",
|
|
104
104
|
{ className: "carousel-control-next", onClick: this.handleRight },
|
|
105
|
-
R("span", { className: "carousel-control-next-icon" })
|
|
105
|
+
R("span", { className: "carousel-control-next-icon", "aria-label": T`Next` })
|
|
106
106
|
)
|
|
107
107
|
)
|
|
108
108
|
}
|
package/src/widgets/MapWidget.ts
CHANGED
|
@@ -197,7 +197,7 @@ class MapWidgetComponent extends React.Component<MapWidgetComponentProps, MapWid
|
|
|
197
197
|
render() {
|
|
198
198
|
const dropdownItems = []
|
|
199
199
|
if (this.props.onDesignChange != null) {
|
|
200
|
-
dropdownItems.push({ label:
|
|
200
|
+
dropdownItems.push({ label: T`Edit`, icon: "pencil", onClick: this.handleStartEditing })
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
const handleDesignChange = (d: any) => this.setState({ transientDesign: d })
|
|
@@ -138,7 +138,7 @@ class MarkdownWidgetComponent extends React.Component<MarkdownWidgetComponentPro
|
|
|
138
138
|
render() {
|
|
139
139
|
const dropdownItems = []
|
|
140
140
|
if (this.props.onDesignChange != null) {
|
|
141
|
-
dropdownItems.push({ label:
|
|
141
|
+
dropdownItems.push({ label: T`Edit`, icon: "pencil", onClick: this.handleStartEditing })
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// Wrap in a simple widget
|
package/src/widgets/TOCWidget.ts
CHANGED
|
@@ -92,7 +92,7 @@ class TOCWidgetComponent extends React.Component {
|
|
|
92
92
|
ModalPopupComponent,
|
|
93
93
|
{
|
|
94
94
|
showCloseX: true,
|
|
95
|
-
header:
|
|
95
|
+
header: T`Table of Contents Options`,
|
|
96
96
|
onClose: this.handleEndEditing
|
|
97
97
|
},
|
|
98
98
|
editor
|
|
@@ -113,7 +113,7 @@ class TOCWidgetComponent extends React.Component {
|
|
|
113
113
|
render() {
|
|
114
114
|
const dropdownItems = []
|
|
115
115
|
if (this.props.onDesignChange != null) {
|
|
116
|
-
dropdownItems.push({ label:
|
|
116
|
+
dropdownItems.push({ label: T`Edit`, icon: "pencil", onClick: this.handleStartEditing })
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// Wrap in a simple widget
|
|
@@ -155,7 +155,6 @@ class TOCWidgetViewComponent extends React.Component {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
handleEntryClick = (tocEntry: any) => {
|
|
158
|
-
debugger
|
|
159
158
|
return this.props.onScrollToTOCEntry?.(tocEntry.widgetId, tocEntry.id)
|
|
160
159
|
}
|
|
161
160
|
|
|
@@ -233,7 +232,7 @@ class TOCWidgetViewComponent extends React.Component {
|
|
|
233
232
|
? R(
|
|
234
233
|
"div",
|
|
235
234
|
{ className: "text-muted" },
|
|
236
|
-
|
|
235
|
+
T`Table of Contents will appear here as text blocks with headings are added to the dashboard`
|
|
237
236
|
)
|
|
238
237
|
: undefined
|
|
239
238
|
)
|
|
@@ -268,17 +267,17 @@ class TOCWidgetDesignerComponent extends React.Component {
|
|
|
268
267
|
null,
|
|
269
268
|
R(
|
|
270
269
|
ui.FormGroup,
|
|
271
|
-
{ label:
|
|
272
|
-
R(ui.TextInput, { value: this.props.design.header || "", onChange: this.update("header"), placeholder:
|
|
270
|
+
{ label: T`Header` },
|
|
271
|
+
R(ui.TextInput, { value: this.props.design.header || "", onChange: this.update("header"), placeholder: T`None` })
|
|
273
272
|
),
|
|
274
273
|
R(
|
|
275
274
|
ui.FormGroup,
|
|
276
|
-
{ label:
|
|
275
|
+
{ label: T`Border` },
|
|
277
276
|
R(BorderComponent, { value: this.props.design.borderWeight || 0, onChange: this.update("borderWeight") })
|
|
278
277
|
),
|
|
279
278
|
R(
|
|
280
279
|
ui.FormGroup,
|
|
281
|
-
{ label:
|
|
280
|
+
{ label: T`Numbering` },
|
|
282
281
|
R(
|
|
283
282
|
ui.Radio,
|
|
284
283
|
{
|
|
@@ -287,7 +286,7 @@ class TOCWidgetDesignerComponent extends React.Component {
|
|
|
287
286
|
radioValue: true,
|
|
288
287
|
onChange: this.update("numbering")
|
|
289
288
|
},
|
|
290
|
-
|
|
289
|
+
T`On`
|
|
291
290
|
),
|
|
292
291
|
R(
|
|
293
292
|
ui.Radio,
|
|
@@ -297,7 +296,7 @@ class TOCWidgetDesignerComponent extends React.Component {
|
|
|
297
296
|
radioValue: false,
|
|
298
297
|
onChange: this.update("numbering")
|
|
299
298
|
},
|
|
300
|
-
|
|
299
|
+
T`Off`
|
|
301
300
|
)
|
|
302
301
|
)
|
|
303
302
|
)
|
|
@@ -318,10 +317,10 @@ class BorderComponent extends React.Component {
|
|
|
318
317
|
return R(
|
|
319
318
|
"div",
|
|
320
319
|
null,
|
|
321
|
-
R(ui.Radio, { inline: true, value, radioValue: 0, onChange: this.props.onChange },
|
|
322
|
-
R(ui.Radio, { inline: true, value, radioValue: 1, onChange: this.props.onChange },
|
|
323
|
-
R(ui.Radio, { inline: true, value, radioValue: 2, onChange: this.props.onChange },
|
|
324
|
-
R(ui.Radio, { inline: true, value, radioValue: 3, onChange: this.props.onChange },
|
|
320
|
+
R(ui.Radio, { inline: true, value, radioValue: 0, onChange: this.props.onChange }, T`None`),
|
|
321
|
+
R(ui.Radio, { inline: true, value, radioValue: 1, onChange: this.props.onChange }, T`Light`),
|
|
322
|
+
R(ui.Radio, { inline: true, value, radioValue: 2, onChange: this.props.onChange }, T`Medium`),
|
|
323
|
+
R(ui.Radio, { inline: true, value, radioValue: 3, onChange: this.props.onChange }, T`Heavy`)
|
|
325
324
|
)
|
|
326
325
|
}
|
|
327
326
|
}
|
|
@@ -47,7 +47,7 @@ export default class WidgetScopesViewComponent extends React.Component<WidgetSco
|
|
|
47
47
|
"div",
|
|
48
48
|
{ className: "alert alert-info" },
|
|
49
49
|
R("span", { className: "fas fa-filter" }),
|
|
50
|
-
|
|
50
|
+
T` Filters: `,
|
|
51
51
|
_.map(_.keys(scopes), (id) => this.renderScope(id, scopes[id]))
|
|
52
52
|
)
|
|
53
53
|
}
|
|
@@ -146,8 +146,8 @@ export default class ChartViewComponent extends React.Component<ChartViewCompone
|
|
|
146
146
|
return R("div", { style: { marginTop: 20, textAlign: "center" } },
|
|
147
147
|
R("div", { className: "text-danger" },
|
|
148
148
|
isTimeout ?
|
|
149
|
-
|
|
150
|
-
:
|
|
149
|
+
T`This widget has timed out. Placing widgets across console tabs instead of having them all in one dashboard can improve performance.`
|
|
150
|
+
: T`There was an error loading data for this widget.`
|
|
151
151
|
),
|
|
152
152
|
R("div", { className: "mt-3" },
|
|
153
153
|
R("button", {
|
|
@@ -158,14 +158,14 @@ export default class ChartViewComponent extends React.Component<ChartViewCompone
|
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
160
|
R("i", { className: "fas fa-redo" }),
|
|
161
|
-
|
|
161
|
+
T`Try again`
|
|
162
162
|
),
|
|
163
163
|
),
|
|
164
164
|
R("button", {
|
|
165
165
|
className: "btn btn-link btn-sm mt-2",
|
|
166
166
|
onClick: () => this.setState({ showErrorDetails: !this.state.showErrorDetails })
|
|
167
167
|
},
|
|
168
|
-
this.state.showErrorDetails ?
|
|
168
|
+
this.state.showErrorDetails ? T`Hide details` : T`Show details`
|
|
169
169
|
),
|
|
170
170
|
this.state.showErrorDetails ?
|
|
171
171
|
R("div", { style: { marginTop: 10, fontSize: 10 } },
|
|
@@ -9,7 +9,7 @@ import { DataSource, Schema } from "@mwater/expressions"
|
|
|
9
9
|
import { WidgetDataSource } from "../WidgetDataSource"
|
|
10
10
|
import Chart from "./Chart"
|
|
11
11
|
import { JsonQLFilter } from "../../JsonQLFilter"
|
|
12
|
-
import { LocaleContext } from "@mwater/expressions-ui
|
|
12
|
+
import { LocaleContext } from "@mwater/expressions-ui"
|
|
13
13
|
import { BlocksLayoutOptionsContext, createDashboardStyles, DashboardStyleWrapper, getDefaultLayoutOptions } from "../../dashboards/layoutOptions"
|
|
14
14
|
|
|
15
15
|
export interface ChartWidgetComponentProps {
|
|
@@ -68,7 +68,7 @@ export class ChartWidgetComponent extends React.PureComponent<ChartWidgetCompone
|
|
|
68
68
|
// Get the data
|
|
69
69
|
return this.props.widgetDataSource.getData(this.props.design, this.props.filters, (err: any, data: any) => {
|
|
70
70
|
if (err) {
|
|
71
|
-
return alert(
|
|
71
|
+
return alert(T`Failed to get data: ${err.message}`)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// Create data table
|
|
@@ -251,7 +251,7 @@ export class ChartWidgetComponent extends React.PureComponent<ChartWidgetCompone
|
|
|
251
251
|
this.props.filters
|
|
252
252
|
)
|
|
253
253
|
if (!designError) {
|
|
254
|
-
dropdownItems.push({ label:
|
|
254
|
+
dropdownItems.push({ label: T`Export Data`, icon: "save-file", onClick: this.handleSaveCsvFile })
|
|
255
255
|
}
|
|
256
256
|
if (this.props.onDesignChange != null) {
|
|
257
257
|
dropdownItems.unshift({
|
|
@@ -69,17 +69,17 @@ export default class CalendarChart extends Chart {
|
|
|
69
69
|
|
|
70
70
|
// Check that has table
|
|
71
71
|
if (!design.table) {
|
|
72
|
-
return
|
|
72
|
+
return T`Missing data source`
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// Check that has axes
|
|
76
76
|
let error = null
|
|
77
77
|
|
|
78
78
|
if (!design.dateAxis) {
|
|
79
|
-
error = error ||
|
|
79
|
+
error = error || T`Missing date`
|
|
80
80
|
}
|
|
81
81
|
if (!design.valueAxis) {
|
|
82
|
-
error = error ||
|
|
82
|
+
error = error || T`Missing value`
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
error = error || axisBuilder.validateAxis({ axis: design.dateAxis })
|
|
@@ -210,7 +210,7 @@ export default class CalendarChart extends Chart {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
createDataTable(design: any, schema: Schema, dataSource: DataSource, data: any) {
|
|
213
|
-
const header = [
|
|
213
|
+
const header = [T`Date`, T`Value`]
|
|
214
214
|
const rows = _.map(data, (row: any) => [moment(row.date).format("YYYY-MM-DD"), row.value])
|
|
215
215
|
return [header].concat(rows)
|
|
216
216
|
}
|
|
@@ -59,7 +59,7 @@ export default class CalendarChartDesignerComponent extends React.Component<Cale
|
|
|
59
59
|
return R(
|
|
60
60
|
"div",
|
|
61
61
|
{ className: "mb-3" },
|
|
62
|
-
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ",
|
|
62
|
+
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T`Data Source`),
|
|
63
63
|
": ",
|
|
64
64
|
R(TableSelectComponent, {
|
|
65
65
|
schema: this.props.schema,
|
|
@@ -75,13 +75,13 @@ export default class CalendarChartDesignerComponent extends React.Component<Cale
|
|
|
75
75
|
return R(
|
|
76
76
|
"div",
|
|
77
77
|
{ className: "mb-3" },
|
|
78
|
-
R("label", { className: "text-muted" },
|
|
78
|
+
R("label", { className: "text-muted" }, T`Title`),
|
|
79
79
|
R("input", {
|
|
80
80
|
type: "text",
|
|
81
81
|
className: "form-control form-control-sm",
|
|
82
82
|
value: this.props.design.titleText,
|
|
83
83
|
onChange: this.handleTitleTextChange,
|
|
84
|
-
placeholder:
|
|
84
|
+
placeholder: T`Untitled`
|
|
85
85
|
})
|
|
86
86
|
)
|
|
87
87
|
}
|
|
@@ -95,7 +95,7 @@ export default class CalendarChartDesignerComponent extends React.Component<Cale
|
|
|
95
95
|
return R(
|
|
96
96
|
"div",
|
|
97
97
|
{ className: "mb-3" },
|
|
98
|
-
R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ",
|
|
98
|
+
R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ", T`Filters`),
|
|
99
99
|
R(
|
|
100
100
|
"div",
|
|
101
101
|
{ style: { marginLeft: 8 } },
|
|
@@ -117,7 +117,7 @@ export default class CalendarChartDesignerComponent extends React.Component<Cale
|
|
|
117
117
|
|
|
118
118
|
return R(
|
|
119
119
|
ui.SectionComponent,
|
|
120
|
-
{ label:
|
|
120
|
+
{ label: T`Date Axis` },
|
|
121
121
|
R(AxisComponent, {
|
|
122
122
|
schema: this.props.schema,
|
|
123
123
|
dataSource: this.props.dataSource,
|
|
@@ -139,7 +139,7 @@ export default class CalendarChartDesignerComponent extends React.Component<Cale
|
|
|
139
139
|
|
|
140
140
|
return R(
|
|
141
141
|
ui.SectionComponent,
|
|
142
|
-
{ label:
|
|
142
|
+
{ label: T`Value Axis` },
|
|
143
143
|
R(AxisComponent, {
|
|
144
144
|
schema: this.props.schema,
|
|
145
145
|
dataSource: this.props.dataSource,
|
|
@@ -158,7 +158,7 @@ export default class CalendarChartDesignerComponent extends React.Component<Cale
|
|
|
158
158
|
return R(
|
|
159
159
|
"div",
|
|
160
160
|
{ className: "mb-3" },
|
|
161
|
-
R("label", { className: "text-muted" }, R("span", { className: "fas fa-tint" }),
|
|
161
|
+
R("label", { className: "text-muted" }, R("span", { className: "fas fa-tint" }), T`Cell Color`),
|
|
162
162
|
|
|
163
163
|
R(
|
|
164
164
|
"div",
|
|
@@ -6,7 +6,7 @@ import moment from "moment"
|
|
|
6
6
|
import AxisBuilder from "../../../axes/AxisBuilder"
|
|
7
7
|
import { Schema } from "@mwater/expressions"
|
|
8
8
|
import * as d3 from "d3"
|
|
9
|
-
import { LocaleContext } from "@mwater/expressions-ui
|
|
9
|
+
import { LocaleContext } from "@mwater/expressions-ui"
|
|
10
10
|
|
|
11
11
|
// Require d3-tip to use it
|
|
12
12
|
import { default as d3Tip } from "d3-tip"
|
|
@@ -113,7 +113,7 @@ export default class CalendarChartViewComponent extends React.Component<Calendar
|
|
|
113
113
|
const scopeData: WidgetScope = {
|
|
114
114
|
name:
|
|
115
115
|
this.axisBuilder.summarizeAxis(this.props.design.dateAxis!, this.context) +
|
|
116
|
-
|
|
116
|
+
T` is ` +
|
|
117
117
|
this.axisBuilder.formatValue(this.props.design.dateAxis!, data, this.context),
|
|
118
118
|
filter: {
|
|
119
119
|
jsonql: this.axisBuilder.createValueFilter(this.props.design.dateAxis!, data),
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
import _ from "lodash"
|
|
2
2
|
import React from "react"
|
|
3
|
-
const R = React.createElement
|
|
4
3
|
import { default as produce } from "immer"
|
|
5
|
-
import { DataSource, injectTableAlias, Schema } from "@mwater/expressions"
|
|
4
|
+
import { DataSource, Expr, injectTableAlias, Schema } from "@mwater/expressions"
|
|
6
5
|
import Chart, { ChartCreateViewElementOptions } from "../Chart"
|
|
7
6
|
import { ExprCleaner } from "@mwater/expressions"
|
|
8
7
|
import { ExprCompiler } from "@mwater/expressions"
|
|
9
8
|
import AxisBuilder from "../../../axes/AxisBuilder"
|
|
10
9
|
import { JsonQLSelectQuery } from "@mwater/jsonql"
|
|
11
10
|
import { JsonQLFilter } from "../../.."
|
|
11
|
+
import { Axis } from "../../../axes/Axis"
|
|
12
|
+
|
|
13
|
+
export interface ImageMosaicChartDesign {
|
|
14
|
+
/** Version of design */
|
|
15
|
+
version?: number
|
|
16
|
+
|
|
17
|
+
/** Table to use */
|
|
18
|
+
table: string
|
|
19
|
+
|
|
20
|
+
/** Title text */
|
|
21
|
+
titleText: string
|
|
22
|
+
|
|
23
|
+
/** Image axis */
|
|
24
|
+
imageAxis: Axis
|
|
25
|
+
|
|
26
|
+
/** Optional filter */
|
|
27
|
+
filter: Expr
|
|
28
|
+
}
|
|
12
29
|
|
|
13
30
|
/*
|
|
14
31
|
Design is:
|
|
@@ -20,7 +37,7 @@ Design is:
|
|
|
20
37
|
|
|
21
38
|
*/
|
|
22
39
|
export default class ImageMosaicChart extends Chart {
|
|
23
|
-
cleanDesign(design:
|
|
40
|
+
cleanDesign(design: ImageMosaicChartDesign, schema: Schema) {
|
|
24
41
|
const exprCleaner = new ExprCleaner(schema)
|
|
25
42
|
const axisBuilder = new AxisBuilder({ schema })
|
|
26
43
|
|
|
@@ -42,19 +59,19 @@ export default class ImageMosaicChart extends Chart {
|
|
|
42
59
|
return design
|
|
43
60
|
}
|
|
44
61
|
|
|
45
|
-
validateDesign(design:
|
|
62
|
+
validateDesign(design: ImageMosaicChartDesign, schema: Schema) {
|
|
46
63
|
const axisBuilder = new AxisBuilder({ schema })
|
|
47
64
|
|
|
48
65
|
// Check that has table
|
|
49
66
|
if (!design.table) {
|
|
50
|
-
return
|
|
67
|
+
return T`Missing data source`
|
|
51
68
|
}
|
|
52
69
|
|
|
53
70
|
// Check that has axes
|
|
54
71
|
let error = null
|
|
55
72
|
|
|
56
73
|
if (!design.imageAxis) {
|
|
57
|
-
error = error ||
|
|
74
|
+
error = error || T`Missing image`
|
|
58
75
|
}
|
|
59
76
|
|
|
60
77
|
error = error || axisBuilder.validateAxis({ axis: design.imageAxis })
|
|
@@ -62,7 +79,7 @@ export default class ImageMosaicChart extends Chart {
|
|
|
62
79
|
return error
|
|
63
80
|
}
|
|
64
81
|
|
|
65
|
-
isEmpty(design:
|
|
82
|
+
isEmpty(design: ImageMosaicChartDesign) {
|
|
66
83
|
return !design.imageAxis
|
|
67
84
|
}
|
|
68
85
|
|
|
@@ -182,7 +199,7 @@ export default class ImageMosaicChart extends Chart {
|
|
|
182
199
|
}
|
|
183
200
|
|
|
184
201
|
createDataTable(design: any, schema: Schema, dataSource: DataSource, data: any) {
|
|
185
|
-
alert(
|
|
202
|
+
alert(T`Not available for Image Mosaics`)
|
|
186
203
|
return []
|
|
187
204
|
}
|
|
188
205
|
// TODO
|
|
@@ -42,7 +42,7 @@ export default class ImageMosaicChartDesignerComponent extends React.Component<I
|
|
|
42
42
|
return R(
|
|
43
43
|
"div",
|
|
44
44
|
{ className: "mb-3" },
|
|
45
|
-
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ",
|
|
45
|
+
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T`Data Source`),
|
|
46
46
|
": ",
|
|
47
47
|
R(TableSelectComponent, {
|
|
48
48
|
schema: this.props.schema,
|
|
@@ -58,13 +58,13 @@ export default class ImageMosaicChartDesignerComponent extends React.Component<I
|
|
|
58
58
|
return R(
|
|
59
59
|
"div",
|
|
60
60
|
{ className: "mb-3" },
|
|
61
|
-
R("label", { className: "text-muted" },
|
|
61
|
+
R("label", { className: "text-muted" }, T`Title`),
|
|
62
62
|
R("input", {
|
|
63
63
|
type: "text",
|
|
64
64
|
className: "form-control form-control-sm",
|
|
65
65
|
value: this.props.design.titleText,
|
|
66
66
|
onChange: this.handleTitleTextChange,
|
|
67
|
-
placeholder:
|
|
67
|
+
placeholder: T`Untitled`
|
|
68
68
|
})
|
|
69
69
|
)
|
|
70
70
|
}
|
|
@@ -78,7 +78,7 @@ export default class ImageMosaicChartDesignerComponent extends React.Component<I
|
|
|
78
78
|
return R(
|
|
79
79
|
"div",
|
|
80
80
|
{ className: "mb-3" },
|
|
81
|
-
R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ",
|
|
81
|
+
R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), " ", T`Filters`),
|
|
82
82
|
R(
|
|
83
83
|
"div",
|
|
84
84
|
{ style: { marginLeft: 8 } },
|
|
@@ -100,7 +100,7 @@ export default class ImageMosaicChartDesignerComponent extends React.Component<I
|
|
|
100
100
|
|
|
101
101
|
return R(
|
|
102
102
|
ui.SectionComponent,
|
|
103
|
-
{ label:
|
|
103
|
+
{ label: T`Image Axis` },
|
|
104
104
|
R(AxisComponent, {
|
|
105
105
|
schema: this.props.schema,
|
|
106
106
|
dataSource: this.props.dataSource,
|