@mwater/visualization 5.4.5 → 5.6.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/MWaterContextComponent.d.ts +1 -1
- package/lib/MWaterContextComponent.js +1 -1
- package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
- package/lib/MWaterGlobalFiltersComponent.js +11 -20
- package/lib/MWaterLoaderComponent.d.ts +5 -14
- package/lib/MWaterLoaderComponent.js +2 -11
- package/lib/UndoStack.d.ts +2 -1
- package/lib/UndoStack.js +12 -6
- package/lib/dashboards/DashboardComponent.js +7 -5
- package/lib/dashboards/DashboardDesign.d.ts +1 -1
- package/lib/dashboards/LayoutOptionsComponent.js +18 -11
- package/lib/dashboards/ServerDashboardDataSource.d.ts +10 -1
- package/lib/dashboards/ServerDashboardDataSource.js +29 -10
- package/lib/dashboards/SettingsModalComponent.js +1 -1
- package/lib/dashboards/layoutOptions.d.ts +5 -1
- package/lib/datagrids/DatagridComponent.js +23 -3
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
- package/lib/datagrids/DatagridDesignerComponent.js +108 -120
- package/lib/datagrids/DatagridViewComponent.js +3 -2
- package/lib/datagrids/ExprCellComponent.d.ts +1 -0
- package/lib/datagrids/ExprCellComponent.js +22 -20
- package/lib/datagrids/OrderBysDesignerComponent.d.ts +7 -7
- package/lib/datagrids/OrderBysDesignerComponent.js +19 -28
- package/lib/index.css +45 -2
- package/lib/index.d.ts +5 -5
- package/lib/index.js +2 -3
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +8 -1
- package/lib/layouts/blocks/BlocksDisplayComponent.js +46 -4
- package/lib/maps/BufferLayer.d.ts +18 -0
- package/lib/maps/BufferLayer.js +36 -14
- package/lib/maps/BufferLayerDesign.d.ts +1 -1
- package/lib/maps/BufferLayerDesignerComponent.js +2 -2
- package/lib/maps/ChoroplethLayer.d.ts +18 -0
- package/lib/maps/ChoroplethLayer.js +46 -25
- package/lib/maps/ChoroplethLayerDesign.d.ts +7 -3
- package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -22
- package/lib/maps/ChoroplethLayerDesigner.js +58 -89
- package/lib/maps/DirectMapDataSource.js +17 -10
- package/lib/maps/EditHoverOver.d.ts +4 -3
- package/lib/maps/EditHoverOver.js +64 -35
- package/lib/maps/HoverContent.d.ts +10 -5
- package/lib/maps/HoverContent.js +7 -36
- package/lib/maps/Layer.d.ts +37 -0
- package/lib/maps/Layer.js +30 -4
- package/lib/maps/LeafletMapComponent.js +10 -19
- package/lib/maps/MWaterServerLayer.d.ts +2 -2
- package/lib/maps/MWaterServerLayer.js +6 -6
- package/lib/maps/MapComponent.js +0 -1
- package/lib/maps/MapLayerDataSource.d.ts +9 -0
- package/lib/maps/MapUtils.d.ts +19 -1
- package/lib/maps/MapUtils.js +80 -1
- package/lib/maps/MarkersLayer.d.ts +18 -0
- package/lib/maps/MarkersLayer.js +42 -26
- package/lib/maps/MarkersLayerDesign.d.ts +1 -1
- package/lib/maps/MarkersLayerDesignerComponent.d.ts +12 -28
- package/lib/maps/MarkersLayerDesignerComponent.js +81 -111
- package/lib/maps/RasterMapViewComponent.js +1 -1
- package/lib/maps/ServerMapDataSource.d.ts +9 -0
- package/lib/maps/ServerMapDataSource.js +29 -10
- package/lib/maps/VectorMapViewComponent.js +7 -15
- package/lib/maps/maps.d.ts +4 -2
- package/lib/maps/symbols/font-awesome/asterisk.png +0 -0
- package/lib/maps/symbols/font-awesome/ban.png +0 -0
- package/lib/maps/symbols/font-awesome/beer.png +0 -0
- package/lib/maps/symbols/font-awesome/bell.png +0 -0
- package/lib/maps/symbols/font-awesome/bolt.png +0 -0
- package/lib/maps/symbols/font-awesome/building.png +0 -0
- package/lib/maps/symbols/font-awesome/bullseye.png +0 -0
- package/lib/maps/symbols/font-awesome/bus.png +0 -0
- package/lib/maps/symbols/font-awesome/caret-up.png +0 -0
- package/lib/maps/symbols/font-awesome/certificate.png +0 -0
- package/lib/maps/symbols/font-awesome/check-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/check.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/lib/maps/symbols/font-awesome/cloud.png +0 -0
- package/lib/maps/symbols/font-awesome/comment.png +0 -0
- package/lib/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/lib/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/lib/maps/symbols/font-awesome/female.png +0 -0
- package/lib/maps/symbols/font-awesome/file.png +0 -0
- package/lib/maps/symbols/font-awesome/flag.png +0 -0
- package/lib/maps/symbols/font-awesome/flask.png +0 -0
- package/lib/maps/symbols/font-awesome/h-square.png +0 -0
- package/lib/maps/symbols/font-awesome/home.png +0 -0
- package/lib/maps/symbols/font-awesome/info-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/male.png +0 -0
- package/lib/maps/symbols/font-awesome/medkit.png +0 -0
- package/lib/maps/symbols/font-awesome/mobile.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-square.png +0 -0
- package/lib/maps/symbols/font-awesome/plus.png +0 -0
- package/lib/maps/symbols/font-awesome/square.png +0 -0
- package/lib/maps/symbols/font-awesome/star.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/lib/maps/symbols/font-awesome/ticket.png +0 -0
- package/lib/maps/symbols/font-awesome/times-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/times.png +0 -0
- package/lib/maps/symbols/font-awesome/tint.png +0 -0
- package/lib/maps/symbols/font-awesome/tree.png +0 -0
- package/lib/maps/symbols/font-awesome/university.png +0 -0
- package/lib/maps/symbols/font-awesome/usd.png +0 -0
- package/lib/maps/symbols/font-awesome/user.png +0 -0
- package/lib/maps/symbols/font-awesome/users.png +0 -0
- package/lib/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/lib/maps/symbols/sdf-ize.sh +93 -0
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +20 -36
- package/lib/mwater_table_selection/FormsListComponent.d.ts +33 -0
- package/lib/mwater_table_selection/FormsListComponent.js +141 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +49 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.js +251 -0
- package/lib/mwater_table_selection/IssuesListComponent.d.ts +29 -0
- package/lib/mwater_table_selection/IssuesListComponent.js +123 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.d.ts +20 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.js +157 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.js +79 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.d.ts +18 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.d.ts +63 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +461 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.js +94 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +32 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.js +163 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.d.ts +19 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.js +111 -0
- package/lib/quickfilter/QuickfiltersComponent.d.ts +3 -102
- package/lib/quickfilter/QuickfiltersComponent.js +53 -110
- package/lib/quickfilter/TextLiteralComponent.d.ts +23 -47
- package/lib/quickfilter/TextLiteralComponent.js +85 -82
- package/lib/widgets/MapWidget.js +4 -2
- package/lib/widgets/charts/Chart.d.ts +11 -0
- package/lib/widgets/charts/Chart.js +15 -0
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +1 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +27 -1
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +5 -12
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +43 -57
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +113 -110
- package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +2 -1
- package/lib/widgets/charts/layered/LayeredChartUtils.js +0 -2
- package/lib/widgets/charts/pivot/PivotChart.d.ts +2 -0
- package/lib/widgets/charts/pivot/PivotChart.js +156 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -20
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +31 -61
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +4 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +4 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +5 -44
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +38 -63
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +7 -68
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +58 -106
- package/lib/widgets/charts/table/TableChart.d.ts +2 -0
- package/lib/widgets/charts/table/TableChart.js +172 -1
- package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +7 -17
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +79 -95
- package/lib/widgets/charts/table/TableChartViewComponent.d.ts +1 -7
- package/lib/widgets/charts/table/TableChartViewComponent.js +19 -27
- package/lib/widgets/text/ExprItemEditorComponent.d.ts +3 -8
- package/lib/widgets/text/ExprItemEditorComponent.js +36 -33
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +1 -0
- package/package.json +4 -10
- package/src/MWaterContextComponent.tsx +2 -2
- package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
- package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +18 -19
- package/src/UndoStack.ts +14 -6
- package/src/dashboards/DashboardComponent.tsx +7 -5
- package/src/dashboards/DashboardDesign.ts +1 -1
- package/src/dashboards/LayoutOptionsComponent.tsx +22 -10
- package/src/dashboards/ServerDashboardDataSource.ts +36 -13
- package/src/dashboards/SettingsModalComponent.tsx +1 -1
- package/src/dashboards/layoutOptions.tsx +5 -1
- package/src/datagrids/DatagridComponent.tsx +31 -3
- package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
- package/src/datagrids/DatagridViewComponent.tsx +3 -2
- package/src/datagrids/ExprCellComponent.tsx +23 -20
- package/src/datagrids/OrderBysDesignerComponent.tsx +61 -70
- package/src/index.css +45 -2
- package/src/index.ts +5 -11
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +60 -5
- package/src/maps/BufferLayer.ts +48 -20
- package/src/maps/BufferLayerDesign.ts +1 -1
- package/src/maps/BufferLayerDesignerComponent.tsx +2 -1
- package/src/maps/ChoroplethLayer.ts +70 -39
- package/src/maps/ChoroplethLayerDesign.ts +6 -2
- package/src/maps/ChoroplethLayerDesigner.tsx +171 -167
- package/src/maps/DirectMapDataSource.ts +21 -13
- package/src/maps/EditHoverOver.tsx +98 -54
- package/src/maps/HoverContent.tsx +17 -48
- package/src/maps/Layer.ts +42 -4
- package/src/maps/LeafletMapComponent.tsx +10 -19
- package/src/maps/MWaterServerLayer.ts +6 -6
- package/src/maps/MapComponent.ts +0 -1
- package/src/maps/MapLayerDataSource.ts +8 -0
- package/src/maps/MapUtils.ts +82 -3
- package/src/maps/MarkersLayer.ts +54 -27
- package/src/maps/MarkersLayerDesign.ts +1 -1
- package/src/maps/MarkersLayerDesignerComponent.tsx +360 -0
- package/src/maps/RasterMapViewComponent.ts +1 -1
- package/src/maps/ServerMapDataSource.ts +35 -12
- package/src/maps/VectorMapViewComponent.tsx +8 -19
- package/src/maps/maps.ts +4 -2
- package/src/maps/symbols/font-awesome/asterisk.png +0 -0
- package/src/maps/symbols/font-awesome/ban.png +0 -0
- package/src/maps/symbols/font-awesome/beer.png +0 -0
- package/src/maps/symbols/font-awesome/bell.png +0 -0
- package/src/maps/symbols/font-awesome/bolt.png +0 -0
- package/src/maps/symbols/font-awesome/building.png +0 -0
- package/src/maps/symbols/font-awesome/bullseye.png +0 -0
- package/src/maps/symbols/font-awesome/bus.png +0 -0
- package/src/maps/symbols/font-awesome/caret-up.png +0 -0
- package/src/maps/symbols/font-awesome/certificate.png +0 -0
- package/src/maps/symbols/font-awesome/check-circle.png +0 -0
- package/src/maps/symbols/font-awesome/check.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/src/maps/symbols/font-awesome/cloud.png +0 -0
- package/src/maps/symbols/font-awesome/comment.png +0 -0
- package/src/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/src/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/src/maps/symbols/font-awesome/female.png +0 -0
- package/src/maps/symbols/font-awesome/file.png +0 -0
- package/src/maps/symbols/font-awesome/flag.png +0 -0
- package/src/maps/symbols/font-awesome/flask.png +0 -0
- package/src/maps/symbols/font-awesome/h-square.png +0 -0
- package/src/maps/symbols/font-awesome/home.png +0 -0
- package/src/maps/symbols/font-awesome/info-circle.png +0 -0
- package/src/maps/symbols/font-awesome/male.png +0 -0
- package/src/maps/symbols/font-awesome/medkit.png +0 -0
- package/src/maps/symbols/font-awesome/mobile.png +0 -0
- package/src/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/src/maps/symbols/font-awesome/plus-square.png +0 -0
- package/src/maps/symbols/font-awesome/plus.png +0 -0
- package/src/maps/symbols/font-awesome/square.png +0 -0
- package/src/maps/symbols/font-awesome/star.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/src/maps/symbols/font-awesome/ticket.png +0 -0
- package/src/maps/symbols/font-awesome/times-circle.png +0 -0
- package/src/maps/symbols/font-awesome/times.png +0 -0
- package/src/maps/symbols/font-awesome/tint.png +0 -0
- package/src/maps/symbols/font-awesome/tree.png +0 -0
- package/src/maps/symbols/font-awesome/university.png +0 -0
- package/src/maps/symbols/font-awesome/usd.png +0 -0
- package/src/maps/symbols/font-awesome/user.png +0 -0
- package/src/maps/symbols/font-awesome/users.png +0 -0
- package/src/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/src/maps/symbols/sdf-ize.sh +93 -0
- package/src/maps/vectorMaps.tsx +20 -44
- package/src/mwater_table_selection/FormsListComponent.tsx +188 -0
- package/src/mwater_table_selection/IndicatorsListComponent.tsx +411 -0
- package/src/mwater_table_selection/IssuesListComponent.tsx +167 -0
- package/src/mwater_table_selection/MWaterAccountingSystemListComponent.tsx +225 -0
- package/src/{MWaterAssetSystemsListComponent.tsx → mwater_table_selection/MWaterAssetSystemsListComponent.tsx} +2 -2
- package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
- package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +713 -0
- package/src/{MWaterCustomTablesetListComponent.tsx → mwater_table_selection/MWaterCustomTablesetListComponent.tsx} +1 -1
- package/src/{MWaterMetricsTableListComponent.tsx → mwater_table_selection/MWaterMetricsTableListComponent.tsx} +1 -1
- package/src/{MWaterTableSelectComponent.tsx → mwater_table_selection/MWaterTableSelectComponent.tsx} +91 -90
- package/src/mwater_table_selection/MWaterWorkflowsSelectComponent.tsx +159 -0
- package/src/quickfilter/{QuickfiltersComponent.ts → QuickfiltersComponent.tsx} +165 -158
- package/src/quickfilter/TextLiteralComponent.tsx +197 -0
- package/src/widgets/MapWidget.tsx +9 -1
- package/src/widgets/charts/Chart.ts +17 -0
- package/src/widgets/charts/ChartWidgetComponent.tsx +36 -1
- package/src/widgets/charts/layered/LayeredChartDesign.ts +1 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +23 -24
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +260 -211
- package/src/widgets/charts/layered/LayeredChartUtils.ts +7 -7
- package/src/widgets/charts/pivot/PivotChart.ts +191 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +124 -129
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +4 -2
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +120 -149
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +178 -198
- package/src/widgets/charts/table/TableChart.ts +177 -1
- package/src/widgets/charts/table/TableChartDesignerComponent.tsx +422 -0
- package/src/widgets/charts/table/{TableChartViewComponent.ts → TableChartViewComponent.tsx} +65 -60
- package/src/widgets/text/ExprItemEditorComponent.tsx +83 -77
- package/src/widgets/text/ExprUpdateModalComponent.tsx +1 -0
- package/test/UndoStackTests.ts +52 -1
- package/.storybook/config.js +0 -7
- package/.storybook/head.html +0 -4
- package/.storybook/webpack.config.js +0 -15
- package/src/MWaterCompleteTableSelectComponent.tsx +0 -975
- package/src/maps/BingLayer.ts +0 -146
- package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
- package/src/quickfilter/TextLiteralComponent.ts +0 -165
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +0 -441
- package/stories/UpdateableComponent.js +0 -29
- package/stories/consoles.js +0 -202
- package/stories/dashboards.js +0 -217
- package/stories/datagridDesign.js +0 -114
- package/stories/datagrids.js +0 -69
- package/stories/dates.js +0 -80
- package/stories/exprcomponent.js +0 -43
- package/stories/index.js +0 -18
- package/stories/leaflet.js +0 -59
- package/stories/maps.js +0 -24
- package/stories/pivotChart.js +0 -235
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import _ from "lodash"
|
|
2
|
-
import PropTypes from "prop-types"
|
|
3
1
|
import React from "react"
|
|
4
|
-
const R = React.createElement
|
|
5
2
|
import AxisComponent from "../../../axes/AxisComponent"
|
|
6
3
|
import AxisBuilder from "../../../axes/AxisBuilder"
|
|
7
4
|
import { FilterExprComponent } from "@mwater/expressions-ui"
|
|
8
|
-
import { DataSource,
|
|
5
|
+
import { DataSource, Schema, LiteralType, Expr } from "@mwater/expressions"
|
|
9
6
|
import { ExprCompiler } from "@mwater/expressions"
|
|
10
7
|
import ColorComponent from "../../../ColorComponent"
|
|
11
8
|
import * as LayeredChartUtils from "./LayeredChartUtils"
|
|
@@ -15,61 +12,65 @@ import { TableSelectComponent } from "@mwater/expressions-ui"
|
|
|
15
12
|
import * as ui from "@mwater/react-library/lib/bootstrap"
|
|
16
13
|
import { Checkbox } from "@mwater/react-library/lib/bootstrap"
|
|
17
14
|
import PopoverHelpComponent from "@mwater/react-library/lib/PopoverHelpComponent"
|
|
15
|
+
import { LayeredChartDesignLayer, LayeredChartDesign } from "./LayeredChartDesign"
|
|
16
|
+
import { Axis } from "../../../axes/Axis"
|
|
17
|
+
import { JsonQLFilter } from "@mwater/visualization"
|
|
18
18
|
|
|
19
19
|
export interface LayeredChartLayerDesignerComponentProps {
|
|
20
|
-
design:
|
|
20
|
+
design: LayeredChartDesign
|
|
21
21
|
schema: Schema
|
|
22
22
|
dataSource: DataSource
|
|
23
23
|
index: number
|
|
24
|
-
onChange:
|
|
25
|
-
onRemove:
|
|
26
|
-
filters?:
|
|
24
|
+
onChange: (layer: LayeredChartDesignLayer) => void
|
|
25
|
+
onRemove: () => void
|
|
26
|
+
filters?: JsonQLFilter[]
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export default class LayeredChartLayerDesignerComponent extends React.Component<LayeredChartLayerDesignerComponentProps> {
|
|
30
|
-
isLayerPolar(layer:
|
|
30
|
+
isLayerPolar(layer: LayeredChartDesignLayer) {
|
|
31
31
|
return ["pie", "donut"].includes(layer.type || this.props.design.type)
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
doesLayerNeedGrouping(layer:
|
|
34
|
+
doesLayerNeedGrouping(layer: LayeredChartDesignLayer) {
|
|
35
35
|
return !["scatter"].includes(layer.type || this.props.design.type)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// Determine if x-axis required
|
|
39
|
-
isXAxisRequired(layer:
|
|
39
|
+
isXAxisRequired(layer: LayeredChartDesignLayer) {
|
|
40
40
|
return !this.isLayerPolar(layer)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
getAxisTypes(layer:
|
|
44
|
-
|
|
43
|
+
getAxisTypes(layer: LayeredChartDesignLayer, axisKey: any): LiteralType[] | undefined {
|
|
44
|
+
const types = LayeredChartUtils.getAxisTypes(this.props.design, layer, axisKey)
|
|
45
|
+
return types ?? undefined
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
getAxisLabel(icon: any, label: any) {
|
|
48
|
-
return
|
|
49
|
+
return <span><i className={`fas fa-${icon}`}/> {label}</span>
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
// Determine icon/label for color axis
|
|
52
|
-
getXAxisLabel(layer:
|
|
53
|
+
getXAxisLabel(layer: LayeredChartDesignLayer) {
|
|
53
54
|
if (this.props.design.transpose) {
|
|
54
|
-
return this.getAxisLabel("
|
|
55
|
+
return this.getAxisLabel("arrows-v", T`Vertical Axis`)
|
|
55
56
|
} else {
|
|
56
|
-
return this.getAxisLabel("
|
|
57
|
+
return this.getAxisLabel("arrows-h", T`Horizontal Axis`)
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
// Determine icon/label for color axis
|
|
61
|
-
getYAxisLabel(layer:
|
|
62
|
+
getYAxisLabel(layer: LayeredChartDesignLayer) {
|
|
62
63
|
if (this.isLayerPolar(layer)) {
|
|
63
64
|
return this.getAxisLabel("repeat", T`Angle Axis`)
|
|
64
65
|
} else if (this.props.design.transpose) {
|
|
65
|
-
return this.getAxisLabel("
|
|
66
|
+
return this.getAxisLabel("arrows-h", T`Horizontal Axis`)
|
|
66
67
|
} else {
|
|
67
|
-
return this.getAxisLabel("
|
|
68
|
+
return this.getAxisLabel("arrows-v", T`Vertical Axis`)
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
// Determine icon/label for color axis
|
|
72
|
-
getColorAxisLabel(layer:
|
|
73
|
+
getColorAxisLabel(layer: LayeredChartDesignLayer) {
|
|
73
74
|
if (this.isLayerPolar(layer)) {
|
|
74
75
|
return this.getAxisLabel("text-color", T`Label Axis`)
|
|
75
76
|
} else {
|
|
@@ -78,25 +79,30 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
// Updates layer with the specified changes
|
|
81
|
-
updateLayer(changes:
|
|
82
|
-
const layer =
|
|
82
|
+
updateLayer(changes: Partial<LayeredChartDesignLayer>) {
|
|
83
|
+
const layer = { ...this.props.design.layers[this.props.index], ...changes }
|
|
83
84
|
return this.props.onChange(layer)
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
// Update axes with specified changes
|
|
87
|
-
updateAxes(changes:
|
|
88
|
-
const axes =
|
|
88
|
+
updateAxes(changes: Partial<LayeredChartDesignLayer["axes"]>) {
|
|
89
|
+
const axes = { ...this.props.design.layers[this.props.index].axes, ...changes }
|
|
89
90
|
return this.updateLayer({ axes })
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
handleNameChange = (ev: any) => {
|
|
93
94
|
return this.updateLayer({ name: ev.target.value })
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
+
|
|
97
|
+
handleLayerTypeChange = (type: LayeredChartDesignLayer["type"]) => {
|
|
98
|
+
this.updateLayer({ type: type === this.props.design.type ? undefined : type })
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
handleTableChange = (table: string) => {
|
|
96
102
|
return this.updateLayer({ table })
|
|
97
103
|
}
|
|
98
104
|
|
|
99
|
-
handleXAxisChange = (axis:
|
|
105
|
+
handleXAxisChange = (axis: Axis) => {
|
|
100
106
|
const layer = this.props.design.layers[this.props.index]
|
|
101
107
|
const axesChanges: any = { x: axis }
|
|
102
108
|
|
|
@@ -108,12 +114,11 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
108
114
|
return this.updateAxes(axesChanges)
|
|
109
115
|
}
|
|
110
116
|
|
|
111
|
-
handleXColorMapChange = (xColorMap:
|
|
112
|
-
const layer = this.props.design.layers[this.props.index]
|
|
117
|
+
handleXColorMapChange = (xColorMap: boolean) => {
|
|
113
118
|
return this.updateLayer({ xColorMap })
|
|
114
119
|
}
|
|
115
120
|
|
|
116
|
-
handleColorAxisChange = (axis:
|
|
121
|
+
handleColorAxisChange = (axis: Axis) => {
|
|
117
122
|
const layer = this.props.design.layers[this.props.index]
|
|
118
123
|
const axesChanges: any = { color: axis }
|
|
119
124
|
|
|
@@ -125,64 +130,117 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
125
130
|
return this.updateAxes(axesChanges)
|
|
126
131
|
}
|
|
127
132
|
|
|
128
|
-
handleYAxisChange = (axis:
|
|
133
|
+
handleYAxisChange = (axis: Axis) => {
|
|
129
134
|
return this.updateAxes({ y: axis })
|
|
130
135
|
}
|
|
131
|
-
handleFilterChange = (filter:
|
|
136
|
+
handleFilterChange = (filter: Expr) => {
|
|
132
137
|
return this.updateLayer({ filter })
|
|
133
138
|
}
|
|
134
|
-
handleColorChange = (color:
|
|
139
|
+
handleColorChange = (color: string) => {
|
|
135
140
|
return this.updateLayer({ color })
|
|
136
141
|
}
|
|
137
|
-
handleCumulativeChange = (value:
|
|
142
|
+
handleCumulativeChange = (value: boolean) => {
|
|
138
143
|
return this.updateLayer({ cumulative: value })
|
|
139
144
|
}
|
|
140
|
-
handleTrendlineChange = (value:
|
|
145
|
+
handleTrendlineChange = (value: boolean) => {
|
|
141
146
|
return this.updateLayer({ trendline: value ? "linear" : undefined })
|
|
142
147
|
}
|
|
143
|
-
handleStackedChange = (value:
|
|
148
|
+
handleStackedChange = (value: boolean) => {
|
|
144
149
|
return this.updateLayer({ stacked: value })
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
renderName() {
|
|
148
153
|
const layer = this.props.design.layers[this.props.index]
|
|
149
|
-
|
|
150
|
-
// R 'div', className: "form-group",
|
|
151
|
-
// R 'label', className: "text-muted", "Series Name"
|
|
152
154
|
const placeholder = this.props.design.layers.length === 1 ? T`Value` : T`Series ${this.props.index + 1}`
|
|
153
|
-
return
|
|
154
|
-
type
|
|
155
|
-
className
|
|
156
|
-
value
|
|
157
|
-
onChange
|
|
158
|
-
placeholder
|
|
159
|
-
|
|
155
|
+
return <input
|
|
156
|
+
type="text"
|
|
157
|
+
className="form-control form-control-sm"
|
|
158
|
+
value={layer.name}
|
|
159
|
+
onChange={this.handleNameChange}
|
|
160
|
+
placeholder={placeholder}
|
|
161
|
+
/>
|
|
160
162
|
}
|
|
161
163
|
|
|
162
164
|
renderRemove() {
|
|
163
165
|
if (this.props.design.layers.length > 1) {
|
|
164
|
-
return
|
|
165
|
-
"button"
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
return (
|
|
167
|
+
<button className="btn btn-sm btn-link float-end" type="button" onClick={this.props.onRemove}>
|
|
168
|
+
<span className="fas fa-times"/>
|
|
169
|
+
</button>
|
|
168
170
|
)
|
|
169
171
|
}
|
|
170
|
-
return
|
|
172
|
+
return undefined
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
renderTable() {
|
|
174
176
|
const layer = this.props.design.layers[this.props.index]
|
|
175
177
|
|
|
176
|
-
return
|
|
177
|
-
uiComponents.SectionComponent
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
178
|
+
return (
|
|
179
|
+
<uiComponents.SectionComponent icon="fa-database" label={T`Data Source`}>
|
|
180
|
+
<TableSelectComponent
|
|
181
|
+
schema={this.props.schema}
|
|
182
|
+
value={layer.table}
|
|
183
|
+
onChange={this.handleTableChange}
|
|
184
|
+
filter={layer.filter}
|
|
185
|
+
onFilterChange={this.handleFilterChange}
|
|
186
|
+
/>
|
|
187
|
+
</uiComponents.SectionComponent>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
renderLayerTypeSelector() {
|
|
192
|
+
const layer = this.props.design.layers[this.props.index]
|
|
193
|
+
const { design, index } = this.props
|
|
194
|
+
|
|
195
|
+
if (index === 0) {
|
|
196
|
+
return null
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const mainType = design.type
|
|
200
|
+
const isMainPolar = ["pie", "donut"].includes(mainType)
|
|
201
|
+
|
|
202
|
+
const compatibleTypes: { value: LayeredChartDesignLayer["type"]; label: string; name?: string }[] = isMainPolar
|
|
203
|
+
? [
|
|
204
|
+
{ value: "pie", label: T`Pie` },
|
|
205
|
+
{ value: "donut", label: T`Donut` }
|
|
206
|
+
]
|
|
207
|
+
: [
|
|
208
|
+
{ value: "bar", label: T`Bar` },
|
|
209
|
+
{ value: "line", label: T`Line` },
|
|
210
|
+
{ value: "spline", label: T`Smoothed Line` },
|
|
211
|
+
{ value: "area", label: T`Area` }
|
|
212
|
+
]
|
|
213
|
+
|
|
214
|
+
// Add the main type as the first option if it's not already there (e.g. if main is scatter)
|
|
215
|
+
if (!compatibleTypes.some((t) => t.value === mainType)) {
|
|
216
|
+
compatibleTypes.unshift({ value: mainType as any, label: T(mainType) })
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Assign names for OptionListComponent
|
|
220
|
+
compatibleTypes.forEach((t) => (t.name = t.label))
|
|
221
|
+
|
|
222
|
+
const currentType = layer.type || mainType
|
|
223
|
+
const currentTypeLabel = compatibleTypes.find((t) => t.value === currentType)?.label || T(currentType)
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<div className="mb-3">
|
|
227
|
+
<label className="text-muted">{T`Layer Chart Type`}</label>
|
|
228
|
+
<uiComponents.ToggleEditComponent
|
|
229
|
+
label={currentTypeLabel}
|
|
230
|
+
editor={(onClose: any) => (
|
|
231
|
+
<uiComponents.OptionListComponent
|
|
232
|
+
hint={T`Select a Chart Type`}
|
|
233
|
+
items={compatibleTypes.map((ct) => ({
|
|
234
|
+
name: ct.name || "",
|
|
235
|
+
onClick: () => {
|
|
236
|
+
onClose() // Close editor first
|
|
237
|
+
return this.handleLayerTypeChange(ct.value)
|
|
238
|
+
}
|
|
239
|
+
}))}
|
|
240
|
+
/>
|
|
241
|
+
)}
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
186
244
|
)
|
|
187
245
|
}
|
|
188
246
|
|
|
@@ -193,122 +251,119 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
193
251
|
renderXAxis() {
|
|
194
252
|
const layer = this.props.design.layers[this.props.index]
|
|
195
253
|
if (!layer.table) {
|
|
196
|
-
return
|
|
254
|
+
return undefined
|
|
197
255
|
}
|
|
198
256
|
|
|
199
257
|
if (!this.isXAxisRequired(layer)) {
|
|
200
|
-
return
|
|
258
|
+
return undefined
|
|
201
259
|
}
|
|
202
260
|
|
|
203
261
|
const title = this.getXAxisLabel(layer)
|
|
204
262
|
|
|
205
|
-
const filters =
|
|
263
|
+
const filters = this.props.filters ? this.props.filters.slice() : []
|
|
206
264
|
if (layer.filter != null) {
|
|
207
265
|
const exprCompiler = new ExprCompiler(this.props.schema)
|
|
208
266
|
const jsonql = exprCompiler.compileExpr({ expr: layer.filter, tableAlias: "{alias}" })
|
|
209
267
|
|
|
210
268
|
if (jsonql) {
|
|
211
|
-
filters.push({ table: layer.filter.table, jsonql })
|
|
269
|
+
filters.push({ table: (layer.filter as any).table, jsonql })
|
|
212
270
|
}
|
|
213
271
|
}
|
|
214
272
|
|
|
215
273
|
const categoricalX = new LayeredChartCompiler({ schema: this.props.schema }).isCategoricalX(this.props.design)
|
|
216
274
|
|
|
217
275
|
return [
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
276
|
+
<uiComponents.SectionComponent key="axis" label={title}>
|
|
277
|
+
<AxisComponent
|
|
278
|
+
schema={this.props.schema}
|
|
279
|
+
dataSource={this.props.dataSource}
|
|
280
|
+
table={layer.table}
|
|
281
|
+
types={this.getAxisTypes(layer, "x")}
|
|
282
|
+
aggrNeed="none"
|
|
283
|
+
required={true}
|
|
284
|
+
value={layer.axes.x}
|
|
285
|
+
onChange={this.handleXAxisChange}
|
|
286
|
+
filters={filters}
|
|
287
|
+
showColorMap={layer.xColorMap && categoricalX && !layer.axes.color}
|
|
288
|
+
autosetColors={false}
|
|
289
|
+
allowExcludedValues={categoricalX}
|
|
290
|
+
/>
|
|
291
|
+
</uiComponents.SectionComponent>,
|
|
292
|
+
categoricalX ? (
|
|
293
|
+
<ui.Checkbox
|
|
294
|
+
key="checkbox"
|
|
295
|
+
value={layer.xAxisOnlyValuesPresent}
|
|
296
|
+
onChange={this.handlexAxisOnlyValuesPresentChange}
|
|
297
|
+
>
|
|
298
|
+
{T`Only show values actually present `}
|
|
299
|
+
<PopoverHelpComponent placement="bottom">
|
|
300
|
+
{T`Limits values to those that are present in the data, as opposed to all choices or all dates within range`}
|
|
301
|
+
</PopoverHelpComponent>
|
|
302
|
+
</ui.Checkbox>
|
|
303
|
+
) : undefined,
|
|
304
|
+
<br key="br"/>
|
|
305
|
+
] as React.ReactNode[]
|
|
247
306
|
}
|
|
248
307
|
|
|
249
308
|
renderColorAxis() {
|
|
250
309
|
const layer = this.props.design.layers[this.props.index]
|
|
251
310
|
if (!layer.table) {
|
|
252
|
-
return
|
|
311
|
+
return undefined
|
|
253
312
|
}
|
|
254
313
|
|
|
255
314
|
const title = this.getColorAxisLabel(layer)
|
|
256
315
|
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
})
|
|
277
|
-
)
|
|
316
|
+
return (
|
|
317
|
+
<div className="mb-3">
|
|
318
|
+
<label className="text-muted">{title}</label>
|
|
319
|
+
<div style={{ marginLeft: 10 }}>
|
|
320
|
+
<AxisComponent
|
|
321
|
+
schema={this.props.schema}
|
|
322
|
+
dataSource={this.props.dataSource}
|
|
323
|
+
table={layer.table}
|
|
324
|
+
types={this.getAxisTypes(layer, "color")}
|
|
325
|
+
aggrNeed="none"
|
|
326
|
+
required={this.isLayerPolar(layer)}
|
|
327
|
+
showColorMap={true}
|
|
328
|
+
value={layer.axes.color}
|
|
329
|
+
onChange={this.handleColorAxisChange}
|
|
330
|
+
allowExcludedValues={true}
|
|
331
|
+
filters={this.props.filters}
|
|
332
|
+
/>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
278
335
|
)
|
|
279
336
|
}
|
|
280
337
|
|
|
281
338
|
renderYAxis() {
|
|
282
339
|
const layer = this.props.design.layers[this.props.index]
|
|
283
340
|
if (!layer.table) {
|
|
284
|
-
return
|
|
341
|
+
return undefined
|
|
285
342
|
}
|
|
286
343
|
|
|
287
344
|
const title = this.getYAxisLabel(layer)
|
|
288
345
|
|
|
289
|
-
return
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
this.renderTrendline()
|
|
311
|
-
)
|
|
346
|
+
return (
|
|
347
|
+
<div className="mb-3">
|
|
348
|
+
<label className="text-muted">{title}</label>
|
|
349
|
+
<div style={{ marginLeft: 10 }}>
|
|
350
|
+
<AxisComponent
|
|
351
|
+
schema={this.props.schema}
|
|
352
|
+
dataSource={this.props.dataSource}
|
|
353
|
+
table={layer.table}
|
|
354
|
+
types={this.getAxisTypes(layer, "y")}
|
|
355
|
+
aggrNeed={this.doesLayerNeedGrouping(layer) ? "required" : "none"}
|
|
356
|
+
value={layer.axes.y}
|
|
357
|
+
required={true}
|
|
358
|
+
filters={this.props.filters}
|
|
359
|
+
showFormat={true}
|
|
360
|
+
onChange={this.handleYAxisChange}
|
|
361
|
+
/>
|
|
362
|
+
{this.renderCumulative()}
|
|
363
|
+
{this.renderStacked()}
|
|
364
|
+
{this.renderTrendline()}
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
312
367
|
)
|
|
313
368
|
}
|
|
314
369
|
|
|
@@ -321,12 +376,12 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
321
376
|
return
|
|
322
377
|
}
|
|
323
378
|
|
|
324
|
-
return
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
</
|
|
379
|
+
return (
|
|
380
|
+
<div key="cumulative">
|
|
381
|
+
<Checkbox inline value={layer.cumulative} onChange={this.handleCumulativeChange}>
|
|
382
|
+
{T`Cumulative`}
|
|
383
|
+
</Checkbox>
|
|
384
|
+
</div>
|
|
330
385
|
)
|
|
331
386
|
}
|
|
332
387
|
|
|
@@ -339,12 +394,12 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
339
394
|
return
|
|
340
395
|
}
|
|
341
396
|
|
|
342
|
-
return
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
</
|
|
397
|
+
return (
|
|
398
|
+
<div key="trendline">
|
|
399
|
+
<Checkbox value={layer.trendline === "linear"} onChange={this.handleTrendlineChange}>
|
|
400
|
+
{T`Show linear trendline`}
|
|
401
|
+
</Checkbox>
|
|
402
|
+
</div>
|
|
348
403
|
)
|
|
349
404
|
}
|
|
350
405
|
|
|
@@ -355,16 +410,16 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
355
410
|
if (layer.axes.color && this.props.design.layers.length > 1) {
|
|
356
411
|
const stacked = layer.stacked != null ? layer.stacked : true
|
|
357
412
|
|
|
358
|
-
return
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
</
|
|
413
|
+
return (
|
|
414
|
+
<div key="stacked">
|
|
415
|
+
<Checkbox value={stacked} onChange={this.handleStackedChange}>
|
|
416
|
+
{T`Stacked`}
|
|
417
|
+
</Checkbox>
|
|
418
|
+
</div>
|
|
364
419
|
)
|
|
365
420
|
}
|
|
366
421
|
|
|
367
|
-
return
|
|
422
|
+
return undefined
|
|
368
423
|
}
|
|
369
424
|
|
|
370
425
|
renderColor() {
|
|
@@ -372,24 +427,23 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
372
427
|
|
|
373
428
|
// If not table do nothing
|
|
374
429
|
if (!layer.table) {
|
|
375
|
-
return
|
|
430
|
+
return undefined
|
|
376
431
|
}
|
|
377
432
|
|
|
378
433
|
const categoricalX = new LayeredChartCompiler({ schema: this.props.schema }).isCategoricalX(this.props.design)
|
|
379
434
|
|
|
380
|
-
return
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
)
|
|
435
|
+
return (
|
|
436
|
+
<div className="mb-3">
|
|
437
|
+
<label className="text-muted">{layer.axes.color ? T`Default Color` : T`Color`}</label>
|
|
438
|
+
<div style={{ marginLeft: 8 }}>
|
|
439
|
+
<ColorComponent color={layer.color} onChange={this.handleColorChange}/>
|
|
440
|
+
{layer.axes.x && categoricalX && !layer.axes.color ? (
|
|
441
|
+
<ui.Checkbox value={layer.xColorMap} onChange={this.handleXColorMapChange}>
|
|
442
|
+
{T`Set Individual Colors`}
|
|
443
|
+
</ui.Checkbox>
|
|
444
|
+
) : undefined}
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
393
447
|
)
|
|
394
448
|
}
|
|
395
449
|
|
|
@@ -397,51 +451,46 @@ export default class LayeredChartLayerDesignerComponent extends React.Component<
|
|
|
397
451
|
const layer = this.props.design.layers[this.props.index]
|
|
398
452
|
|
|
399
453
|
// If no table, hide
|
|
400
|
-
if (!layer.table) {
|
|
454
|
+
if (!layer.table) {
|
|
455
|
+
return undefined
|
|
401
456
|
}
|
|
402
457
|
|
|
403
|
-
return
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
458
|
+
return (
|
|
459
|
+
<div className="mb-3">
|
|
460
|
+
<label className="text-muted">
|
|
461
|
+
<span className="fas fa-filter"/> {T`Filters`}
|
|
462
|
+
</label>
|
|
463
|
+
<div style={{ marginLeft: 8 }}>
|
|
464
|
+
<FilterExprComponent
|
|
465
|
+
schema={this.props.schema}
|
|
466
|
+
dataSource={this.props.dataSource}
|
|
467
|
+
onChange={this.handleFilterChange}
|
|
468
|
+
table={layer.table}
|
|
469
|
+
value={layer.filter}
|
|
470
|
+
/>
|
|
471
|
+
</div>
|
|
472
|
+
</div>
|
|
418
473
|
)
|
|
419
474
|
}
|
|
420
475
|
|
|
421
476
|
render() {
|
|
422
477
|
const layer = this.props.design.layers[this.props.index]
|
|
423
|
-
return
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
return null
|
|
442
|
-
})(),
|
|
443
|
-
layer.axes.y ? this.renderFilter() : undefined,
|
|
444
|
-
layer.axes.y ? this.renderName() : undefined
|
|
478
|
+
return (
|
|
479
|
+
<div>
|
|
480
|
+
{this.props.index > 0 ? <hr/> : undefined}
|
|
481
|
+
{this.renderRemove()}
|
|
482
|
+
{this.renderTable()}
|
|
483
|
+
{this.renderLayerTypeSelector()}
|
|
484
|
+
{/* Color axis first for pie */}
|
|
485
|
+
{this.isLayerPolar(layer) ? this.renderColorAxis() : undefined}
|
|
486
|
+
{this.renderXAxis()}
|
|
487
|
+
{layer.axes.x || layer.axes.color ? this.renderYAxis() : undefined}
|
|
488
|
+
{layer.axes.x && layer.axes.y && !this.isLayerPolar(layer) ? this.renderColorAxis() : undefined}
|
|
489
|
+
{/* No default color for polar */}
|
|
490
|
+
{!this.isLayerPolar(layer) && layer.axes.y ? this.renderColor() : undefined}
|
|
491
|
+
{layer.axes.y ? this.renderFilter() : undefined}
|
|
492
|
+
{layer.axes.y ? this.renderName() : undefined}
|
|
493
|
+
</div>
|
|
445
494
|
)
|
|
446
495
|
}
|
|
447
496
|
}
|