jasondavies / d3-cloud

Create word clouds in JavaScript.
https://www.jasondavies.com/wordcloud/
Other
3.82k stars 1.08k forks source link

Words with hashtags (#) at the beginning are overlapping #190

Closed Harpush closed 2 months ago

Harpush commented 2 months ago

With words having ltr ot rtl language with hashtag (#) at the beginning the words sometimes overlap

jasondavies commented 2 months ago

Can you provide a reproducible example?

Harpush commented 2 months ago

Can you provide a reproducible example?

@jasondavies Hey here is an example (hashtags English and Arabic mixed words): https://codepen.io/Harpush/pen/QWRmaZR

jasondavies commented 2 months ago

Works fine for me in Chrome 126.0.6478.115 (macOS 14.5).

Screenshot 2024-06-21 at 11 34 53
Harpush commented 2 months ago

@jasondavies That's weird... Here is mine: image On chrome Version 125.0.6422.142 (Official Build) (64-bit) Windows 10

Harpush commented 2 months ago

Interesting this seems to look much better at chrome 126: image Although not everyone moved to the new chrome :(

jasondavies commented 2 months ago

Looks like your example is also using an old version of d3-cloud (1.2.5). Maybe try 1.2.7 as it includes a workaround for a known issue with RTL text measurement and alignment in Chrome.

jasondavies commented 2 months ago

I checked on Chrome 125 on Windows 10 and reproduced the issue with d3-cloud@1.2.5, but it's fixed by d3-cloud@1.2.7.

Harpush commented 2 months ago

@jasondavies I will try and see if I can reproduce with 1.2.7 as I am pretty sure the problematic project is updated to 1.2.7. if I can reproduce I will open a new issue