@evergis/react 3.1.15 → 3.1.17
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/dist/components/Dashboard/components/Chart/styled.d.ts +16 -0
- package/dist/components/Dashboard/containers/RoundedBackgroundContainer/styled.d.ts +2 -0
- package/dist/components/Dashboard/hooks/useChartChange.d.ts +2 -1
- package/dist/components/Dashboard/types.d.ts +4 -1
- package/dist/components/Dashboard/utils/getChartMarkers.d.ts +2 -2
- package/dist/index.js +214 -95
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +225 -106
- package/dist/react.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/react.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
-
import { IconButton, Flex, transition, Chip, Icon, Description, FlexSpan, IconToggle, Popup, Menu, DraggableTree, shadows, Divider, LegendToggler, Tooltip, DropdownField, MultiSelectContainer, IconButtonButton, FlatButton, DraggableTreeContainer, LinearProgress, H2, ThemeProvider, defaultTheme, Preview, Blank, Popover, darkTheme, NumberRangeSlider, useAsyncAutocomplete, AutoComplete, Dropdown, Checkbox, CircularProgress, RangeNumberInput, dateFormat } from '@evergis/uilib-gl';
|
|
2
|
+
import { IconButton, Flex, transition, Chip, Icon, Description, FlexSpan, IconToggle, Popup, Menu, DraggableTree, shadows, Divider, LegendToggler, Tooltip as Tooltip$1, DropdownField, MultiSelectContainer, IconButtonButton, FlatButton, DraggableTreeContainer, LinearProgress, H2, ThemeProvider, defaultTheme, Preview, Blank, Popover, darkTheme, NumberRangeSlider, useAsyncAutocomplete, AutoComplete, Dropdown, Checkbox, CircularProgress, RangeNumberInput, dateFormat } from '@evergis/uilib-gl';
|
|
3
3
|
import { createContext, memo, useRef, useState, useEffect, useCallback, useContext, useMemo, Fragment } from 'react';
|
|
4
|
-
import styled, { css, useTheme } from 'styled-components';
|
|
5
|
-
import { lineChartClassNames,
|
|
4
|
+
import styled, { createGlobalStyle, css, useTheme } from 'styled-components';
|
|
5
|
+
import { lineChartClassNames, BarChart as BarChart$1, barChartClassNames, LineChart, PieChart } from '@evergis/charts';
|
|
6
6
|
import { AttributeType, GeometryType } from '@evergis/api';
|
|
7
7
|
import Gradient from 'javascript-color-gradient';
|
|
8
8
|
import { Color as Color$1 } from '@evergis/color';
|
|
@@ -35,14 +35,18 @@ const ChartTooltipTable = styled.table `
|
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
37
|
const ChartTooltip = styled(Flex) `
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
align-items: center;
|
|
40
38
|
flex-wrap: nowrap;
|
|
39
|
+
background: rgb(48, 69, 79);
|
|
40
|
+
border-radius: 0.25rem;
|
|
41
|
+
color: white;
|
|
41
42
|
|
|
42
43
|
:not(:last-child) {
|
|
43
44
|
margin-bottom: 0.25rem;
|
|
44
45
|
}
|
|
45
46
|
`;
|
|
47
|
+
const ChartTooltipLabel = styled.div `
|
|
48
|
+
margin-right: 0.25rem;
|
|
49
|
+
`;
|
|
46
50
|
const ChartTooltipColor = styled.div `
|
|
47
51
|
width: 0.625rem;
|
|
48
52
|
height: 0.625rem;
|
|
@@ -88,6 +92,115 @@ const ChartWrapperContainer = styled.div `
|
|
|
88
92
|
position: relative;
|
|
89
93
|
width: 100%;
|
|
90
94
|
`;
|
|
95
|
+
const Tooltip = styled.div `
|
|
96
|
+
position: relative;
|
|
97
|
+
border-radius: 0.25rem;
|
|
98
|
+
background-color: rgba(28, 33, 48);
|
|
99
|
+
padding: 0.5rem;
|
|
100
|
+
box-shadow: 0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.15);
|
|
101
|
+
font-size: 0.75rem;
|
|
102
|
+
transform: ${({ transform }) => transform};
|
|
103
|
+
color: white;
|
|
104
|
+
|
|
105
|
+
:before {
|
|
106
|
+
position: absolute;
|
|
107
|
+
display: block;
|
|
108
|
+
content: "";
|
|
109
|
+
width: 0;
|
|
110
|
+
height: 0;
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
const LineChartStyles = createGlobalStyle `
|
|
114
|
+
.dashboardLineChartTooltip.${lineChartClassNames.lineChartMouseLabel} {
|
|
115
|
+
.${lineChartClassNames.lineChartLabelFlex} {
|
|
116
|
+
justify-content: center;
|
|
117
|
+
align-items: flex-end;
|
|
118
|
+
|
|
119
|
+
${Tooltip} {
|
|
120
|
+
margin: 0 0 12px 0;
|
|
121
|
+
|
|
122
|
+
:before {
|
|
123
|
+
top: auto;
|
|
124
|
+
bottom: 0;
|
|
125
|
+
left: 50%;
|
|
126
|
+
transform: translate(-50%, 100%);
|
|
127
|
+
border-left: 4px solid transparent;
|
|
128
|
+
border-right: 4px solid transparent;
|
|
129
|
+
border-top: 4px solid rgba(28, 33, 48, 0.9);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.${lineChartClassNames.lineChartYScaleGlobal}, .${lineChartClassNames.lineChartXScaleGlobal} {
|
|
136
|
+
.domain {
|
|
137
|
+
visibility: hidden;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.tick {
|
|
141
|
+
text {
|
|
142
|
+
fill: ${({ theme: { palette } }) => palette.textDisabled};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
line {
|
|
146
|
+
visibility: hidden;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.${lineChartClassNames.lineChartXScaleGlobal} {
|
|
152
|
+
.tick {
|
|
153
|
+
:first-of-type {
|
|
154
|
+
text {
|
|
155
|
+
text-anchor: start;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:last-of-type {
|
|
160
|
+
text {
|
|
161
|
+
text-anchor: end;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.${lineChartClassNames.lineChartLine} {
|
|
168
|
+
stroke-width: 2px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.${lineChartClassNames.lineChartLabel} {
|
|
172
|
+
color: ${({ theme: { palette } }) => palette.textPrimary};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.${lineChartClassNames.lineChartMouseCircle} {
|
|
176
|
+
stroke: #ffffff;
|
|
177
|
+
stroke-width: 2px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.${lineChartClassNames.lineChartGridLineX} {
|
|
181
|
+
stroke: ${({ theme: { palette } }) => palette.element};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
text {
|
|
185
|
+
fill: ${({ theme: { palette } }) => palette.textDisabled};
|
|
186
|
+
}
|
|
187
|
+
`;
|
|
188
|
+
const StyledBarChart = styled(BarChart$1) `
|
|
189
|
+
.domain,
|
|
190
|
+
line {
|
|
191
|
+
display: none;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.tick {
|
|
195
|
+
text {
|
|
196
|
+
fill: ${({ theme: { palette } }) => palette.textDisabled};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
line {
|
|
200
|
+
visibility: hidden;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
91
204
|
|
|
92
205
|
function range(start, stop, step) {
|
|
93
206
|
start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
|
|
@@ -3882,41 +3995,7 @@ function wrap() {
|
|
|
3882
3995
|
textLength = self.node().getComputedTextLength();
|
|
3883
3996
|
}
|
|
3884
3997
|
}
|
|
3885
|
-
|
|
3886
|
-
/* function wrap2(text, width, content) {
|
|
3887
|
-
text.each(() => {
|
|
3888
|
-
const textElem = d3.select(this);
|
|
3889
|
-
const words = content.split(/\s+/).reverse();
|
|
3890
|
-
let word;
|
|
3891
|
-
let line = [];
|
|
3892
|
-
let lineNumber = 0;
|
|
3893
|
-
const lineHeight = 1.1; // ems
|
|
3894
|
-
const x = 0; // textElem.attr("x");
|
|
3895
|
-
const y = 0; // textElem.attr("y");
|
|
3896
|
-
const dy = 0; // parseFloat(text.attr("dy")),
|
|
3897
|
-
// eslint-disable-next-line newline-per-chained-call
|
|
3898
|
-
let tspan = textElem.text(null).append("tspan").attr("x", x).attr("y", y).attr("dy", `${dy}em`);
|
|
3899
|
-
|
|
3900
|
-
// eslint-disable-next-line no-cond-assign
|
|
3901
|
-
while ((word = words.pop())) {
|
|
3902
|
-
line.push(word);
|
|
3903
|
-
tspan.text(line.join(" "));
|
|
3904
|
-
if (tspan.node().getComputedTextLength() > width) {
|
|
3905
|
-
line.pop();
|
|
3906
|
-
tspan.text(line.join(" "));
|
|
3907
|
-
line = [word];
|
|
3908
|
-
tspan = textElem
|
|
3909
|
-
.append("tspan")
|
|
3910
|
-
.attr("x", x)
|
|
3911
|
-
.attr("y", y)
|
|
3912
|
-
// eslint-disable-next-line no-plusplus
|
|
3913
|
-
.attr("dy", `${++lineNumber * lineHeight + dy}em`)
|
|
3914
|
-
.text(word);
|
|
3915
|
-
}
|
|
3916
|
-
}
|
|
3917
|
-
});
|
|
3918
|
-
}*/
|
|
3919
|
-
const useChartChange = ({ dataSources, chartId, width, height, relatedAttributes, defaultColor, fontColor, }) => {
|
|
3998
|
+
const useChartChange = ({ dataSources, chartId, width, height, relatedAttributes, defaultColor, fontColor, showMarkers, }) => {
|
|
3920
3999
|
const { t } = useGlobalContext();
|
|
3921
4000
|
const { layerInfos } = useWidgetContext();
|
|
3922
4001
|
const strokeColors = relatedAttributes.filter(({ chartAxis }) => chartAxis === "y").map(({ axisColor }) => axisColor);
|
|
@@ -3953,11 +4032,17 @@ const useChartChange = ({ dataSources, chartId, width, height, relatedAttributes
|
|
|
3953
4032
|
if (index === nodes.length - 1) {
|
|
3954
4033
|
nodes[index].style.textAnchor = "end";
|
|
3955
4034
|
}
|
|
3956
|
-
if (
|
|
3957
|
-
|
|
4035
|
+
if (showMarkers) {
|
|
4036
|
+
if (index % (showMarkers || 1) !== 0) {
|
|
4037
|
+
nodes[index].remove();
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
else {
|
|
4041
|
+
if (index && index < nodes.length - 1) {
|
|
4042
|
+
nodes[index].remove();
|
|
4043
|
+
}
|
|
3958
4044
|
}
|
|
3959
4045
|
});
|
|
3960
|
-
// svg.selectAll(`.${lineChartClassNames.lineChartXScaleGlobal} .tick text`).call(wrap2, 5, "!!!");
|
|
3961
4046
|
svg.selectAll(`.${lineChartClassNames.lineChartXScaleGlobal} .tick text`).attr("y", 16);
|
|
3962
4047
|
svg
|
|
3963
4048
|
.selectAll(`.${lineChartClassNames.lineChartYScaleGlobal} .tick text`)
|
|
@@ -4003,7 +4088,7 @@ const useChartChange = ({ dataSources, chartId, width, height, relatedAttributes
|
|
|
4003
4088
|
onChange();
|
|
4004
4089
|
});
|
|
4005
4090
|
svg.append("defs").html(() => defs.join(""));
|
|
4006
|
-
}, [fontColor, dataSources, layerInfos, relatedAttributes, chartId, strokeColors, defaultColor, width, onChange]);
|
|
4091
|
+
}, [fontColor, dataSources, layerInfos, relatedAttributes, chartId, strokeColors, defaultColor, width, onChange, showMarkers]);
|
|
4007
4092
|
return [customize, onChange];
|
|
4008
4093
|
};
|
|
4009
4094
|
|
|
@@ -5292,7 +5377,11 @@ const getChartFilterName = (relatedDataSources) => {
|
|
|
5292
5377
|
return axes?.[0]?.filterName;
|
|
5293
5378
|
};
|
|
5294
5379
|
|
|
5295
|
-
const getChartMarkers = (items, markers) => {
|
|
5380
|
+
const getChartMarkers = (items, markers, dataSources) => {
|
|
5381
|
+
if (typeof markers === "string") {
|
|
5382
|
+
const dataSource = getDataSource(markers, dataSources);
|
|
5383
|
+
return dataSource?.features?.map(({ attributes }) => attributes) || [];
|
|
5384
|
+
}
|
|
5296
5385
|
return (markers?.map(marker => ({
|
|
5297
5386
|
...marker,
|
|
5298
5387
|
value: items?.findIndex(({ name }) => name.toString() === marker.value?.toString()),
|
|
@@ -5618,7 +5707,7 @@ const ProgressContainer = memo(({ type, elementConfig, feature, maxValue, index,
|
|
|
5618
5707
|
const color = useMemo(() => colorAttribute
|
|
5619
5708
|
? attributes?.find(({ name }) => name === colorAttribute)?.value
|
|
5620
5709
|
: colors?.[index] || bgColor, [attributes, bgColor, colorAttribute, colors, index]);
|
|
5621
|
-
return (jsx(Tooltip, { content: renderTooltip, placement: "top", arrow: true, children: ref => (jsxs(ProgressContainerWrapper, { ref: ref, style: innerTemplateStyle || style, children: [renderIcon && jsx(ProgressIcon, { children: renderIcon }), jsxs(ProgressContent, { children: [!hideTitle && (jsxs(ProgressAlias, { children: [jsx("div", { children: renderAlias }), jsxs(ProgressValue, { children: [renderValue, unitsElement && jsx(ProgressUnits, { children: renderElement({ id: "units" }) })] })] })), jsxs(ProgressBarContainer, { innerValue: innerValue, children: [jsx(ProgressBarWrapper, { children: jsx(ProgressBar, { "$width": width, "$color": color }) }), !!(hideTitle || innerValue) && jsx(ProgressInnerValue, { children: renderValue })] })] })] })) }));
|
|
5710
|
+
return (jsx(Tooltip$1, { content: renderTooltip, placement: "top", arrow: true, children: ref => (jsxs(ProgressContainerWrapper, { ref: ref, style: innerTemplateStyle || style, children: [renderIcon && jsx(ProgressIcon, { children: renderIcon }), jsxs(ProgressContent, { children: [!hideTitle && (jsxs(ProgressAlias, { children: [jsx("div", { children: renderAlias }), jsxs(ProgressValue, { children: [renderValue, unitsElement && jsx(ProgressUnits, { children: renderElement({ id: "units" }) })] })] })), jsxs(ProgressBarContainer, { innerValue: innerValue, children: [jsx(ProgressBarWrapper, { children: jsx(ProgressBar, { "$width": width, "$color": color }) }), !!(hideTitle || innerValue) && jsx(ProgressInnerValue, { children: renderValue })] })] })] })) }));
|
|
5622
5711
|
});
|
|
5623
5712
|
|
|
5624
5713
|
const RANGE_MIN_VALUE = 0;
|
|
@@ -5714,7 +5803,6 @@ const AnyChartWrapper = styled.div `
|
|
|
5714
5803
|
`;
|
|
5715
5804
|
const BarChartWrapper = styled(AnyChartWrapper) `
|
|
5716
5805
|
width: 100%;
|
|
5717
|
-
max-width: ${MAX_CHART_WIDTH}px;
|
|
5718
5806
|
margin: 0 auto ${BAR_CHART_FOOTER_MARGIN}px;
|
|
5719
5807
|
|
|
5720
5808
|
:hover {
|
|
@@ -5844,7 +5932,7 @@ const PagesContainer = memo(({ type }) => {
|
|
|
5844
5932
|
const { pageIndex, currentPage } = useWidgetPage(type);
|
|
5845
5933
|
const { selectedTabId, setSelectedTabId, expandedContainers, attributes } = useWidgetContext(type);
|
|
5846
5934
|
const { options } = config || {};
|
|
5847
|
-
const { column } = options || {};
|
|
5935
|
+
const { column, width } = options || {};
|
|
5848
5936
|
const isColumn = column === undefined || column;
|
|
5849
5937
|
const filteredChildren = useMemo(() => !selectedTabId
|
|
5850
5938
|
? currentPage.children
|
|
@@ -5869,7 +5957,7 @@ const PagesContainer = memo(({ type }) => {
|
|
|
5869
5957
|
setSelectedTabId,
|
|
5870
5958
|
type,
|
|
5871
5959
|
]);
|
|
5872
|
-
return (jsxs(
|
|
5960
|
+
return (jsxs("div", { style: { width }, children: [jsx(ExpandableTitle, { elementConfig: config, type: type, renderElement: renderElement }), jsx(Container, { isColumn: isColumn, isMain: true, children: jsx(ContainerChildren, { items: filteredChildren, isMain: true, renderElement: renderElement }) })] }));
|
|
5873
5961
|
});
|
|
5874
5962
|
|
|
5875
5963
|
const TwoColumnsInnerContainer = memo(({ renderElement }) => {
|
|
@@ -6268,6 +6356,7 @@ const TabsContainer = memo(({ elementConfig, type }) => {
|
|
|
6268
6356
|
return (jsx(SwiperContainer, { style: style, children: jsx(Swiper, { spaceBetween: 0, slidesPerView: shownItems || 2, children: tabs.map(({ id, value, options: tabOptions }) => (jsxs(SwiperSlide, { children: [jsxs(TabContainer, { href: `#${id}`, active: selectedTabId === id, column: column, bgColor: bgColor, noBg: noBg, radius: radius, onlyIcon: onlyIcon, hasIcon: !!tabOptions?.icon, onClick: () => onClick(id), children: [renderIcon(tabOptions?.icon, selectedTabId === id), !onlyIcon && (jsx(TabValue, { children: jsx(TextTrim, { maxLength: maxLength, children: value }) }))] }), jsx(TabAnchor, { id: id })] }, id))) }) }));
|
|
6269
6357
|
});
|
|
6270
6358
|
|
|
6359
|
+
const ContainerIconValue = styled(Flex) ``;
|
|
6271
6360
|
const RoundedBackgroundContainerWrapper = styled(Flex) `
|
|
6272
6361
|
position: relative;
|
|
6273
6362
|
flex-direction: ${({ $bigIcon }) => ($bigIcon ? "row" : "column")};
|
|
@@ -6285,13 +6374,10 @@ const RoundedBackgroundContainerWrapper = styled(Flex) `
|
|
|
6285
6374
|
css `
|
|
6286
6375
|
align-items: center;
|
|
6287
6376
|
|
|
6288
|
-
* {
|
|
6377
|
+
> * {
|
|
6289
6378
|
display: flex;
|
|
6290
6379
|
justify-content: center;
|
|
6291
6380
|
text-align: center;
|
|
6292
|
-
}
|
|
6293
|
-
|
|
6294
|
-
> * {
|
|
6295
6381
|
width: 100%;
|
|
6296
6382
|
}
|
|
6297
6383
|
`};
|
|
@@ -6324,8 +6410,32 @@ const RoundedBackgroundContainerWrapper = styled(Flex) `
|
|
|
6324
6410
|
}
|
|
6325
6411
|
`};
|
|
6326
6412
|
|
|
6413
|
+
${ContainerIconValue} {
|
|
6414
|
+
align-items: center;
|
|
6415
|
+
flex-direction: column;
|
|
6416
|
+
|
|
6417
|
+
${({ $big }) => $big &&
|
|
6418
|
+
css `
|
|
6419
|
+
flex-direction: row;
|
|
6420
|
+
margin-bottom: 0.5rem;
|
|
6421
|
+
|
|
6422
|
+
> * {
|
|
6423
|
+
text-align: left;
|
|
6424
|
+
}
|
|
6425
|
+
|
|
6426
|
+
span[kind] {
|
|
6427
|
+
margin-right: 0.5rem;
|
|
6428
|
+
}
|
|
6429
|
+
|
|
6430
|
+
${ContainerValue} {
|
|
6431
|
+
width: auto;
|
|
6432
|
+
}
|
|
6433
|
+
`};
|
|
6434
|
+
}
|
|
6435
|
+
|
|
6327
6436
|
${ContainerValue} {
|
|
6328
6437
|
flex-direction: ${({ $inlineUnits }) => ($inlineUnits ? "row" : "column")};
|
|
6438
|
+
justify-content: ${({ $big }) => ($big ? "flex-start" : "flex-end")};
|
|
6329
6439
|
align-items: ${({ $inlineUnits }) => ($inlineUnits ? "center" : "flex-start")};
|
|
6330
6440
|
line-height: 1;
|
|
6331
6441
|
}
|
|
@@ -6349,15 +6459,17 @@ const RoundedBackgroundContainer = memo(({ type, elementConfig, feature, renderE
|
|
|
6349
6459
|
feature
|
|
6350
6460
|
});
|
|
6351
6461
|
const { options, style, children } = elementConfig || {};
|
|
6352
|
-
const { maxLength, center, fontColor, innerTemplateStyle, inlineUnits, bigIcon, hideEmpty, colorAttribute } = options || {};
|
|
6462
|
+
const { maxLength, center, fontColor, innerTemplateStyle, inlineUnits, big, bigIcon, hideEmpty, colorAttribute } = options || {};
|
|
6353
6463
|
const aliasElement = children?.find(({ id }) => id === "alias");
|
|
6354
6464
|
const unitsElement = children?.find(({ id }) => id === "units");
|
|
6355
6465
|
const valueElement = children?.find(({ id }) => id === "value");
|
|
6356
6466
|
const value = renderElement({ id: "value" });
|
|
6357
6467
|
const color = useMemo(() => attributes?.find(({ name }) => name === colorAttribute)?.value || fontColor, [attributes, colorAttribute, fontColor]);
|
|
6468
|
+
const renderAlias = useMemo(() => (jsx(ContainerAlias, { style: aliasElement?.style, children: jsx(TextTrim, { maxLength: maxLength || ALIAS_DEFAULT_MAX_LENGTH, children: renderElement({ id: "alias", wrap: false }) }) })), [aliasElement?.style, maxLength, renderElement]);
|
|
6469
|
+
const renderValue = useMemo(() => (jsxs(ContainerValue, { style: valueElement?.style, big: true, children: [value, !!unitsElement && (jsx(ContainerUnits, { style: unitsElement?.style, children: renderElement({ id: "units" }) }))] })), [valueElement?.style, value, unitsElement, renderElement]);
|
|
6358
6470
|
if (!value && hideEmpty)
|
|
6359
6471
|
return null;
|
|
6360
|
-
return (jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$
|
|
6472
|
+
return (jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxs(ContainerIconValue, { children: [renderElement({ id: "icon", wrap: false }), big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
|
|
6361
6473
|
});
|
|
6362
6474
|
|
|
6363
6475
|
const AddFeatureContainer = memo(({ elementConfig }) => {
|
|
@@ -6543,7 +6655,7 @@ var EditGeometryType;
|
|
|
6543
6655
|
const DashboardDefaultHeader = memo(() => {
|
|
6544
6656
|
const { components: { ProjectCatalogMenu, ProjectPanelMenu, ProjectPagesMenu }, } = useWidgetContext();
|
|
6545
6657
|
const { pageId, image, icon, tooltip, themeName } = useDashboardHeader();
|
|
6546
|
-
return (jsxs(DefaultHeaderContainer, { image: image, isDark: themeName === ThemeName.Dark, children: [!pageId && jsx(LinearProgress, {}), jsxs(Flex, { column: true, gap: "1rem", children: [jsx(FlexSpan, { children: jsxs(TopContainer, { children: [jsx(LogoContainer, { children: icon }), jsxs(TopContainerButtons, { children: [jsx(ProjectCatalogMenu, {}), jsx(ProjectPanelMenu, {})] })] }) }), jsx(FlexSpan, { children: jsx(Flex, { column: true, gap: "0.25rem", children: jsx(FlexSpan, { children: jsxs(Flex, { alignItems: "center", children: [jsx(FlexSpan, { flexGrow: 1, children: jsx(Tooltip, { arrow: true, content: tooltip, children: ref => (jsx(PageTitle, { ref: ref, children: jsx(ProjectPagesMenu, {}) })) }) }), jsx(FlexSpan, { children: jsx(Pagination, {}) })] }) }) }) })] })] }));
|
|
6658
|
+
return (jsxs(DefaultHeaderContainer, { image: image, isDark: themeName === ThemeName.Dark, children: [!pageId && jsx(LinearProgress, {}), jsxs(Flex, { column: true, gap: "1rem", children: [jsx(FlexSpan, { children: jsxs(TopContainer, { children: [jsx(LogoContainer, { children: icon }), jsxs(TopContainerButtons, { children: [jsx(ProjectCatalogMenu, {}), jsx(ProjectPanelMenu, {})] })] }) }), jsx(FlexSpan, { children: jsx(Flex, { column: true, gap: "0.25rem", children: jsx(FlexSpan, { children: jsxs(Flex, { alignItems: "center", children: [jsx(FlexSpan, { flexGrow: 1, children: jsx(Tooltip$1, { arrow: true, content: tooltip, children: ref => (jsx(PageTitle, { ref: ref, children: jsx(ProjectPagesMenu, {}) })) }) }), jsx(FlexSpan, { children: jsx(Pagination, {}) })] }) }) }) })] })] }));
|
|
6547
6659
|
});
|
|
6548
6660
|
|
|
6549
6661
|
const HeaderFrontView = styled(Flex) `
|
|
@@ -6645,7 +6757,7 @@ const HeaderTitle = ({ noFeature }) => {
|
|
|
6645
6757
|
})) ||
|
|
6646
6758
|
feature?.id);
|
|
6647
6759
|
}, [attributes, feature, layerDefinition]);
|
|
6648
|
-
return (jsxs(HeaderTitleContainer, { children: [noFeature ? (jsx(FeatureTitleContainer, { children: t("noObjectFound", { ns: "dashboard" }) })) : (jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) })), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
6760
|
+
return (jsxs(HeaderTitleContainer, { children: [noFeature ? (jsx(FeatureTitleContainer, { children: t("noObjectFound", { ns: "dashboard" }) })) : (jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip$1, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) })), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
6649
6761
|
};
|
|
6650
6762
|
|
|
6651
6763
|
const LayerIconContainer = styled.div `
|
|
@@ -7394,7 +7506,7 @@ const ElementTooltip = memo(({ type, elementConfig }) => {
|
|
|
7394
7506
|
const { icon } = options || {};
|
|
7395
7507
|
const attribute = getAttributeByName(attributeName, attributes);
|
|
7396
7508
|
const text = (attribute?.value || elementConfig?.value);
|
|
7397
|
-
return text ? (jsx(Tooltip, { placement: "top", arrow: true, content: text, children: ref => jsx(TooltipIcon, { kind: icon || "question", ref: ref }) })) : null;
|
|
7509
|
+
return text ? (jsx(Tooltip$1, { placement: "top", arrow: true, content: text, children: ref => jsx(TooltipIcon, { kind: icon || "question", ref: ref }) })) : null;
|
|
7398
7510
|
});
|
|
7399
7511
|
|
|
7400
7512
|
const SlideshowHeaderWrapper = styled.div `
|
|
@@ -8021,7 +8133,7 @@ const useBarChartFilter = ({ type, filter, elementConfig }) => {
|
|
|
8021
8133
|
bars.attr("rx", radius).attr("ry", radius);
|
|
8022
8134
|
}, [radius]);
|
|
8023
8135
|
const tooltipY = useMemo(() => (barHeight ? height - barHeight - DEFAULT_BAR_CHART_MARGINS.bottom : undefined), [barHeight, height]);
|
|
8024
|
-
const markers = useMemo(() => getChartMarkers(filterItems, configMarkers), [configMarkers, filterItems]);
|
|
8136
|
+
const markers = useMemo(() => getChartMarkers(filterItems, configMarkers, dataSources), [configMarkers, dataSources, filterItems]);
|
|
8025
8137
|
const hasDefinedColors = useMemo(() => configColors?.length || colorAttribute, [configColors, colorAttribute]);
|
|
8026
8138
|
const marshalledMap = useCallback(items => {
|
|
8027
8139
|
if (hasDefinedColors)
|
|
@@ -8353,7 +8465,7 @@ const getRenderElement = ({ t, config, elementConfig, attributes = [], layerInfo
|
|
|
8353
8465
|
return formatElementValue({ t, value, elementConfig: element, attributes, wrap });
|
|
8354
8466
|
};
|
|
8355
8467
|
|
|
8356
|
-
const getResourceUrl = (url) => url ? (url.startsWith("http") ? url : `/sp/resources/${url}
|
|
8468
|
+
const getResourceUrl = (url) => url ? (url.startsWith("http") ? url : `/sp/resources/file/${url}`) : "";
|
|
8357
8469
|
|
|
8358
8470
|
const getSlideshowImages = ({ element, attribute, }) => {
|
|
8359
8471
|
const { defaultValue, options } = element;
|
|
@@ -8406,7 +8518,7 @@ const pieChartTooltipFromAttributes = (t, data, attributes) => {
|
|
|
8406
8518
|
const pieChartTooltipFromRelatedFeatures = (t, data, relatedAttributes, layerInfo) => {
|
|
8407
8519
|
if (!data?.length)
|
|
8408
8520
|
return "";
|
|
8409
|
-
return (jsx(ThemeProvider, { children: jsxs(ChartTooltip, { children: [jsx(ChartTooltipColor, { "$color": data[0].color }), jsxs("div", { children: [data[0].name, " \u00A0 ", formatChartRelatedValue(t, data[0].value, layerInfo, relatedAttributes)] })] }) }));
|
|
8521
|
+
return (jsx(ThemeProvider, { children: jsxs(ChartTooltip, { alignItems: "center", children: [jsx(ChartTooltipColor, { "$color": data[0].color }), jsxs("div", { children: [data[0].name, " \u00A0 ", formatChartRelatedValue(t, data[0].value, layerInfo, relatedAttributes)] })] }) }));
|
|
8410
8522
|
};
|
|
8411
8523
|
|
|
8412
8524
|
const removeDataSource = (dashboardConfiguration, name, pageIndex) => {
|
|
@@ -8988,21 +9100,22 @@ const StackBar = ({ data, filterName, type, alias, options, renderElement, rende
|
|
|
8988
9100
|
const units = attribute?.stringFormat?.unitsLabel;
|
|
8989
9101
|
const total = useMemo(() => items?.reduce((result, { value }) => result + Number(value), 0) || 0, [items]);
|
|
8990
9102
|
const getWidth = useCallback(value => ((Number(value) / total) * 100).toFixed(2), [total]);
|
|
8991
|
-
const renderGroupTooltip = useMemo(() => (jsx(ThemeProvider, { children: jsx(ChartTooltipTable, { cellPadding: 0, cellSpacing: 0, children: items?.map(({ name, value, color }, index) => (jsxs("tr", { children: [jsx("td", { children: jsxs(ChartTooltip, { children: [jsx(ChartTooltipColor, { "$color": color }), jsx(ChartTooltipName, { children: name })] }) }), jsx("td", { children: value })] }, index))) }) })), [items]);
|
|
9103
|
+
const renderGroupTooltip = useMemo(() => (jsx(ThemeProvider, { children: jsx(ChartTooltipTable, { cellPadding: 0, cellSpacing: 0, children: items?.map(({ name, value, color }, index) => (jsxs("tr", { children: [jsx("td", { children: jsxs(ChartTooltip, { alignItems: "center", children: [jsx(ChartTooltipColor, { "$color": color }), jsx(ChartTooltipName, { children: name })] }) }), jsx("td", { children: value })] }, index))) }) })), [items]);
|
|
8992
9104
|
const renderItem = useCallback(({ name, value, color }, ref) => (jsx(StackBarSection, { ref: ref, "$width": getWidth(value), "$height": height, "$color": color, cornerRadius: cornerRadius, hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: filterName ? () => onFilter(name) : undefined })), [cornerRadius, filterName, getWidth, hasAnyFilter, height, isFiltered, onFilter]);
|
|
8993
|
-
const renderItems = useMemo(() => (jsx(Fragment$1, { children: items?.map((item, index) => (jsx(Fragment, { children: groupTooltip ? (renderItem(item)) : (jsx(ThemeProvider, { children: jsx(Tooltip, { placement: "top", arrow: true, content: renderTooltip([item]), children: ref => renderItem(item, ref) }) })) }, index))) })), [groupTooltip, items, renderItem, renderTooltip]);
|
|
9105
|
+
const renderItems = useMemo(() => (jsx(Fragment$1, { children: items?.map((item, index) => (jsx(Fragment, { children: groupTooltip ? (renderItem(item)) : (jsx(ThemeProvider, { children: jsx(Tooltip$1, { placement: "top", arrow: true, content: renderTooltip([item]), children: ref => renderItem(item, ref) }) })) }, index))) })), [groupTooltip, items, renderItem, renderTooltip]);
|
|
8994
9106
|
if (!total || !attribute)
|
|
8995
9107
|
return null;
|
|
8996
|
-
return (jsxs(Fragment$1, { children: [(alias || showTotal) && (jsxs(StackBarHeader, { children: [jsx(StackBarAlias, { children: renderElement({ id: "alias" }) }), showTotal && (jsxs(StackBarTotal, { children: [jsx(StackBarValue, { children: formatAttributeValue({ t, type: attribute.type, value: total, stringFormat: attribute.stringFormat, noUnits: true }) }), !!units && jsx(StackBarUnits, { children: units })] }))] })), groupTooltip ? (jsx(Tooltip, { placement: "top", arrow: true, content: renderGroupTooltip, children: ref => jsx(StackBarContainer, { ref: ref, children: renderItems }) })) : (jsx(StackBarContainer, { children: renderItems }))] }));
|
|
9108
|
+
return (jsxs(Fragment$1, { children: [(alias || showTotal) && (jsxs(StackBarHeader, { children: [jsx(StackBarAlias, { children: renderElement({ id: "alias" }) }), showTotal && (jsxs(StackBarTotal, { children: [jsx(StackBarValue, { children: formatAttributeValue({ t, type: attribute.type, value: total, stringFormat: attribute.stringFormat, noUnits: true }) }), !!units && jsx(StackBarUnits, { children: units })] }))] })), groupTooltip ? (jsx(Tooltip$1, { placement: "top", arrow: true, content: renderGroupTooltip, children: ref => jsx(StackBarContainer, { ref: ref, children: renderItems }) })) : (jsx(StackBarContainer, { children: renderItems }))] }));
|
|
8997
9109
|
};
|
|
8998
9110
|
|
|
8999
9111
|
const Chart = memo(({ config, element, elementConfig, type, renderElement }) => {
|
|
9000
9112
|
const theme = useTheme();
|
|
9001
9113
|
const { palette } = theme;
|
|
9114
|
+
const primaryColor = palette.primary;
|
|
9002
9115
|
const { t } = useGlobalContext();
|
|
9003
|
-
const { expandedContainers, layerInfos, attributes } = useWidgetContext(type);
|
|
9116
|
+
const { expandedContainers, layerInfos, attributes, dataSources } = useWidgetContext(type);
|
|
9004
9117
|
const { id, options, children } = element || {};
|
|
9005
|
-
const { column, markers: configMarkers, showTotal, expandable, expanded, chartType, relatedDataSources, defaultColor } = options || {};
|
|
9118
|
+
const { column, markers: configMarkers, showLabels, showMarkers, showTotal, totalWord: configTotalWord, totalAttribute, expandable, expanded, chartType, relatedDataSources, defaultColor } = options || {};
|
|
9006
9119
|
const isLineChart = chartType === "line";
|
|
9007
9120
|
const isPieChart = chartType === "pie";
|
|
9008
9121
|
const isStackBar = chartType === "stack";
|
|
@@ -9014,23 +9127,17 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9014
9127
|
const angle = options?.angle || DEFAULT_CHART_ANGLE;
|
|
9015
9128
|
const barWidth = options?.barWidth || DEFAULT_BAR_WIDTH;
|
|
9016
9129
|
const cornerRadius = options?.cornerRadius || 0;
|
|
9017
|
-
const primaryColor = theme.palette.primary;
|
|
9018
9130
|
const relatedAttributes = useMemo(() => relatedDataSources || [], [relatedDataSources]);
|
|
9019
9131
|
const axes = useMemo(() => relatedAttributes.filter(({ chartAxis }) => chartAxis === "y"), [relatedAttributes]);
|
|
9020
9132
|
const filterName = getChartFilterName(relatedDataSources);
|
|
9021
9133
|
const isRelated = !!relatedAttributes?.length;
|
|
9022
9134
|
const { data, loading } = useChartData({ element, type });
|
|
9023
9135
|
const totalWidthFromBarWidth = (data[0]?.items?.length || 0) * (barWidth + padding);
|
|
9024
|
-
const width = options?.width
|
|
9025
|
-
|
|
9026
|
-
? MAX_CHART_WIDTH
|
|
9027
|
-
: options.width
|
|
9028
|
-
: isStackBar
|
|
9136
|
+
const width = options?.width ? options.width :
|
|
9137
|
+
isStackBar
|
|
9029
9138
|
? "100%"
|
|
9030
9139
|
: isBarChart
|
|
9031
|
-
? totalWidthFromBarWidth
|
|
9032
|
-
? MAX_CHART_WIDTH
|
|
9033
|
-
: totalWidthFromBarWidth
|
|
9140
|
+
? totalWidthFromBarWidth || MAX_CHART_WIDTH
|
|
9034
9141
|
: DEFAULT_CHART_WIDTH;
|
|
9035
9142
|
const [customize] = useChartChange({
|
|
9036
9143
|
dataSources: config.dataSources,
|
|
@@ -9039,16 +9146,17 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9039
9146
|
height,
|
|
9040
9147
|
fontColor,
|
|
9041
9148
|
relatedAttributes,
|
|
9042
|
-
defaultColor: primaryColor
|
|
9149
|
+
defaultColor: primaryColor,
|
|
9150
|
+
showMarkers,
|
|
9043
9151
|
});
|
|
9044
9152
|
const { formatFilterColor, onFilter } = useFeatureFilters(type, filterName, data?.[0]?.items);
|
|
9045
9153
|
const formattedAttributes = useMemo(() => getFormattedAttributes(t, (data[0]?.items || []), attributes, element), [attributes, data, element, t]);
|
|
9046
9154
|
const totalSum = useMemo(() => isRelated
|
|
9047
9155
|
? getTotalFromRelatedFeatures((data[0]?.items || []))
|
|
9048
9156
|
: getTotalFromAttributes(children, formattedAttributes), [data, children, formattedAttributes, isRelated]);
|
|
9049
|
-
const totalWord = useMemo(() =>
|
|
9050
|
-
? attributes?.find(({ name }) => name ===
|
|
9051
|
-
:
|
|
9157
|
+
const totalWord = useMemo(() => totalAttribute
|
|
9158
|
+
? attributes?.find(({ name }) => name === totalAttribute)?.value
|
|
9159
|
+
: configTotalWord, [attributes, totalAttribute, configTotalWord]);
|
|
9052
9160
|
const renderPieChartTooltip = useCallback(item => isRelated
|
|
9053
9161
|
? pieChartTooltipFromRelatedFeatures(t, item, relatedAttributes, data[0]?.layerInfo)
|
|
9054
9162
|
: pieChartTooltipFromAttributes(t, item, formattedAttributes), [data, formattedAttributes, isRelated, relatedAttributes]);
|
|
@@ -9059,19 +9167,25 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9059
9167
|
return result?.filter((name, index) => result.indexOf(name) === index);
|
|
9060
9168
|
}, [data, isLineChart]);
|
|
9061
9169
|
const renderLineChartTooltip = useCallback((items, { indexX }) => {
|
|
9062
|
-
return (
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9170
|
+
return (jsxs(Tooltip, { children: [jsx(ChartTooltipLabel, { children: labels[indexX] }), items
|
|
9171
|
+
.filter(({ value }) => !isEmptyValue(value))
|
|
9172
|
+
?.map(({ layerName, attributeName, value, stroke }, index) => {
|
|
9173
|
+
const layerInfo = layerInfos?.find(({ name }) => name === layerName);
|
|
9174
|
+
const attribute = layerInfo?.layerDefinition.attributes[attributeName];
|
|
9175
|
+
return (jsxs(ChartTooltipRow, { children: [jsx(ChartLegendColor$1, { "$color": stroke }), jsx(ChartLegendValue, { children: attribute ? formatAttributeValue({ t, type: attribute.type, value, stringFormat: attribute.stringFormat }) : value })] }, index));
|
|
9176
|
+
})] }));
|
|
9069
9177
|
}, [labels, layerInfos]);
|
|
9070
|
-
const markers = useMemo(() => getChartMarkers(data[0]?.items, configMarkers), [data, configMarkers]);
|
|
9178
|
+
const markers = useMemo(() => getChartMarkers(data[0]?.items, configMarkers, dataSources), [data, dataSources, configMarkers]);
|
|
9071
9179
|
const formatTooltipName = useCallback((name) => (isRelated ? name : tooltipNameFromAttributes(name, formattedAttributes)), [formattedAttributes, isRelated]);
|
|
9072
9180
|
const formatTooltipValue = useCallback((value, name) => isRelated
|
|
9073
9181
|
? tooltipValueFromRelatedFeatures(t, value, relatedAttributes, data[0]?.layerInfo)
|
|
9074
9182
|
: tooltipValueFromAttributes(t, value, name, formattedAttributes), [data, formattedAttributes, isRelated, relatedAttributes]);
|
|
9183
|
+
const customXAxisBottom = useCallback((xAxisBottom, data) => {
|
|
9184
|
+
xAxisBottom.tickFormat((index) => (showMarkers
|
|
9185
|
+
? index % (showMarkers || 1) === 0
|
|
9186
|
+
: index === 0 || index === data.length - 1)
|
|
9187
|
+
? data[index]?.groupName || "" : "");
|
|
9188
|
+
}, [showMarkers]);
|
|
9075
9189
|
const renderChart = useMemo(() => {
|
|
9076
9190
|
if (!element)
|
|
9077
9191
|
return null;
|
|
@@ -9089,16 +9203,16 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9089
9203
|
.flat()
|
|
9090
9204
|
.map(({ values }) => values)
|
|
9091
9205
|
.flat();
|
|
9092
|
-
return (
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9206
|
+
return (jsxs(AnyChartWrapper, { height: height, children: [jsx(LineChartStyles, {}), jsx(LineChart, { data: lineChartData, labels: labels, width: +width, height: height, xAxisPadding: 15, yAxisPadding: 0, min: Math.min(...chartValues), customYAxisSelection: yAxis => {
|
|
9207
|
+
if (isHidedY) {
|
|
9208
|
+
yAxis.remove();
|
|
9209
|
+
}
|
|
9210
|
+
}, customYAxis: yAxis => yAxis.ticks(4), renderTooltip: renderLineChartTooltip, customize: customize, dynamicTooltipEnable: true, stackedTooltip: true, tooltipClassName: "dashboardLineChartTooltip", drawGridX: !isHidedY, margin: {
|
|
9211
|
+
top: 0,
|
|
9212
|
+
right: 0,
|
|
9213
|
+
bottom: 0,
|
|
9214
|
+
left: 0
|
|
9215
|
+
} })] }));
|
|
9102
9216
|
}
|
|
9103
9217
|
if (isStackBar) {
|
|
9104
9218
|
return (jsx(AnyChartWrapper, { height: height, children: jsx(StackBar, { data: data, filterName: filterName, type: type, alias: elementConfig?.children?.find(child => child.id === "alias"), options: options, renderTooltip: renderPieChartTooltip, renderElement: renderElement }) }));
|
|
@@ -9111,17 +9225,20 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9111
9225
|
color: formatFilterColor(item.name, item.color, defaultColor)
|
|
9112
9226
|
})) || []), width: +width, height: +width, padAngle: angle, outerRadius: radius, cornerRadius: cornerRadius, renderTooltip: renderPieChartTooltip, withTooltip: true, onClick: filterName ? item => onFilter(item.name) : undefined, children: showTotal && jsx(PieChartCenter, { children: totalWord || roundTotalSum(+totalSum) }) }) }));
|
|
9113
9227
|
}
|
|
9228
|
+
const barChartData = getDataFromFilterItems(data[0]?.items);
|
|
9229
|
+
const markersMargin = showMarkers ? 10 : 0;
|
|
9114
9230
|
const margin = {
|
|
9115
|
-
top:
|
|
9116
|
-
right:
|
|
9117
|
-
bottom: markers?.length ? 20 :
|
|
9118
|
-
left:
|
|
9231
|
+
top: markersMargin,
|
|
9232
|
+
right: markersMargin,
|
|
9233
|
+
bottom: markers?.length ? 20 : markersMargin,
|
|
9234
|
+
left: markersMargin
|
|
9119
9235
|
};
|
|
9120
|
-
return (jsx(BarChartWrapper, { height: height + margin.bottom, children: jsx(BarChartContainer, { children: jsx(
|
|
9236
|
+
return (jsx(BarChartWrapper, { height: height + margin.bottom, children: jsx(BarChartContainer, { children: jsx(StyledBarChart, { data: barChartData, colors: getColorsFromFilterItems(data[0]?.items, defaultColor, formatFilterColor), minValue: getMinValueFromFilterItems(data[0]?.items), markers: markers, width: +width, height: height, barWidth: barWidth, barPadding: padding, className: "dashboardBarChart", customXAxisBottom: xAxisBottom => customXAxisBottom(xAxisBottom, barChartData), customYAxis: axis => !showLabels && axis.remove(), customBars: ({ bars }) => {
|
|
9121
9237
|
bars.attr("rx", radius);
|
|
9122
9238
|
bars.attr("ry", radius);
|
|
9123
|
-
}, margin: margin, xAxisPadding: 0, yAxisPadding: 0, formatTooltipValue: formatTooltipValue, formatTooltipName: formatTooltipName, onBarClick: filterName ? item => onFilter(item.name) : undefined
|
|
9239
|
+
}, margin: margin, xAxisPadding: 0, yAxisPadding: 0, formatTooltipValue: formatTooltipValue, formatTooltipName: formatTooltipName, hideTooltipGroupName: true, dynamicTooltipEnable: true, isBarTooltip: true, onBarClick: filterName ? item => onFilter(item.name) : undefined }) }) }));
|
|
9124
9240
|
}, [
|
|
9241
|
+
customXAxisBottom,
|
|
9125
9242
|
element,
|
|
9126
9243
|
isLineChart,
|
|
9127
9244
|
isStackBar,
|
|
@@ -9133,6 +9250,8 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9133
9250
|
formatFilterColor,
|
|
9134
9251
|
width,
|
|
9135
9252
|
barWidth,
|
|
9253
|
+
showLabels,
|
|
9254
|
+
showMarkers,
|
|
9136
9255
|
padding,
|
|
9137
9256
|
formatTooltipValue,
|
|
9138
9257
|
formatTooltipName,
|
|
@@ -9169,7 +9288,7 @@ const ChartLegend = ({ data, chartElement, type, twoColumns, loading }) => {
|
|
|
9169
9288
|
const showMoreBtn = !!shownItems && data.length > shownItems;
|
|
9170
9289
|
if (!loading && !data?.length && !!hideEmpty)
|
|
9171
9290
|
return null;
|
|
9172
|
-
return (jsxs(Flex, { opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsx(ChartLegendColor, { color: color }), jsx(ChartLegendName, { "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard" }) }))] }));
|
|
9291
|
+
return (jsxs(Flex, { flexDirection: "column", opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsx(ChartLegendColor, { color: color }), jsx(ChartLegendName, { "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard" }) }))] }));
|
|
9173
9292
|
};
|
|
9174
9293
|
|
|
9175
9294
|
const ContainerChildren = memo(({ items, isColumn, isMain, renderElement }) => {
|
|
@@ -9273,7 +9392,7 @@ const FeatureCardTitle = ({ title, description }) => {
|
|
|
9273
9392
|
})) ||
|
|
9274
9393
|
feature?.id);
|
|
9275
9394
|
}, [attributes, feature?.id, layerDefinition, title, titleAttribute]);
|
|
9276
|
-
return (jsxs(HeaderTitleContainer, { children: [jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) }), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
9395
|
+
return (jsxs(HeaderTitleContainer, { children: [jsx(FeatureTitleContainer, { clickable: true, children: jsx(Tooltip$1, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsx(FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) }), jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
9277
9396
|
};
|
|
9278
9397
|
|
|
9279
9398
|
const HiddenFilters = styled(Flex) `
|
|
@@ -9447,7 +9566,7 @@ const TextTrim = memo(({ maxLength, expandable, lineBreak, children }) => {
|
|
|
9447
9566
|
if (expandable) {
|
|
9448
9567
|
return (jsxs(Fragment$1, { children: [formatValue(expanded ? text : substring), jsx(LegendToggler, { toggled: expanded, onClick: toggleExpanded, children: expanded ? t("hide", { ns: "dashboard" }) : t("more", { ns: "dashboard" }) })] }));
|
|
9449
9568
|
}
|
|
9450
|
-
return (jsx(Tooltip, { placement: "top", arrow: true, content: text, children: ref => jsx("div", { ref: ref, children: formatValue(substring) }) }));
|
|
9569
|
+
return (jsx(Tooltip$1, { placement: "top", arrow: true, content: text, children: ref => jsx("div", { ref: ref, children: formatValue(substring) }) }));
|
|
9451
9570
|
});
|
|
9452
9571
|
|
|
9453
9572
|
const DEFAULT_COLOR = "#00ffff";
|