SeregPie / VueWordCloud

Generates a cloud out of the words.
https://seregpie.github.io/VueWordCloud/
MIT License
386 stars 60 forks source link

VueWordCloud takes a lot of time to render #47

Closed Bended closed 4 years ago

Bended commented 5 years ago

It takes around 50s to render 8 words in the cloud. Do you have any idea why it takes so long to render? (edit) Seems that the props ':spacing' has a big impact on the rendering above 6. Have you ever noticed this? Any idea to improve it ?
I am adding below the url of a loom video to view the long rendering: https://www.loom.com/share/5841bab4e452411c860692767c35f77c in addition i add here the code that i use to activate:

<VueWordCloud
          :words="wordsCloud"
          font-family="'Nunito Sans', Roboto, 'Helvetica Neue'"
          :spacing= "10"
          class="word-cloud-container"
          @update:progress="updateProgress"
        >
          <template
            slot-scope="{text, weight}"
          >
            <div
              :title="weight"
              style="cursor: pointer;"
              class="word-cloud-word"
              :class="[text.replace(' ', '-'), chosenWords.includes(text) ? 'chosen' : '']"
              @click="onWordClick(text.replace(' ', '-'))"
            >
              {{ text }}
            </div>
          </template>
        </VueWordCloud>

Thank you

FerrariMartini commented 4 years ago

Hey @Bended, How did you fix the render dealy out?

@SeregPie

Bended commented 4 years ago

Hey @Bended, How did you fix the render dealy out?

@SeregPie

Hey @FerrariMartini @SeregPie , I've just reduced the spacing. Probably takes more time to position words if to much space between words .