@politicalwatch/tipi-uikit 1.7.17 → 1.7.18
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/package.json
CHANGED
|
@@ -255,17 +255,16 @@ class d3sunburst extends d3chart {
|
|
|
255
255
|
.append('path')
|
|
256
256
|
.attr('class', 'chart__slice chart__slice--sunburst')
|
|
257
257
|
.style('fill', (d) => this.colorElement(d.data))
|
|
258
|
-
.on('mouseover', (d) => {
|
|
258
|
+
.on('mouseover', (event, d) => {
|
|
259
|
+
console.log('event', event);
|
|
260
|
+
console.log('d', d);
|
|
259
261
|
const label = this.cfg.tooltip.suffixPlural
|
|
260
|
-
? pluralize(this.cfg.tooltip.suffix, d.
|
|
262
|
+
? pluralize(this.cfg.tooltip.suffix, d.value)
|
|
261
263
|
: this.cfg.tooltip.suffix;
|
|
262
264
|
const text = this.cfg.tooltip.suffix
|
|
263
|
-
? `<div>${d.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
: `<div>${d.target.__data__.data[this.cfg.key]}: ${d.target.__data__.data.value}</div>`;
|
|
267
|
-
// TODO fix values in tooltip for parent elements
|
|
268
|
-
if (d.target.__data__.data.value) this.tooltip.html(text).classed('active', true);
|
|
265
|
+
? `<div>${d.data[this.cfg.key]}: ${d.value} ${label}</div>`
|
|
266
|
+
: `<div>${d.data[this.cfg.key]}: ${d.value}</div>`;
|
|
267
|
+
this.tooltip.html(text).classed('active', true);
|
|
269
268
|
})
|
|
270
269
|
.on('mouseout', () => {
|
|
271
270
|
this.tooltip.classed('active', false);
|
|
@@ -257,13 +257,15 @@ class d3wordscloud extends d3chart {
|
|
|
257
257
|
.attr('text-anchor', 'middle')
|
|
258
258
|
.attr('fill', (d) => d.color)
|
|
259
259
|
.attr('transform', (d) => `translate(${[d.x, d.y]})rotate(${d.rotate})`)
|
|
260
|
-
.on('mouseover', (d) => {
|
|
260
|
+
.on('mouseover', (event, d) => {
|
|
261
|
+
console.log('d', d);
|
|
262
|
+
console.log('event', event);
|
|
261
263
|
const label = this.cfg.tooltip.suffixPlural
|
|
262
|
-
? pluralize(this.cfg.tooltip.suffix, d.
|
|
264
|
+
? pluralize(this.cfg.tooltip.suffix, d.value)
|
|
263
265
|
: this.cfg.tooltip.suffix;
|
|
264
266
|
const text = this.cfg.tooltip.suffix
|
|
265
|
-
? `<div>${d.
|
|
266
|
-
: `<div>${d.
|
|
267
|
+
? `<div>${d.text}: ${d.value} ${label}</div>`
|
|
268
|
+
: `<div>${d.text}: ${d.value}</div>`;
|
|
267
269
|
this.tooltip.html(text).classed('active', true);
|
|
268
270
|
})
|
|
269
271
|
.on('mouseout', () => {
|