diff --git a/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud.test.js.snap b/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud.test.js.snap index e32425a095429..88ed7c66a79a2 100644 --- a/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud.test.js.snap +++ b/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud.test.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`tag cloud tests tagcloudscreenshot should render simple image 1`] = `"foobarfoobar"`; +exports[`tag cloud tests tagcloudscreenshot should render simple image 1`] = `"foobarfoobar"`; diff --git a/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap b/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap index dbc3dd1202cbd..d7707f64d8a4f 100644 --- a/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap +++ b/src/plugins/vis_type_tagcloud/public/components/__snapshots__/tag_cloud_visualization.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`TagCloudVisualizationTest TagCloudVisualization - basics simple draw 1`] = `"CNINUSDEBR"`; +exports[`TagCloudVisualizationTest TagCloudVisualization - basics simple draw 1`] = `"CNINUSDEBR"`; -exports[`TagCloudVisualizationTest TagCloudVisualization - basics with param change 1`] = `"CNINUSDEBR"`; +exports[`TagCloudVisualizationTest TagCloudVisualization - basics with param change 1`] = `"CNINUSDEBR"`; -exports[`TagCloudVisualizationTest TagCloudVisualization - basics with resize 1`] = `"CNINUSDEBR"`; +exports[`TagCloudVisualizationTest TagCloudVisualization - basics with resize 1`] = `"CNINUSDEBR"`; diff --git a/src/plugins/vis_type_tagcloud/public/components/tag_cloud.js b/src/plugins/vis_type_tagcloud/public/components/tag_cloud.js index e48515d243844..b1de60f854a1c 100644 --- a/src/plugins/vis_type_tagcloud/public/components/tag_cloud.js +++ b/src/plugins/vis_type_tagcloud/public/components/tag_cloud.js @@ -48,7 +48,11 @@ export class TagCloud extends EventEmitter { this.resize(); //SETTING (non-configurable) - this._fontFamily = 'Open Sans, sans-serif'; + /** + * the fontFamily should be set explicitly for calculating a layout + * and to avoid words overlapping + */ + this._fontFamily = 'Inter UI, sans-serif'; this._fontStyle = 'normal'; this._fontWeight = 'normal'; this._spiral = 'archimedean'; //layout shape diff --git a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_chart.tsx b/src/plugins/vis_type_tagcloud/public/components/tag_cloud_chart.tsx index 18a09ec9f4969..cb0daa6d29382 100644 --- a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_chart.tsx +++ b/src/plugins/vis_type_tagcloud/public/components/tag_cloud_chart.tsx @@ -62,10 +62,10 @@ export const TagCloudChart = ({ () => throttle(() => { if (visController.current) { - visController.current.render().then(renderComplete); + visController.current.render(visData, visParams).then(renderComplete); } }, 300), - [renderComplete] + [renderComplete, visData, visParams] ); return ( diff --git a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.js b/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.js index 5ec22d2c6a4d9..0d64c9d02eafd 100644 --- a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.js +++ b/src/plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.js @@ -85,11 +85,8 @@ export class TagCloudVisualization { } async render(data, visParams) { - if (data && visParams) { - this._updateParams(visParams); - this._updateData(data); - } - + this._updateParams(visParams); + this._updateData(data); this._resize(); await this._renderComplete$.pipe(take(1)).toPromise();