Last active
December 28, 2021 04:59
-
-
Save russelllim22/30059a2db8526e0b0dfdd40083a68a00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{#each letterCounts as d, i} | |
<!-- code for bars and labels here --> | |
<g width = {xScale(d.count)} height = {yScale.bandwidth()} | |
style="transform: translate({xScale(d.count)/2}px,{yScale(d.letter) + yScale.bandwidth()/2}px); text-anchor: middle"> | |
{#if d.words.length > 0} | |
{#each d.words as word} | |
<text x={word.x} y={word.y} style="transform: translate({word.x}, {word.y}); | |
font-size: {word.size}px; | |
fill: {cat10colors[Math.floor(Math.random()*10)]}"> | |
{word.text} | |
</text> | |
{/each} | |
{/if} | |
</g> | |
{/each} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment