Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-d3-cloud

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-d3-cloud

svelte wrapper for d3-cloud

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

svelte-d3-cloud

Svelte wrapper for d3-cloud. See Demo

Installation

npm install svelte-d3-cloud

or

yarn add svelte-d3-cloud

Usage


<script>
import WordCloud from "svelte-d3-cloud";

const words = [
    { text: "Halo", count: 100 },
    { text: "Dunia", count: 50 },
    { text: "Gaib", count: 75 },
  ];

</script>

<div>
  <WordCloud words={words}/>
</div>

Props

PropertyDescriptionDefault Value
wordsArray of object contains text and count value [{text : "some", count: 10},...]undefined
widthSet the word cloud canvas width500
heightSet the word cloud canvas height500
backgroundColorSet the canvas background color'#fff'
fontSet the word font family'Impact'
paddingSet the padding of each text10
schemeSet the word cloud text color scheme based on d3-scale-chromatic (schemeCategory10 , schemeAccent, schemeDark2, schemePaired, schemePastel1, schemePastel2, schemeSet1, schemeSet2, schemeSet3, schemeTableau10)'schemeTableau10'
minRotateSet the minimum rotation of the text0
maxRotateSet the maximum rotation of the text0
maxFontSizeSet the maximum font size of the text50

Events

EventDescription
on:clickListen to event when word is clicked
on:mouseoverListen to event when word is hovered
on:mouseoutListen to event when mouse leave the word
on:mousemoveListen to event when mouse move inside the word

Keywords

FAQs

Package last updated on 16 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc