@mwater/visualization 5.1.0 → 5.3.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 +10 -11
- package/lib/ColorComponent.js +78 -29
- package/lib/ColorSchemeFactory.d.ts +13 -2
- package/lib/ColorSchemeFactory.js +7 -5
- package/lib/CustomColorsContext.d.ts +6 -0
- package/lib/CustomColorsContext.js +6 -0
- package/lib/FiltersDesignerComponent.d.ts +1 -4
- package/lib/FiltersDesignerComponent.js +2 -3
- package/lib/GlobalFilter.d.ts +13 -0
- package/lib/GlobalFilter.js +2 -0
- package/lib/LocaleContextInjector.d.ts +5 -11
- package/lib/LocaleContextInjector.js +4 -12
- package/lib/MWaterAddRelatedFormComponent.js +3 -3
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +1 -4
- package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
- package/lib/MWaterCompleteTableSelectComponent.d.ts +7 -25
- package/lib/MWaterCompleteTableSelectComponent.js +36 -36
- package/lib/MWaterContextComponent.d.ts +19 -9
- package/lib/MWaterContextComponent.js +38 -22
- package/lib/MWaterCustomTablesetListComponent.js +9 -3
- package/lib/MWaterGlobalFiltersComponent.d.ts +6 -5
- package/lib/MWaterGlobalFiltersComponent.js +4 -4
- package/lib/MWaterLoaderComponent.d.ts +15 -3
- package/lib/MWaterLoaderComponent.js +11 -2
- package/lib/MWaterTableSelectComponent.d.ts +1 -4
- package/lib/MWaterTableSelectComponent.js +10 -12
- package/lib/UIComponents.d.ts +2 -2
- package/lib/UIComponents.js +4 -12
- package/lib/axes/Axis.d.ts +20 -25
- package/lib/axes/AxisBuilder.d.ts +7 -4
- package/lib/axes/AxisBuilder.js +12 -8
- package/lib/axes/AxisComponent.d.ts +6 -9
- package/lib/axes/AxisComponent.js +1 -2
- package/lib/axes/ColorPaletteCollectionComponent.d.ts +5 -12
- package/lib/axes/ColorPaletteCollectionComponent.js +67 -36
- package/lib/dashboards/DashboardComponent.d.ts +4 -17
- package/lib/dashboards/DashboardComponent.js +20 -67
- package/lib/dashboards/DashboardDesign.d.ts +5 -20
- package/lib/dashboards/DashboardUpgrader.js +36 -1
- package/lib/dashboards/DashboardViewComponent.d.ts +5 -34
- package/lib/dashboards/DashboardViewComponent.js +112 -136
- package/lib/dashboards/FontStyleEditor.d.ts +8 -0
- package/lib/dashboards/FontStyleEditor.js +130 -0
- package/lib/dashboards/LayoutOptionsComponent.d.ts +0 -1
- package/lib/dashboards/LayoutOptionsComponent.js +209 -39
- package/lib/dashboards/ServerDashboardDataSource.d.ts +1 -2
- package/lib/dashboards/ServerDashboardDataSource.js +52 -33
- package/lib/dashboards/SettingsModalComponent.d.ts +4 -15
- package/lib/dashboards/SettingsModalComponent.js +24 -38
- package/lib/dashboards/WidgetComponent.d.ts +3 -3
- package/lib/dashboards/WidgetComponent.js +3 -6
- package/lib/dashboards/WidgetDataSourcePrioritizer.d.ts +20 -0
- package/lib/dashboards/WidgetDataSourcePrioritizer.js +72 -0
- package/lib/dashboards/layoutOptions.d.ts +83 -0
- package/lib/dashboards/layoutOptions.js +436 -10
- package/lib/datagrids/DatagridComponent.d.ts +2 -9
- package/lib/datagrids/DatagridDataSource.d.ts +3 -3
- package/lib/datagrids/DatagridDataSource.js +0 -14
- package/lib/datagrids/DatagridDesign.d.ts +7 -6
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -93
- package/lib/datagrids/DatagridDesignerComponent.js +8 -6
- package/lib/datagrids/DatagridViewComponent.js +1 -1
- package/lib/datagrids/FindReplaceModalComponent.d.ts +4 -20
- package/lib/datagrids/FindReplaceModalComponent.js +27 -13
- package/lib/datagrids/ServerDatagridDataSource.d.ts +8 -7
- package/lib/datagrids/ServerDatagridDataSource.js +88 -36
- package/lib/demo.js +4 -4
- package/lib/index.css +5 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +0 -1
- package/lib/layouts/LayoutManager.d.ts +33 -29
- package/lib/layouts/LayoutManager.js +2 -8
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +26 -56
- package/lib/layouts/blocks/BlocksDisplayComponent.js +122 -205
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +6 -22
- package/lib/layouts/blocks/BlocksLayoutManager.js +5 -14
- package/lib/layouts/blocks/HorizontalBlockComponent.d.ts +5 -4
- package/lib/layouts/blocks/HorizontalBlockComponent.js +5 -5
- package/lib/layouts/grid/GridLayoutManager.d.ts +2 -1
- package/lib/mWaterLoader.d.ts +2 -0
- package/lib/mWaterLoader.js +2 -1
- package/lib/maps/AddLayerComponent.d.ts +6 -8
- package/lib/maps/AddLayerComponent.js +6 -6
- package/lib/maps/BingLayer.js +10 -20
- package/lib/maps/BufferLayer.js +5 -2
- package/lib/maps/ChoroplethLayer.js +2 -1
- package/lib/maps/ClusterLayer.js +3 -1
- package/lib/maps/DirectMapDataSource.d.ts +5 -2
- package/lib/maps/DirectMapDataSource.js +2 -1
- package/lib/maps/EditPopupComponent.js +2 -1
- package/lib/maps/GridLayer.js +5 -3
- package/lib/maps/GridLayerDesigner.js +0 -1
- package/lib/maps/LayerSwitcherComponent.js +1 -1
- package/lib/maps/MapComponent.d.ts +3 -11
- package/lib/maps/MapComponent.js +3 -3
- package/lib/maps/MapDesign.d.ts +2 -13
- package/lib/maps/MapFiltersDesignerComponent.d.ts +0 -4
- package/lib/maps/MapFiltersDesignerComponent.js +4 -5
- package/lib/maps/MarkersLayer.js +30 -25
- package/lib/maps/RasterMapViewComponent.d.ts +3 -13
- package/lib/maps/RasterMapViewComponent.js +3 -3
- package/lib/maps/RegionSelectComponent.d.ts +2 -1
- package/lib/maps/ServerMapDataSource.d.ts +3 -4
- package/lib/maps/ServerMapDataSource.js +5 -5
- package/lib/maps/VectorMapViewComponent.js +2 -1
- package/lib/maps/mapSymbols.js +2 -0
- package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +70 -56
- package/lib/quickfilter/QuickfilterCompiler.d.ts +1 -1
- package/lib/quickfilter/QuickfiltersComponent.d.ts +1 -4
- package/lib/quickfilter/QuickfiltersComponent.js +3 -3
- package/lib/richtext/DropdownPaletteItem.d.ts +32 -0
- package/lib/richtext/DropdownPaletteItem.js +82 -0
- package/lib/richtext/FontColorPaletteItem.d.ts +1 -5
- package/lib/richtext/FontColorPaletteItem.js +32 -27
- package/lib/richtext/ItemsHtmlConverter.js +12 -3
- package/lib/richtext/RichTextComponent.d.ts +26 -52
- package/lib/richtext/RichTextComponent.js +166 -128
- package/lib/valueFormatter.js +6 -1
- package/lib/wellknown.d.ts +5 -0
- package/lib/wellknown.js +288 -0
- package/lib/widgets/DropdownWidgetComponent.d.ts +8 -25
- package/lib/widgets/DropdownWidgetComponent.js +48 -25
- package/lib/widgets/IFrameWidgetComponent.d.ts +3 -11
- package/lib/widgets/ImageWidgetComponent.d.ts +8 -27
- package/lib/widgets/MapWidget.d.ts +4 -7
- package/lib/widgets/MapWidget.js +2 -1
- package/lib/widgets/MarkdownWidget.d.ts +2 -7
- package/lib/widgets/TOCWidget.d.ts +2 -9
- package/lib/widgets/TOCWidget.js +2 -1
- package/lib/widgets/Widget.d.ts +2 -0
- package/lib/widgets/WidgetDataSource.d.ts +3 -1
- package/lib/widgets/charts/Chart.d.ts +0 -1
- package/lib/widgets/charts/ChartViewComponent.d.ts +4 -0
- package/lib/widgets/charts/ChartViewComponent.js +11 -3
- package/lib/widgets/charts/ChartWidget.d.ts +1 -74
- package/lib/widgets/charts/ChartWidget.js +4 -183
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +51 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +167 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +4 -4
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.d.ts +2 -7
- package/lib/widgets/charts/layered/LayeredChart.d.ts +5 -10
- package/lib/widgets/charts/layered/LayeredChart.js +6 -7
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +4 -2
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +46 -32
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +4 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +5 -31
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +21 -3
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +1 -7
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +2 -1
- package/lib/widgets/charts/layered/LayeredChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +89 -38
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +5 -105
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +122 -166
- package/lib/widgets/charts/pivot/PivotChart.d.ts +6 -0
- package/lib/widgets/charts/pivot/PivotChart.js +47 -17
- package/lib/widgets/charts/pivot/PivotChartDesign.d.ts +11 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +11 -7
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +1 -1
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +20 -36
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +0 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +23 -2
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +215 -181
- package/lib/widgets/charts/pivot/PivotChartUtils.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +9 -47
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +20 -60
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +55 -58
- package/lib/widgets/charts/table/TableChart.js +8 -4
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +3 -3
- package/lib/widgets/charts/table/TableChartViewComponent.js +30 -16
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -13
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -13
- package/lib/widgets/text/TextComponent.d.ts +5 -12
- package/lib/widgets/text/TextComponent.js +19 -39
- package/lib/widgets/text/TextWidget.d.ts +2 -1
- package/lib/widgets/text/TextWidget.js +5 -1
- package/lib/widgets/text/TextWidgetComponent.d.ts +15 -3
- package/lib/widgets/text/TextWidgetComponent.js +76 -19
- package/lib/widgets/text/TextWidgetDesign.d.ts +16 -2
- package/lib/widgets/text/TextWidgetDesign.js +6 -0
- package/package.json +4 -4
- package/src/ColorComponent.tsx +177 -0
- package/src/ColorSchemeFactory.ts +12 -6
- package/src/CustomColorsContext.tsx +8 -0
- package/src/FiltersDesignerComponent.ts +3 -4
- package/src/GlobalFilter.ts +17 -0
- package/src/LocaleContextInjector.tsx +14 -13
- package/src/MWaterAddRelatedFormComponent.ts +3 -3
- package/src/MWaterAddRelatedIndicatorComponent.ts +6 -6
- package/src/MWaterCompleteTableSelectComponent.tsx +36 -36
- package/src/MWaterContextComponent.tsx +42 -33
- package/src/MWaterCustomTablesetListComponent.tsx +21 -3
- package/src/MWaterGlobalFiltersComponent.ts +8 -8
- package/src/MWaterLoaderComponent.ts +14 -4
- package/src/MWaterTableSelectComponent.tsx +11 -12
- package/src/{UIComponents.ts → UIComponents.tsx} +7 -15
- package/src/axes/Axis.ts +24 -25
- package/src/axes/AxisBuilder.ts +16 -13
- package/src/axes/AxisComponent.ts +3 -4
- package/src/axes/{ColorPaletteCollectionComponent.ts → ColorPaletteCollectionComponent.tsx} +87 -61
- package/src/dashboards/DashboardComponent.tsx +73 -147
- package/src/dashboards/DashboardDesign.ts +5 -25
- package/src/dashboards/DashboardUpgrader.ts +41 -1
- package/src/dashboards/DashboardViewComponent.tsx +313 -0
- package/src/dashboards/FontStyleEditor.tsx +166 -0
- package/src/dashboards/LayoutOptionsComponent.tsx +377 -71
- package/src/dashboards/ServerDashboardDataSource.ts +52 -33
- package/src/dashboards/SettingsModalComponent.tsx +170 -0
- package/src/dashboards/WidgetComponent.tsx +6 -12
- package/src/dashboards/WidgetDataSourcePrioritizer.ts +82 -0
- package/src/dashboards/layoutOptions.tsx +581 -0
- package/src/datagrids/DatagridDataSource.ts +6 -12
- package/src/datagrids/DatagridDesign.ts +8 -3
- package/src/datagrids/DatagridDesignerComponent.tsx +22 -18
- package/src/datagrids/DatagridViewComponent.ts +3 -3
- package/src/datagrids/ExprCellComponent.ts +0 -1
- package/src/datagrids/FindReplaceModalComponent.ts +39 -22
- package/src/datagrids/ServerDatagridDataSource.ts +107 -45
- package/src/demo.ts +4 -4
- package/src/index.css +5 -0
- package/src/index.ts +2 -1
- package/src/layouts/LayoutManager.ts +44 -42
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +498 -0
- package/src/layouts/blocks/BlocksLayoutManager.ts +6 -15
- package/src/layouts/blocks/HorizontalBlockComponent.ts +9 -8
- package/src/mWaterLoader.ts +4 -1
- package/src/maps/AddLayerComponent.ts +9 -9
- package/src/maps/BingLayer.ts +16 -26
- package/src/maps/BufferLayer.ts +5 -2
- package/src/maps/ChoroplethLayer.ts +2 -1
- package/src/maps/ClusterLayer.ts +3 -1
- package/src/maps/DirectMapDataSource.ts +12 -3
- package/src/maps/EditPopupComponent.ts +2 -1
- package/src/maps/GridLayer.ts +5 -3
- package/src/maps/GridLayerDesigner.tsx +0 -1
- package/src/maps/LayerSwitcherComponent.tsx +1 -1
- package/src/maps/MapComponent.ts +3 -3
- package/src/maps/MapDesign.ts +2 -17
- package/src/maps/{MapFiltersDesignerComponent.ts → MapFiltersDesignerComponent.tsx} +25 -25
- package/src/maps/MarkersLayer.ts +38 -41
- package/src/maps/RasterMapViewComponent.ts +3 -3
- package/src/maps/ServerMapDataSource.ts +8 -8
- package/src/maps/VectorMapViewComponent.tsx +2 -2
- package/src/maps/mapSymbols.ts +2 -0
- package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/src/maps/vectorMaps.tsx +88 -74
- package/src/quickfilter/QuickfilterCompiler.ts +1 -1
- package/src/quickfilter/QuickfiltersComponent.ts +3 -3
- package/src/richtext/DropdownPaletteItem.tsx +144 -0
- package/src/richtext/FontColorPaletteItem.tsx +160 -0
- package/src/richtext/ItemsHtmlConverter.ts +15 -5
- package/src/richtext/RichTextComponent.tsx +274 -232
- package/src/valueFormatter.ts +5 -1
- package/src/wellknown.ts +286 -0
- package/src/widgets/DropdownWidgetComponent.tsx +75 -0
- package/src/widgets/MapWidget.ts +5 -2
- package/src/widgets/TOCWidget.ts +2 -1
- package/src/widgets/Widget.ts +3 -0
- package/src/widgets/WidgetDataSource.ts +3 -1
- package/src/widgets/charts/Chart.ts +1 -1
- package/src/widgets/charts/ChartViewComponent.ts +16 -3
- package/src/widgets/charts/ChartWidget.ts +3 -275
- package/src/widgets/charts/ChartWidgetComponent.tsx +281 -0
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +4 -4
- package/src/widgets/charts/layered/LayeredChart.ts +4 -6
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +80 -63
- package/src/widgets/charts/layered/LayeredChartDesign.ts +7 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +43 -10
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +6 -6
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +140 -88
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +305 -221
- package/src/widgets/charts/pivot/PivotChart.ts +56 -18
- package/src/widgets/charts/pivot/PivotChartDesign.ts +12 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +4 -3
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +39 -76
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +0 -1
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +230 -189
- package/src/widgets/charts/pivot/PivotChartUtils.ts +4 -4
- package/src/widgets/charts/pivot/{PivotChartViewComponent.ts → PivotChartViewComponent.tsx} +86 -89
- package/src/widgets/charts/table/TableChart.ts +8 -4
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +4 -4
- package/src/widgets/charts/table/TableChartViewComponent.ts +32 -19
- package/src/widgets/text/TextComponent.tsx +47 -49
- package/src/widgets/text/TextWidget.ts +8 -3
- package/src/widgets/text/TextWidgetComponent.tsx +249 -0
- package/src/widgets/text/TextWidgetDesign.ts +26 -2
- package/src/ColorComponent.ts +0 -117
- package/src/dashboards/DashboardViewComponent.ts +0 -304
- package/src/dashboards/SettingsModalComponent.ts +0 -169
- package/src/dashboards/layoutOptions.ts +0 -40
- package/src/layout-styles.css +0 -263
- package/src/layouts/blocks/BlocksDisplayComponent.ts +0 -461
- package/src/layouts/grid/GridLayoutComponent.ts +0 -67
- package/src/layouts/grid/GridLayoutManager.ts +0 -185
- package/src/layouts/grid/LegoLayoutEngine.ts +0 -142
- package/src/layouts/grid/PaletteItemComponent.ts +0 -28
- package/src/layouts/grid/README.md +0 -14
- package/src/layouts/grid/WidgetContainerComponent.ts +0 -420
- package/src/richtext/FontColorPaletteItem.ts +0 -172
- package/src/richtext/FontSizePaletteItem.ts +0 -110
- package/src/widgets/DropdownWidgetComponent.ts +0 -78
- package/src/widgets/text/TextWidgetComponent.ts +0 -120
|
@@ -26,7 +26,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const prop_types_1 = __importDefault(require("prop-types"));
|
|
30
29
|
const lodash_1 = __importDefault(require("lodash"));
|
|
31
30
|
const react_1 = __importDefault(require("react"));
|
|
32
31
|
const R = react_1.default.createElement;
|
|
@@ -34,9 +33,11 @@ const LayeredChartCompiler_1 = __importDefault(require("./LayeredChartCompiler")
|
|
|
34
33
|
const TextComponent_1 = __importDefault(require("../../text/TextComponent"));
|
|
35
34
|
const d3 = __importStar(require("d3"));
|
|
36
35
|
const billboard_js_1 = __importDefault(require("billboard.js"));
|
|
36
|
+
const contexts_1 = require("@mwater/expressions-ui/lib/contexts");
|
|
37
|
+
const TextWidgetDesign_1 = require("../../text/TextWidgetDesign");
|
|
37
38
|
// Displays a layered chart
|
|
38
39
|
class LayeredChartViewComponent extends react_1.default.Component {
|
|
39
|
-
static
|
|
40
|
+
static contextType = contexts_1.LocaleContext;
|
|
40
41
|
header;
|
|
41
42
|
footer;
|
|
42
43
|
constructor(props) {
|
|
@@ -54,18 +55,24 @@ class LayeredChartViewComponent extends react_1.default.Component {
|
|
|
54
55
|
if (this.props.design != prevProps.design ||
|
|
55
56
|
this.props.height != prevProps.height ||
|
|
56
57
|
this.props.width != prevProps.width) {
|
|
57
|
-
console.log(
|
|
58
|
+
// console.log(
|
|
59
|
+
// `componentDidUpdate: ${this.props.height} vs ${prevProps.height} and ${this.props.width} vs ${prevProps.width}`
|
|
60
|
+
// )
|
|
58
61
|
this.updateHeights();
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
64
|
updateHeights() {
|
|
62
65
|
// Calculate header and footer heights
|
|
63
66
|
if (this.header && this.state.headerHeight !== this.header.offsetHeight) {
|
|
64
|
-
console.log(
|
|
67
|
+
// console.log(
|
|
68
|
+
// `headerHeight: ${this.state.headerHeight} vs ${this.header.offsetHeight} => ${this.header.offsetHeight}`
|
|
69
|
+
// )
|
|
65
70
|
this.setState({ headerHeight: this.header.offsetHeight });
|
|
66
71
|
}
|
|
67
72
|
if (this.footer && this.state.footerHeight !== this.footer.offsetHeight) {
|
|
68
|
-
console.log(
|
|
73
|
+
// console.log(
|
|
74
|
+
// `footerHeight: ${this.state.footerHeight} vs ${this.footer.offsetHeight} => ${this.footer.offsetHeight}`
|
|
75
|
+
// )
|
|
69
76
|
this.setState({ footerHeight: this.footer.offsetHeight });
|
|
70
77
|
}
|
|
71
78
|
}
|
|
@@ -77,7 +84,7 @@ class LayeredChartViewComponent extends react_1.default.Component {
|
|
|
77
84
|
};
|
|
78
85
|
renderHeader() {
|
|
79
86
|
return R("div", {
|
|
80
|
-
ref:
|
|
87
|
+
ref: c => {
|
|
81
88
|
return (this.header = c);
|
|
82
89
|
}
|
|
83
90
|
}, R(TextComponent_1.default, {
|
|
@@ -91,10 +98,12 @@ class LayeredChartViewComponent extends react_1.default.Component {
|
|
|
91
98
|
}
|
|
92
99
|
renderFooter() {
|
|
93
100
|
return R("div", {
|
|
94
|
-
ref:
|
|
101
|
+
ref: c => {
|
|
95
102
|
return (this.footer = c);
|
|
96
103
|
}
|
|
97
|
-
},
|
|
104
|
+
},
|
|
105
|
+
// Don't render footer if it's empty and no onDesignChange
|
|
106
|
+
(0, TextWidgetDesign_1.isEmptyTextWidgetDesign)(this.props.design.footer) && this.props.onDesignChange == null ? null : R(TextComponent_1.default, {
|
|
98
107
|
design: this.props.design.footer,
|
|
99
108
|
onDesignChange: this.props.onDesignChange ? this.handleFooterChange : undefined,
|
|
100
109
|
schema: this.props.schema,
|
|
@@ -114,7 +123,7 @@ class LayeredChartViewComponent extends react_1.default.Component {
|
|
|
114
123
|
height: this.props.height - this.state.headerHeight - this.state.footerHeight,
|
|
115
124
|
scope: this.props.scope,
|
|
116
125
|
onScopeChange: this.props.onScopeChange,
|
|
117
|
-
locale: this.context
|
|
126
|
+
locale: this.context
|
|
118
127
|
})
|
|
119
128
|
: undefined, this.renderFooter());
|
|
120
129
|
}
|
|
@@ -156,9 +165,32 @@ class C3ChartComponent extends react_1.default.Component {
|
|
|
156
165
|
this.chart = billboard_js_1.default.generate(chartOptions);
|
|
157
166
|
}
|
|
158
167
|
catch (error) {
|
|
159
|
-
throw
|
|
168
|
+
throw error;
|
|
169
|
+
}
|
|
170
|
+
const el = this.chartDiv;
|
|
171
|
+
// https://github.com/mWater/monorepo/issues/8
|
|
172
|
+
if (props.design.type === "bar" && props.design.stacked && props.design.transpose) {
|
|
173
|
+
d3.select(el)
|
|
174
|
+
.selectAll(".bb-chart-text .bb-text")
|
|
175
|
+
.each(function (t, i) {
|
|
176
|
+
const bar = d3
|
|
177
|
+
.select(el)
|
|
178
|
+
.selectAll(".bb-chart-bar .bb-bar")
|
|
179
|
+
.filter((d) => {
|
|
180
|
+
return d.id === t.id && t.index === d.index;
|
|
181
|
+
})
|
|
182
|
+
.nodes()[0];
|
|
183
|
+
const text = d3.select(this);
|
|
184
|
+
const barBox = bar.getBBox();
|
|
185
|
+
const textBox = text.nodes()[0].getBBox();
|
|
186
|
+
if (barBox.width > textBox.width + 10) {
|
|
187
|
+
text.attr("x", barBox.x + (barBox.width - textBox.width) / 2);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
text.style("opacity", 0);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
160
193
|
}
|
|
161
|
-
console.log(this.chartDiv);
|
|
162
194
|
// Remove listener for window focus (https://github.com/c3js/c3/issues/2742)
|
|
163
195
|
window.removeEventListener("focus", this.chart.internal.windowFocusHandler);
|
|
164
196
|
this.chart.internal.windowFocusHandler = () => { };
|
|
@@ -231,62 +263,81 @@ class C3ChartComponent extends react_1.default.Component {
|
|
|
231
263
|
if (box.height < 12) {
|
|
232
264
|
d3.select(el)
|
|
233
265
|
.selectAll(".bb-chart-text .bb-text")
|
|
234
|
-
.filter(function (p, j) {
|
|
266
|
+
.filter(function (p, j) {
|
|
267
|
+
return i === j;
|
|
268
|
+
})
|
|
235
269
|
.each(function (_p) {
|
|
236
270
|
smalls.push({
|
|
237
271
|
origin_x: box.x,
|
|
238
272
|
origin_y: box.y,
|
|
239
273
|
series: map.get(p.id),
|
|
240
|
-
textY: box.y -
|
|
241
|
-
textX: box.x + 25
|
|
274
|
+
textY: box.y - 12 * map.get(p.id) - 10,
|
|
275
|
+
textX: box.x + 25
|
|
242
276
|
});
|
|
243
277
|
d3.select(this).node().classList.add("needs_adjustment");
|
|
244
278
|
})
|
|
245
|
-
.attr(
|
|
246
|
-
.attr(
|
|
247
|
-
return box.y -
|
|
279
|
+
.attr("data-boxX", box.x)
|
|
280
|
+
.attr("y", function () {
|
|
281
|
+
return box.y - 12 * map.get(p.id) - 10;
|
|
248
282
|
// return Number(d3.select(this).attr('y')) - 7
|
|
249
283
|
});
|
|
250
284
|
}
|
|
251
285
|
});
|
|
252
286
|
if (smalls.length > 0) {
|
|
253
287
|
const sliceWidth = 4;
|
|
254
|
-
const seriesToBeDrawn = lodash_1.default.uniq(smalls.map(
|
|
288
|
+
const seriesToBeDrawn = lodash_1.default.uniq(smalls.map(s => s.series)).length;
|
|
255
289
|
d3.select(el)
|
|
256
290
|
.selectAll(".needs_adjustment")
|
|
257
|
-
.attr(
|
|
291
|
+
.attr("x", function () {
|
|
258
292
|
const self = d3.select(this);
|
|
259
|
-
return Number(self.attr(
|
|
293
|
+
return Number(self.attr("data-boxX")) + seriesToBeDrawn * sliceWidth + 10;
|
|
260
294
|
})
|
|
261
|
-
.attr(
|
|
262
|
-
const hackGroup = d3
|
|
295
|
+
.attr("text-anchor", "left");
|
|
296
|
+
const hackGroup = d3
|
|
297
|
+
.select(el)
|
|
263
298
|
.selectAll(".bb-chart")
|
|
264
299
|
.selectAll(".popout_labels")
|
|
265
300
|
.data(["1"])
|
|
266
301
|
.enter()
|
|
267
|
-
.append(
|
|
268
|
-
.attr(
|
|
302
|
+
.append("g")
|
|
303
|
+
.attr("class", "popout_labels");
|
|
269
304
|
hackGroup
|
|
270
|
-
.selectAll(
|
|
305
|
+
.selectAll("line")
|
|
271
306
|
.data(smalls)
|
|
272
307
|
.enter()
|
|
273
|
-
.append(
|
|
274
|
-
.attr(
|
|
275
|
-
.
|
|
276
|
-
|
|
277
|
-
.attr(
|
|
278
|
-
.
|
|
308
|
+
.append("line")
|
|
309
|
+
.attr("x1", function (d) {
|
|
310
|
+
return stacked ? d.origin_x + sliceWidth * (seriesToBeDrawn - d.series) : d.origin_x + 5;
|
|
311
|
+
})
|
|
312
|
+
.attr("y1", function (d) {
|
|
313
|
+
return d.origin_y;
|
|
314
|
+
})
|
|
315
|
+
.attr("x2", function (d) {
|
|
316
|
+
return stacked ? d.origin_x + sliceWidth * (seriesToBeDrawn - d.series) : d.origin_x + 5;
|
|
317
|
+
})
|
|
318
|
+
.attr("y2", function (d) {
|
|
319
|
+
return d.textY + 3;
|
|
320
|
+
})
|
|
321
|
+
.attr("shape-rendering", "crispEdges")
|
|
279
322
|
.style("stroke", "black")
|
|
280
323
|
.style("stroke-width", 0.5)
|
|
281
324
|
.exit()
|
|
282
325
|
.data(smalls)
|
|
283
326
|
.enter()
|
|
284
|
-
.append(
|
|
285
|
-
.attr(
|
|
286
|
-
.
|
|
287
|
-
|
|
288
|
-
.attr(
|
|
289
|
-
.
|
|
327
|
+
.append("line")
|
|
328
|
+
.attr("x1", function (d) {
|
|
329
|
+
return stacked ? d.origin_x + sliceWidth * (seriesToBeDrawn - d.series) : d.origin_x + 5;
|
|
330
|
+
})
|
|
331
|
+
.attr("y1", function (d) {
|
|
332
|
+
return d.textY + 3;
|
|
333
|
+
})
|
|
334
|
+
.attr("x2", function (d) {
|
|
335
|
+
return d.origin_x + seriesToBeDrawn * sliceWidth + 8;
|
|
336
|
+
})
|
|
337
|
+
.attr("y2", function (d) {
|
|
338
|
+
return d.textY;
|
|
339
|
+
})
|
|
340
|
+
.attr("shape-rendering", "crispEdges")
|
|
290
341
|
.style("stroke", "black")
|
|
291
342
|
.style("stroke-width", 0.5)
|
|
292
343
|
.exit();
|
|
@@ -398,7 +449,7 @@ class C3ChartComponent extends react_1.default.Component {
|
|
|
398
449
|
// css += ".c3-chart-arc text { font-size: #{scale * 13}px; }\n"
|
|
399
450
|
// css += ".c3-title { font-size: #{scale * 14}px; }\n"
|
|
400
451
|
return R("div", {
|
|
401
|
-
ref:
|
|
452
|
+
ref: c => {
|
|
402
453
|
return (this.chartDiv = c);
|
|
403
454
|
}
|
|
404
455
|
});
|
|
@@ -1,115 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DataSource,
|
|
3
|
-
import { PivotChartIntersection } from "./PivotChartDesign";
|
|
2
|
+
import { DataSource, Schema } from "@mwater/expressions";
|
|
3
|
+
import { PivotChartDesign, PivotChartIntersection } from "./PivotChartDesign";
|
|
4
4
|
import { JsonQLFilter } from "../../../JsonQLFilter";
|
|
5
5
|
export interface IntersectionDesignerComponentProps {
|
|
6
|
+
design: PivotChartDesign;
|
|
6
7
|
intersection: PivotChartIntersection;
|
|
8
|
+
intersectionId: string;
|
|
7
9
|
table: string;
|
|
8
10
|
schema: Schema;
|
|
9
11
|
dataSource: DataSource;
|
|
10
12
|
onChange: (intersection: PivotChartIntersection) => void;
|
|
11
13
|
filters?: JsonQLFilter[];
|
|
12
14
|
}
|
|
13
|
-
export default
|
|
14
|
-
constructor(props: IntersectionDesignerComponentProps);
|
|
15
|
-
update(...args: any[]): any;
|
|
16
|
-
handleBackgroundColorAxisChange: (backgroundColorAxis: any) => any;
|
|
17
|
-
handleBackgroundColorChange: (backgroundColor: any) => any;
|
|
18
|
-
handleBackgroundColorConditionsChange: (backgroundColorConditions: any) => any;
|
|
19
|
-
handleBackgroundColorOpacityChange: (newValue: any) => any;
|
|
20
|
-
handleFilterChange: (filter: any) => any;
|
|
21
|
-
renderValueAxis(): React.CElement<{
|
|
22
|
-
labelMuted: boolean;
|
|
23
|
-
label: string;
|
|
24
|
-
help: string;
|
|
25
|
-
}, React.Component<{
|
|
26
|
-
labelMuted: boolean;
|
|
27
|
-
label: string;
|
|
28
|
-
help: string;
|
|
29
|
-
}, any, any>>;
|
|
30
|
-
renderNullValue(): React.CElement<{
|
|
31
|
-
labelMuted: boolean;
|
|
32
|
-
label: string;
|
|
33
|
-
}, React.Component<{
|
|
34
|
-
labelMuted: boolean;
|
|
35
|
-
label: string;
|
|
36
|
-
}, any, any>> | null;
|
|
37
|
-
renderFilter(): React.CElement<{
|
|
38
|
-
labelMuted: boolean;
|
|
39
|
-
label: (string | React.CElement<{
|
|
40
|
-
id: string;
|
|
41
|
-
}, React.Component<{
|
|
42
|
-
id: string;
|
|
43
|
-
}, any, any>>)[];
|
|
44
|
-
}, React.Component<{
|
|
45
|
-
labelMuted: boolean;
|
|
46
|
-
label: (string | React.CElement<{
|
|
47
|
-
id: string;
|
|
48
|
-
}, React.Component<{
|
|
49
|
-
id: string;
|
|
50
|
-
}, any, any>>)[];
|
|
51
|
-
}, any, any>>;
|
|
52
|
-
renderStyling(): React.CElement<{
|
|
53
|
-
labelMuted: boolean;
|
|
54
|
-
key: string;
|
|
55
|
-
label: string;
|
|
56
|
-
}, React.Component<{
|
|
57
|
-
labelMuted: boolean;
|
|
58
|
-
key: string;
|
|
59
|
-
label: string;
|
|
60
|
-
}, any, any>>;
|
|
61
|
-
renderBackgroundColorConditions(): React.CElement<BackgroundColorConditionsComponentProps, BackgroundColorConditionsComponent>;
|
|
62
|
-
renderBackgroundColorAxis(): React.CElement<{
|
|
63
|
-
labelMuted: boolean;
|
|
64
|
-
label: string;
|
|
65
|
-
help: string;
|
|
66
|
-
}, React.Component<{
|
|
67
|
-
labelMuted: boolean;
|
|
68
|
-
label: string;
|
|
69
|
-
help: string;
|
|
70
|
-
}, any, any>>;
|
|
71
|
-
renderBackgroundColor(): React.CElement<{
|
|
72
|
-
labelMuted: boolean;
|
|
73
|
-
label: string;
|
|
74
|
-
help: string;
|
|
75
|
-
}, React.Component<{
|
|
76
|
-
labelMuted: boolean;
|
|
77
|
-
label: string;
|
|
78
|
-
help: string;
|
|
79
|
-
}, any, any>> | undefined;
|
|
80
|
-
renderBackgroundColorOpacityControl(): React.CElement<{
|
|
81
|
-
labelMuted: boolean;
|
|
82
|
-
label: string;
|
|
83
|
-
}, React.Component<{
|
|
84
|
-
labelMuted: boolean;
|
|
85
|
-
label: string;
|
|
86
|
-
}, any, any>> | undefined;
|
|
87
|
-
render(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
88
|
-
}
|
|
89
|
-
interface BackgroundColorConditionsComponentProps {
|
|
90
|
-
colorConditions?: {
|
|
91
|
-
condition?: Expr;
|
|
92
|
-
color?: string;
|
|
93
|
-
}[];
|
|
94
|
-
table: string;
|
|
95
|
-
schema: Schema;
|
|
96
|
-
dataSource: DataSource;
|
|
97
|
-
onChange: (colorConditions?: {
|
|
98
|
-
condition?: Expr;
|
|
99
|
-
color?: string;
|
|
100
|
-
}[]) => void;
|
|
101
|
-
}
|
|
102
|
-
/** Displays background color conditions */
|
|
103
|
-
declare class BackgroundColorConditionsComponent extends React.Component<BackgroundColorConditionsComponentProps> {
|
|
104
|
-
handleAdd: () => void;
|
|
105
|
-
render(): React.CElement<{
|
|
106
|
-
label: string;
|
|
107
|
-
labelMuted: boolean;
|
|
108
|
-
help: string;
|
|
109
|
-
}, React.Component<{
|
|
110
|
-
label: string;
|
|
111
|
-
labelMuted: boolean;
|
|
112
|
-
help: string;
|
|
113
|
-
}, any, any>>;
|
|
114
|
-
}
|
|
115
|
-
export {};
|
|
15
|
+
export default function IntersectionDesignerComponent(props: IntersectionDesignerComponentProps): React.JSX.Element;
|