@mwater/visualization 5.0.1 → 5.2.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/GlobalFilter.d.ts +13 -0
- package/lib/GlobalFilter.js +2 -0
- package/lib/MWaterAddRelatedFormComponent.d.ts +1 -1
- package/lib/MWaterAddRelatedFormComponent.js +10 -17
- package/lib/MWaterCompleteTableSelectComponent.d.ts +2 -9
- package/lib/MWaterContextComponent.d.ts +31 -9
- package/lib/MWaterContextComponent.js +85 -76
- package/lib/MWaterCustomTablesetListComponent.js +9 -3
- package/lib/MWaterGlobalFiltersComponent.d.ts +6 -5
- package/lib/MWaterGlobalFiltersComponent.js +4 -4
- package/lib/MWaterLoaderComponent.d.ts +14 -4
- package/lib/MWaterLoaderComponent.js +10 -2
- package/lib/MWaterTableSelectComponent.d.ts +0 -1
- package/lib/MWaterTableSelectComponent.js +20 -41
- package/lib/axes/Axis.d.ts +20 -25
- package/lib/axes/AxisBuilder.js +9 -7
- package/lib/axes/AxisComponent.d.ts +4 -4
- package/lib/axes/RangesComponent.d.ts +12 -6
- package/lib/axes/RangesComponent.js +21 -10
- package/lib/dashboards/DashboardComponent.d.ts +1 -14
- package/lib/dashboards/DashboardComponent.js +18 -56
- package/lib/dashboards/DashboardDesign.d.ts +2 -17
- package/lib/dashboards/DashboardViewComponent.js +3 -4
- package/lib/dashboards/LayoutOptionsComponent.js +4 -3
- package/lib/dashboards/ServerDashboardDataSource.d.ts +1 -0
- package/lib/dashboards/ServerDashboardDataSource.js +3 -0
- package/lib/dashboards/SettingsModalComponent.d.ts +4 -15
- package/lib/dashboards/SettingsModalComponent.js +24 -38
- package/lib/datagrids/DatagridComponent.d.ts +10 -13
- package/lib/datagrids/DatagridComponent.js +27 -5
- package/lib/datagrids/DatagridDataSource.d.ts +3 -2
- package/lib/datagrids/DatagridDataSource.js +0 -11
- package/lib/datagrids/DatagridDesign.d.ts +2 -0
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -93
- package/lib/datagrids/DatagridDesignerComponent.js +11 -8
- package/lib/datagrids/DatagridViewComponent.js +2 -2
- package/lib/datagrids/DirectDatagridDataSource.d.ts +1 -0
- package/lib/datagrids/DirectDatagridDataSource.js +26 -0
- package/lib/datagrids/FindReplaceModalComponent.d.ts +4 -20
- package/lib/datagrids/FindReplaceModalComponent.js +27 -13
- package/lib/datagrids/ServerDatagridDataSource.d.ts +2 -1
- package/lib/datagrids/ServerDatagridDataSource.js +16 -3
- package/lib/demo.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -4
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +2 -1
- package/lib/layouts/blocks/BlocksDisplayComponent.js +2 -2
- package/lib/layouts/grid/GridLayoutManager.d.ts +2 -1
- package/lib/layouts/grid/LegoLayoutEngine.d.ts +1 -1
- package/lib/maps/BufferLayer.js +3 -1
- package/lib/maps/BufferLayerDesignerComponent.js +2 -2
- package/lib/maps/ChoroplethLayerDesigner.js +2 -2
- package/lib/maps/ClusterLayer.js +3 -1
- package/lib/maps/ClusterLayerDesignerComponent.js +2 -2
- package/lib/maps/DirectMapDataSource.js +1 -2
- package/lib/maps/GridLayer.js +5 -3
- package/lib/maps/GridLayerDesigner.js +2 -3
- package/lib/maps/LayerSwitcherComponent.js +1 -1
- package/lib/maps/MapComponent.d.ts +2 -7
- package/lib/maps/MapDesign.d.ts +2 -13
- package/lib/maps/MapDesignerComponent.d.ts +1 -12
- package/lib/maps/MapDesignerComponent.js +5 -12
- package/lib/maps/MapFiltersDesignerComponent.d.ts +0 -4
- package/lib/maps/MapFiltersDesignerComponent.js +4 -5
- package/lib/maps/MarkersLayerDesignerComponent.js +2 -2
- package/lib/maps/PopupFilterJoinsUtils.d.ts +6 -1
- package/lib/maps/PopupFilterJoinsUtils.js +4 -3
- package/lib/maps/RasterMapViewComponent.d.ts +2 -9
- package/lib/maps/RegionSelectComponent.d.ts +2 -1
- package/lib/maps/ServerMapDataSource.d.ts +1 -1
- package/lib/maps/UtfGridLayer.js +1 -1
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +10 -2
- package/lib/quickfilter/QuickfilterCompiler.d.ts +1 -1
- package/lib/widgets/IFrameWidgetComponent.d.ts +2 -9
- package/lib/widgets/ImageWidgetComponent.d.ts +6 -24
- package/lib/widgets/ImageWidgetComponent.js +2 -2
- package/lib/widgets/MapWidget.d.ts +2 -7
- package/lib/widgets/MarkdownWidget.d.ts +2 -7
- package/lib/widgets/TOCWidget.d.ts +2 -9
- package/lib/widgets/charts/ChartWidget.d.ts +3 -15
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +1 -1
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +1 -1
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.d.ts +2 -7
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +2 -31
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +2 -7
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +2 -2
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +73 -66
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +10 -6
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +3 -22
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +55 -58
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/table/TableChartViewComponent.js +21 -7
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -13
- package/lib/widgets/text/ExprItemEditorComponent.js +2 -2
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -13
- package/lib/widgets/text/TextWidgetDesign.d.ts +3 -1
- package/package.json +1 -1
- package/src/GlobalFilter.ts +17 -0
- package/src/MWaterAddRelatedFormComponent.ts +15 -20
- package/src/MWaterContextComponent.tsx +158 -0
- package/src/MWaterCustomTablesetListComponent.tsx +21 -3
- package/src/MWaterGlobalFiltersComponent.ts +8 -8
- package/src/MWaterLoaderComponent.ts +10 -3
- package/src/{MWaterTableSelectComponent.ts → MWaterTableSelectComponent.tsx} +61 -66
- package/src/axes/Axis.ts +24 -25
- package/src/axes/AxisBuilder.ts +10 -9
- package/src/axes/RangesComponent.ts +27 -16
- package/src/dashboards/{DashboardComponent.ts → DashboardComponent.tsx} +39 -80
- package/src/dashboards/DashboardDesign.ts +2 -22
- package/src/dashboards/DashboardViewComponent.ts +4 -5
- package/src/dashboards/LayoutOptionsComponent.tsx +6 -4
- package/src/dashboards/ServerDashboardDataSource.ts +16 -12
- package/src/dashboards/SettingsModalComponent.tsx +170 -0
- package/src/datagrids/DatagridComponent.ts +45 -14
- package/src/datagrids/DatagridDataSource.ts +10 -8
- package/src/datagrids/DatagridDesign.ts +3 -0
- package/src/datagrids/DatagridDesignerComponent.tsx +31 -19
- package/src/datagrids/DatagridViewComponent.ts +4 -4
- package/src/datagrids/DirectDatagridDataSource.ts +35 -0
- package/src/datagrids/ExprCellComponent.ts +0 -1
- package/src/datagrids/FindReplaceModalComponent.ts +39 -22
- package/src/datagrids/ServerDatagridDataSource.ts +23 -6
- package/src/demo.ts +1 -1
- package/src/index.ts +1 -2
- package/src/layouts/blocks/BlocksDisplayComponent.ts +2 -2
- package/src/layouts/grid/LegoLayoutEngine.ts +2 -2
- package/src/layouts/grid/WidgetContainerComponent.ts +2 -2
- package/src/maps/BingLayer.ts +2 -2
- package/src/maps/BufferLayer.ts +3 -1
- package/src/maps/BufferLayerDesignerComponent.ts +1 -1
- package/src/maps/ChoroplethLayerDesigner.tsx +1 -1
- package/src/maps/ClusterLayer.ts +3 -1
- package/src/maps/ClusterLayerDesignerComponent.ts +1 -1
- package/src/maps/DirectMapDataSource.ts +1 -2
- package/src/maps/GridLayer.ts +5 -3
- package/src/maps/GridLayerDesigner.tsx +1 -2
- package/src/maps/LayerSwitcherComponent.tsx +1 -1
- package/src/maps/LegendGroup.ts +1 -1
- package/src/maps/MWaterServerLayer.ts +2 -2
- package/src/maps/MapDesign.ts +2 -17
- package/src/maps/{MapDesignerComponent.ts → MapDesignerComponent.tsx} +8 -16
- package/src/maps/{MapFiltersDesignerComponent.ts → MapFiltersDesignerComponent.tsx} +25 -25
- package/src/maps/MarkersLayerDesignerComponent.ts +1 -1
- package/src/maps/PopupFilterJoinsUtils.ts +4 -4
- package/src/maps/ServerMapDataSource.ts +7 -7
- package/src/maps/SwitchableTileUrlLayerDesigner.tsx +1 -13
- package/src/maps/UtfGridLayer.ts +4 -4
- package/src/maps/VectorMapViewComponent.tsx +0 -1
- package/src/maps/mapboxUtils.ts +2 -2
- package/src/maps/vectorMaps.tsx +10 -1
- package/src/quickfilter/QuickfilterCompiler.ts +1 -1
- package/src/richtext/ExprItemsHtmlConverter.ts +1 -1
- package/src/richtext/FontColorPaletteItem.ts +1 -1
- package/src/richtext/FontSizePaletteItem.ts +1 -1
- package/src/richtext/ItemsHtmlConverter.ts +2 -2
- package/src/widgets/ImageWidgetComponent.ts +1 -1
- package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +1 -1
- package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +1 -1
- package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +1 -1
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +1 -1
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +1 -1
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +1 -1
- package/src/widgets/charts/table/TableChartViewComponent.ts +21 -7
- package/src/widgets/text/ExprItemEditorComponent.tsx +1 -1
- package/src/widgets/text/TextWidgetDesign.ts +4 -1
- package/src/MWaterContextComponent.ts +0 -141
- package/src/TableSelectComponent.ts +0 -60
- package/src/dashboards/SettingsModalComponent.ts +0 -169
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import PropTypes from "prop-types"
|
|
2
|
-
import _ from "lodash"
|
|
3
|
-
import React from "react"
|
|
4
|
-
const R = React.createElement
|
|
5
|
-
import update from "update-object"
|
|
6
|
-
import { languages } from "../languages"
|
|
7
|
-
import * as ui from "@mwater/react-library/lib/bootstrap"
|
|
8
|
-
import { default as ReactSelect } from "react-select"
|
|
9
|
-
import * as DashboardUtils from "./DashboardUtils"
|
|
10
|
-
import ActionCancelModalComponent from "@mwater/react-library/lib/ActionCancelModalComponent"
|
|
11
|
-
import QuickfiltersDesignComponent from "../quickfilter/QuickfiltersDesignComponent"
|
|
12
|
-
import FiltersDesignerComponent from "../FiltersDesignerComponent"
|
|
13
|
-
import { DataSource, Schema } from "@mwater/expressions"
|
|
14
|
-
|
|
15
|
-
export interface SettingsModalComponentProps {
|
|
16
|
-
onDesignChange: any
|
|
17
|
-
schema: Schema
|
|
18
|
-
dataSource: DataSource
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface SettingsModalComponentState {
|
|
22
|
-
design: any
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Popup with settings for dashboard
|
|
26
|
-
export default class SettingsModalComponent extends React.Component<
|
|
27
|
-
SettingsModalComponentProps,
|
|
28
|
-
SettingsModalComponentState
|
|
29
|
-
> {
|
|
30
|
-
static contextTypes = { globalFiltersElementFactory: PropTypes.func }
|
|
31
|
-
|
|
32
|
-
constructor(props: any) {
|
|
33
|
-
super(props)
|
|
34
|
-
this.state = {
|
|
35
|
-
design: null // Set when being edited
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
show(design: any) {
|
|
40
|
-
return this.setState({ design })
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
handleSave = () => {
|
|
44
|
-
this.props.onDesignChange(this.state.design)
|
|
45
|
-
return this.setState({ design: null })
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
handleCancel = () => {
|
|
49
|
-
return this.setState({ design: null })
|
|
50
|
-
}
|
|
51
|
-
handleDesignChange = (design: any) => {
|
|
52
|
-
return this.setState({ design })
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
handleFiltersChange = (filters: any) => {
|
|
56
|
-
const design = _.extend({}, this.state.design, { filters })
|
|
57
|
-
return this.handleDesignChange(design)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
handleGlobalFiltersChange = (globalFilters: any) => {
|
|
61
|
-
const design = _.extend({}, this.state.design, { globalFilters })
|
|
62
|
-
return this.handleDesignChange(design)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
render() {
|
|
66
|
-
// Don't show if not editing
|
|
67
|
-
if (!this.state.design) {
|
|
68
|
-
return null
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Get filterable tables
|
|
72
|
-
const filterableTables = DashboardUtils.getFilterableTables(this.state.design, this.props.schema)
|
|
73
|
-
|
|
74
|
-
const localeOptions = _.map(languages, (language) => {
|
|
75
|
-
return {
|
|
76
|
-
value: language.code,
|
|
77
|
-
label: language.en + " (" + language.name + ")"
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
return R(
|
|
82
|
-
ActionCancelModalComponent,
|
|
83
|
-
{
|
|
84
|
-
size: "large",
|
|
85
|
-
onCancel: this.handleCancel,
|
|
86
|
-
onAction: this.handleSave
|
|
87
|
-
},
|
|
88
|
-
R(
|
|
89
|
-
"div",
|
|
90
|
-
{ style: { paddingBottom: 200 } },
|
|
91
|
-
R("h4", null, "Quick Filters"),
|
|
92
|
-
R(
|
|
93
|
-
"div",
|
|
94
|
-
{ className: "text-muted" },
|
|
95
|
-
"Quick filters are shown to the user as a dropdown at the top of the dashboard and can be used to filter data of widgets."
|
|
96
|
-
),
|
|
97
|
-
|
|
98
|
-
filterableTables.length > 0
|
|
99
|
-
? R(QuickfiltersDesignComponent, {
|
|
100
|
-
design: this.state.design.quickfilters || [],
|
|
101
|
-
onDesignChange: (design: any) =>
|
|
102
|
-
this.handleDesignChange(update(this.state.design, { quickfilters: { $set: design } })),
|
|
103
|
-
schema: this.props.schema,
|
|
104
|
-
dataSource: this.props.dataSource,
|
|
105
|
-
tables: filterableTables
|
|
106
|
-
})
|
|
107
|
-
: "Nothing to quickfilter. Add widgets to the dashboard",
|
|
108
|
-
|
|
109
|
-
R("h4", { style: { paddingTop: 10 } }, "Filters"),
|
|
110
|
-
R(
|
|
111
|
-
"div",
|
|
112
|
-
{ className: "text-muted" },
|
|
113
|
-
"Filters are built in to the dashboard and cannot be changed by viewers of the dashboard."
|
|
114
|
-
),
|
|
115
|
-
|
|
116
|
-
filterableTables.length > 0
|
|
117
|
-
? R(FiltersDesignerComponent, {
|
|
118
|
-
schema: this.props.schema,
|
|
119
|
-
dataSource: this.props.dataSource,
|
|
120
|
-
filters: this.state.design.filters,
|
|
121
|
-
onFiltersChange: this.handleFiltersChange,
|
|
122
|
-
filterableTables
|
|
123
|
-
})
|
|
124
|
-
: "Nothing to filter. Add widgets to the dashboard",
|
|
125
|
-
|
|
126
|
-
this.context.globalFiltersElementFactory
|
|
127
|
-
? R(
|
|
128
|
-
"div",
|
|
129
|
-
null,
|
|
130
|
-
R("h4", { style: { paddingTop: 10 } }, "Global Filters"),
|
|
131
|
-
|
|
132
|
-
this.context.globalFiltersElementFactory({
|
|
133
|
-
schema: this.props.schema,
|
|
134
|
-
dataSource: this.props.dataSource,
|
|
135
|
-
filterableTables,
|
|
136
|
-
globalFilters: this.state.design.globalFilters || [],
|
|
137
|
-
onChange: this.handleGlobalFiltersChange
|
|
138
|
-
})
|
|
139
|
-
)
|
|
140
|
-
: undefined,
|
|
141
|
-
|
|
142
|
-
R("h4", { style: { paddingTop: 10 } }, "Language"),
|
|
143
|
-
R(
|
|
144
|
-
"div",
|
|
145
|
-
{ className: "text-muted" },
|
|
146
|
-
"Controls the preferred language of widgets and uses specified language when available"
|
|
147
|
-
),
|
|
148
|
-
|
|
149
|
-
R(ReactSelect, {
|
|
150
|
-
value: _.findWhere(localeOptions, { value: this.state.design.locale || "en" }) || null,
|
|
151
|
-
options: localeOptions,
|
|
152
|
-
onChange: (locale: any) =>
|
|
153
|
-
this.handleDesignChange(update(this.state.design, { locale: { $set: locale.value } }))
|
|
154
|
-
}),
|
|
155
|
-
|
|
156
|
-
R("h4", { style: { paddingTop: 10 } }, "Advanced"),
|
|
157
|
-
R(
|
|
158
|
-
ui.Checkbox,
|
|
159
|
-
{
|
|
160
|
-
value: this.state.design.implicitFiltersEnabled != null ? this.state.design.implicitFiltersEnabled : true,
|
|
161
|
-
onChange: (value) =>
|
|
162
|
-
this.handleDesignChange(update(this.state.design, { implicitFiltersEnabled: { $set: value } }))
|
|
163
|
-
},
|
|
164
|
-
"Enable Implicit Filtering (leave unchecked for new dashboards)"
|
|
165
|
-
)
|
|
166
|
-
)
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
}
|