@gravity-ui/charts 1.42.2 → 1.42.3
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.
|
@@ -148,6 +148,7 @@ export const Legend = (props) => {
|
|
|
148
148
|
const svgElement = select(ref.current);
|
|
149
149
|
svgElement.selectAll('*').remove();
|
|
150
150
|
svgElement.style('opacity', 0);
|
|
151
|
+
const isMac = navigator.platform.toUpperCase().includes('MAC');
|
|
151
152
|
const htmlElement = select(htmlLayout);
|
|
152
153
|
htmlElement.selectAll('[data-legend]').remove();
|
|
153
154
|
const htmlContainer = legend.html
|
|
@@ -173,7 +174,11 @@ export const Legend = (props) => {
|
|
|
173
174
|
.append('g')
|
|
174
175
|
.attr('class', b('item'))
|
|
175
176
|
.on('click', function (e, d) {
|
|
176
|
-
onItemClick({
|
|
177
|
+
onItemClick({
|
|
178
|
+
id: d.id,
|
|
179
|
+
name: d.name,
|
|
180
|
+
metaKey: isMac ? e.metaKey : e.ctrlKey,
|
|
181
|
+
});
|
|
177
182
|
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate();
|
|
178
183
|
});
|
|
179
184
|
const getXPosition = (i) => {
|
|
@@ -212,7 +217,11 @@ export const Legend = (props) => {
|
|
|
212
217
|
return '0px';
|
|
213
218
|
})
|
|
214
219
|
.on('click', function (e, d) {
|
|
215
|
-
onItemClick({
|
|
220
|
+
onItemClick({
|
|
221
|
+
id: d.id,
|
|
222
|
+
name: d.name,
|
|
223
|
+
metaKey: isMac ? e.metaKey : e.ctrlKey,
|
|
224
|
+
});
|
|
216
225
|
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate();
|
|
217
226
|
})
|
|
218
227
|
.html((d) => d.text);
|
|
@@ -15,5 +15,5 @@ export function Row(props) {
|
|
|
15
15
|
return (React.createElement("tr", { className: b('content-row', { active, striped }, className), style: style },
|
|
16
16
|
colorItem && React.createElement("td", { className: b('content-row-color-cell') }, colorItem),
|
|
17
17
|
React.createElement("td", { className: b('content-row-label-cell') }, label),
|
|
18
|
-
value && React.createElement("td", { className: b('content-row-value-cell') }, value)));
|
|
18
|
+
value && (React.createElement("td", { className: b('content-row-value-cell') }, typeof value === 'string' ? (React.createElement("span", { dangerouslySetInnerHTML: { __html: value } })) : (value)))));
|
|
19
19
|
}
|
|
@@ -148,6 +148,7 @@ export const Legend = (props) => {
|
|
|
148
148
|
const svgElement = select(ref.current);
|
|
149
149
|
svgElement.selectAll('*').remove();
|
|
150
150
|
svgElement.style('opacity', 0);
|
|
151
|
+
const isMac = navigator.platform.toUpperCase().includes('MAC');
|
|
151
152
|
const htmlElement = select(htmlLayout);
|
|
152
153
|
htmlElement.selectAll('[data-legend]').remove();
|
|
153
154
|
const htmlContainer = legend.html
|
|
@@ -173,7 +174,11 @@ export const Legend = (props) => {
|
|
|
173
174
|
.append('g')
|
|
174
175
|
.attr('class', b('item'))
|
|
175
176
|
.on('click', function (e, d) {
|
|
176
|
-
onItemClick({
|
|
177
|
+
onItemClick({
|
|
178
|
+
id: d.id,
|
|
179
|
+
name: d.name,
|
|
180
|
+
metaKey: isMac ? e.metaKey : e.ctrlKey,
|
|
181
|
+
});
|
|
177
182
|
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate();
|
|
178
183
|
});
|
|
179
184
|
const getXPosition = (i) => {
|
|
@@ -212,7 +217,11 @@ export const Legend = (props) => {
|
|
|
212
217
|
return '0px';
|
|
213
218
|
})
|
|
214
219
|
.on('click', function (e, d) {
|
|
215
|
-
onItemClick({
|
|
220
|
+
onItemClick({
|
|
221
|
+
id: d.id,
|
|
222
|
+
name: d.name,
|
|
223
|
+
metaKey: isMac ? e.metaKey : e.ctrlKey,
|
|
224
|
+
});
|
|
216
225
|
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate();
|
|
217
226
|
})
|
|
218
227
|
.html((d) => d.text);
|
|
@@ -15,5 +15,5 @@ export function Row(props) {
|
|
|
15
15
|
return (React.createElement("tr", { className: b('content-row', { active, striped }, className), style: style },
|
|
16
16
|
colorItem && React.createElement("td", { className: b('content-row-color-cell') }, colorItem),
|
|
17
17
|
React.createElement("td", { className: b('content-row-label-cell') }, label),
|
|
18
|
-
value && React.createElement("td", { className: b('content-row-value-cell') }, value)));
|
|
18
|
+
value && (React.createElement("td", { className: b('content-row-value-cell') }, typeof value === 'string' ? (React.createElement("span", { dangerouslySetInnerHTML: { __html: value } })) : (value)))));
|
|
19
19
|
}
|