@politicalwatch/tipi-uikit 1.7.11 → 1.7.12

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@politicalwatch/tipi-uikit",
3
- "version": "1.7.11",
3
+ "version": "1.7.12",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -406,15 +406,16 @@ class d3barchart extends d3chart {
406
406
  .attr('height', 0)
407
407
  .attr('width', 0)
408
408
  .on('mouseover', (d, i) => {
409
+ console.log('cfg in barchart', this.cfg);
409
410
  console.log('MOUSEOVER in barchart', d);
410
411
  const key = this.cfg.values[i % this.cfg.values.length];
411
412
  const label = this.cfg.tooltip.suffixPlural
412
- ? pluralize(this.cfg.tooltip.suffix, d.target.__data__[key])
413
+ ? pluralize(this.cfg.tooltip.suffix, d[key])
413
414
  : this.cfg.tooltip.suffix;
414
415
 
415
416
  const labelKey = this.cfg.keys[key];
416
417
 
417
- const percentage = this.calculatePercentage(d.target.__data__[key], totals[key]).toFixed(2);
418
+ const percentage = this.calculatePercentage(d[key], totals[key]).toFixed(2);
418
419
 
419
420
  const text = this.cfg.tooltip.suffix
420
421
  ? `<div>${labelKey}: ${percentage}% ${label}</div>`
@@ -256,8 +256,9 @@ class d3sunburst extends d3chart {
256
256
  .attr('class', 'chart__slice chart__slice--sunburst')
257
257
  .style('fill', (d) => this.colorElement(d.data))
258
258
  .on('mouseover', (d) => {
259
+ console.log('MOUSEOVER in sunburst', d);
259
260
  const label = this.cfg.tooltip.suffixPlural
260
- ? pluralize(this.cfg.tooltip.suffix, d.value)
261
+ ? pluralize(this.cfg.tooltip.suffix, d.target.__data__.data.value)
261
262
  : this.cfg.tooltip.suffix;
262
263
  const text = this.cfg.tooltip.suffix
263
264
  ? `<div>${d.target.__data__.data[this.cfg.key]}: ${d.target.__data__.data.value} ${label}</div>`
@@ -258,7 +258,6 @@ class d3wordscloud extends d3chart {
258
258
  .attr('fill', (d) => d.color)
259
259
  .attr('transform', (d) => `translate(${[d.x, d.y]})rotate(${d.rotate})`)
260
260
  .on('mouseover', (d) => {
261
- console.log('MOUSEOVER in wordscoud', d);
262
261
  const label = this.cfg.tooltip.suffixPlural
263
262
  ? pluralize(this.cfg.tooltip.suffix, d.target.__data__.value)
264
263
  : this.cfg.tooltip.suffix;