0.0.4 • Published 1 month ago

svelte-zoomable-circles v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

svelte-zoomable-circles

A Svelte.js component for displaying and browsing hierarchical data using zoomable circles

Built with Svelte and D3.js

demo

demo

Live demo: openopensource.com

usage

<script>
	import ZoomableCircles from "svelte-zoomable-circles";
</script>

<ZoomableCircles tree={treeObject} />

The tree object must be a JSON object in the following format:

export const sampleTree = {
  name: "Root",
  children: [
    {
      name: "Child 1",
      children: [
        {
          name: "Child 1.1",
          value: 1000
        },
        {
          name: "Child 1.2",
          value: 500
        },
        {
          name: "Child 1.3",
          value: 250
        },
      ]
    },
    {
      name: "Child2",
      value: 800
    },
    {
      name: "Child3",
      value: 600
    },
  ]
}

props

PropTypeDefaultDescription
treeobjectsampleTreeComponent data
svgHeightnumber300Container height
svgWidthnumber300Container width
startColorstring (hex code)#555Start color for node color gradient
endColorstring (hex code)#cccEnd color for node gradient
textFillColorstring (hex code)#000Color of node labels
circleHoverStrokeColorstring (hex code)#000Color of circle outline on hover
circleHoverStrokeWidthnumber3Width of circle outline on hover in px
textFontSizenumber25Size of label font in px
paddingnumber100Transition duration (ms)
zoomDurationMsnumber500Enables autoplay of pages

authors

0.0.4

1 month ago

0.0.3

1 month ago

0.0.2

1 month ago

0.0.1

1 month ago