@evergis/react 2.0.198 → 2.0.200
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/Legend/hooks/useSvgSymbol.d.ts +3 -3
- package/dist/components/Legend/types.d.ts +1 -1
- package/dist/react.cjs.development.js +35 -20
- package/dist/react.cjs.development.js.map +1 -1
- package/dist/react.cjs.production.min.js +1 -1
- package/dist/react.cjs.production.min.js.map +1 -1
- package/dist/react.esm.js +35 -20
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/svg.d.ts +2 -2
- package/package.json +2 -2
package/dist/react.esm.js
CHANGED
|
@@ -3226,6 +3226,7 @@ var SvgSymbolBg;
|
|
|
3226
3226
|
SvgSymbolBg["Circle"] = "circle";
|
|
3227
3227
|
})(SvgSymbolBg || (SvgSymbolBg = {}));
|
|
3228
3228
|
|
|
3229
|
+
const DEFAULT_STROKE_OPACITY = 0.28;
|
|
3229
3230
|
const convertSvgToBase64 = svg => "data:image/svg+xml;base64," + window.btoa(svg);
|
|
3230
3231
|
const createSvgGradient = (svg, values) => svg.gradient('linear', add => {
|
|
3231
3232
|
values == null ? void 0 : values.forEach((_ref, index) => {
|
|
@@ -3244,7 +3245,7 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3244
3245
|
symbol,
|
|
3245
3246
|
svg,
|
|
3246
3247
|
bg,
|
|
3247
|
-
|
|
3248
|
+
isClassified
|
|
3248
3249
|
} = _ref2;
|
|
3249
3250
|
if (!symbol) return SVGContainer;
|
|
3250
3251
|
const symbolData = getParameterValue(svg || symbol.data);
|
|
@@ -3295,9 +3296,9 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3295
3296
|
SVGContainer.find(':not(#symbol-bg)').each(item => item.center(DEFAULT_SYMBOL_WITH_BG_SIZE / 2, DEFAULT_SYMBOL_WITH_BG_SIZE / 2).fill('white'));
|
|
3296
3297
|
const symbolBg = SVGContainer.find('#symbol-bg')[0];
|
|
3297
3298
|
|
|
3298
|
-
if (
|
|
3299
|
+
if (isClassified) {
|
|
3299
3300
|
symbolBg == null ? void 0 : symbolBg.stroke({
|
|
3300
|
-
opacity:
|
|
3301
|
+
opacity: DEFAULT_STROKE_OPACITY
|
|
3301
3302
|
});
|
|
3302
3303
|
} // eslint-disable-next-line max-depth
|
|
3303
3304
|
|
|
@@ -3305,15 +3306,15 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3305
3306
|
if (isParameterByAttribute(background == null ? void 0 : background.fillColor)) {
|
|
3306
3307
|
var _background$fillColor;
|
|
3307
3308
|
|
|
3308
|
-
|
|
3309
|
-
|
|
3309
|
+
symbolBg == null ? void 0 : symbolBg.fill(createSvgGradient(SVGContainer, background == null ? void 0 : (_background$fillColor = background.fillColor) == null ? void 0 : _background$fillColor.values));
|
|
3310
|
+
}
|
|
3310
3311
|
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
}
|
|
3312
|
+
if (isParameterByAttribute(background == null ? void 0 : background.strokeColor)) {
|
|
3313
|
+
var _background$strokeCol;
|
|
3314
|
+
|
|
3315
|
+
symbolBg == null ? void 0 : symbolBg.stroke({
|
|
3316
|
+
color: createSvgGradient(SVGContainer, background == null ? void 0 : (_background$strokeCol = background.strokeColor) == null ? void 0 : _background$strokeCol.values)
|
|
3317
|
+
});
|
|
3317
3318
|
}
|
|
3318
3319
|
} else {
|
|
3319
3320
|
SVGContainer.svg(innerSvg);
|
|
@@ -3329,6 +3330,20 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3329
3330
|
color: strokeColor,
|
|
3330
3331
|
width: strokeWidth
|
|
3331
3332
|
});
|
|
3333
|
+
|
|
3334
|
+
if (isParameterByAttribute(figure == null ? void 0 : figure.fillColor)) {
|
|
3335
|
+
var _figure$fillColor;
|
|
3336
|
+
|
|
3337
|
+
item == null ? void 0 : item.fill(createSvgGradient(SVGContainer, figure == null ? void 0 : (_figure$fillColor = figure.fillColor) == null ? void 0 : _figure$fillColor.values));
|
|
3338
|
+
}
|
|
3339
|
+
|
|
3340
|
+
if (isParameterByAttribute(figure == null ? void 0 : figure.strokeColor)) {
|
|
3341
|
+
var _figure$strokeColor;
|
|
3342
|
+
|
|
3343
|
+
item == null ? void 0 : item.stroke({
|
|
3344
|
+
color: createSvgGradient(SVGContainer, figure == null ? void 0 : (_figure$strokeColor = figure.strokeColor) == null ? void 0 : _figure$strokeColor.values)
|
|
3345
|
+
});
|
|
3346
|
+
}
|
|
3332
3347
|
});
|
|
3333
3348
|
}
|
|
3334
3349
|
}
|
|
@@ -6033,7 +6048,7 @@ const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject
|
|
|
6033
6048
|
const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject37 || (_templateObject37 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-top: 0.1rem;\n font-size: 0.625rem;\n color: #1fb3aa;\n"])));
|
|
6034
6049
|
const ClusterLegendContainer = /*#__PURE__*/styled.div(_templateObject38 || (_templateObject38 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: -0.9rem;\n transform: scale(0.5);\n"])));
|
|
6035
6050
|
|
|
6036
|
-
const useSvgSymbol = (symbol, skipOffset,
|
|
6051
|
+
const useSvgSymbol = (symbol, skipOffset, isClassified) => {
|
|
6037
6052
|
const SVGWrapperRefElement = useRef(null);
|
|
6038
6053
|
const SVGContainer = useMemo(() => SVG(), []);
|
|
6039
6054
|
const initSvg = useCallback(() => {
|
|
@@ -6045,14 +6060,14 @@ const useSvgSymbol = (symbol, skipOffset, isClassifiedValue) => {
|
|
|
6045
6060
|
svg,
|
|
6046
6061
|
bg,
|
|
6047
6062
|
newSymbol,
|
|
6048
|
-
|
|
6063
|
+
isClassified
|
|
6049
6064
|
} = _ref;
|
|
6050
6065
|
manipulateSvgSymbol({
|
|
6051
6066
|
SVGContainer,
|
|
6052
6067
|
symbol: newSymbol || symbol,
|
|
6053
6068
|
svg,
|
|
6054
6069
|
bg,
|
|
6055
|
-
|
|
6070
|
+
isClassified
|
|
6056
6071
|
});
|
|
6057
6072
|
}, [SVGContainer, symbol]);
|
|
6058
6073
|
const getUpdatedSvgSymbol = useCallback((field, value) => {
|
|
@@ -6093,7 +6108,7 @@ const useSvgSymbol = (symbol, skipOffset, isClassifiedValue) => {
|
|
|
6093
6108
|
svg: getParameterValue(data),
|
|
6094
6109
|
newSymbol,
|
|
6095
6110
|
bg: (_newSymbol$background = newSymbol.background) == null ? void 0 : _newSymbol$background.type,
|
|
6096
|
-
|
|
6111
|
+
isClassified
|
|
6097
6112
|
});
|
|
6098
6113
|
return _extends({}, newSymbol, {
|
|
6099
6114
|
data: SVGContainer.svg()
|
|
@@ -6150,7 +6165,7 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6150
6165
|
text,
|
|
6151
6166
|
fontSettings,
|
|
6152
6167
|
skipOffset,
|
|
6153
|
-
|
|
6168
|
+
isClassified,
|
|
6154
6169
|
onClick
|
|
6155
6170
|
} = _ref7;
|
|
6156
6171
|
const {
|
|
@@ -6158,7 +6173,7 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6158
6173
|
initSvg,
|
|
6159
6174
|
getSvgData,
|
|
6160
6175
|
manipulateSvg
|
|
6161
|
-
} = useSvgSymbol(symbol, skipOffset,
|
|
6176
|
+
} = useSvgSymbol(symbol, skipOffset, isClassified);
|
|
6162
6177
|
const onSelectSymbol = useCallback(() => {
|
|
6163
6178
|
onClick == null ? void 0 : onClick(getSvgData(), _extends({}, symbol, bg ? {
|
|
6164
6179
|
background: _extends({}, symbol.background, {
|
|
@@ -6179,9 +6194,9 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6179
6194
|
svg,
|
|
6180
6195
|
bg,
|
|
6181
6196
|
newSymbol: symbol,
|
|
6182
|
-
|
|
6197
|
+
isClassified
|
|
6183
6198
|
});
|
|
6184
|
-
}, [svg, symbol, bg, manipulateSvg,
|
|
6199
|
+
}, [svg, symbol, bg, manipulateSvg, isClassified]);
|
|
6185
6200
|
return text ? React.createElement(SvgSymbolContainer, null, renderSymbol, React.createElement(SvgSymbolLabel, {
|
|
6186
6201
|
fontSettings: fontSettings
|
|
6187
6202
|
}, text), !!(fontSettings != null && fontSettings.haloColor) && !!(fontSettings != null && fontSettings.haloWidth) && React.createElement(SvgSymbolLabel, {
|
|
@@ -6221,7 +6236,7 @@ const ClusterSymbolPreview = _ref => {
|
|
|
6221
6236
|
return React.createElement(SvgSymbol, {
|
|
6222
6237
|
svg: DEFAULT_CLUSTER_SVG,
|
|
6223
6238
|
symbol: svgSymbol,
|
|
6224
|
-
|
|
6239
|
+
isClassified: isClassified,
|
|
6225
6240
|
text: '99',
|
|
6226
6241
|
fontSettings: _extends({}, symbol.labelSymbol, {
|
|
6227
6242
|
fontSize: fontSize || ((_symbol$labelSymbol = symbol.labelSymbol) == null ? void 0 : _symbol$labelSymbol.fontSize)
|