All Projects → vasturiano → treemap-chart

vasturiano / treemap-chart

Licence: MIT License
A treemap interactive chart web component for visualizing hierarchical data

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to treemap-chart

D3 In Motion
Code examples and references for the course "D3.js in Motion"
Stars: ✭ 37 (+37.04%)
Mutual labels:  chart, d3js
Sunburst Chart
A sunburst interactive chart web component for visualizing hierarchical data
Stars: ✭ 140 (+418.52%)
Mutual labels:  chart, d3js
Ss Vis Component
VIS components for a security system, to monitor the state and confirm the system's health running.
Stars: ✭ 88 (+225.93%)
Mutual labels:  chart, d3js
Ngx Charts
📊 Declarative Charting Framework for Angular
Stars: ✭ 4,057 (+14925.93%)
Mutual labels:  chart, d3js
icicle-chart
A partition / icicle interactive chart web component for visualizing hierarchical data
Stars: ✭ 27 (+0%)
Mutual labels:  hierarchical-data, d3js
D3fc
A collection of components that make it easy to build interactive charts with D3
Stars: ✭ 898 (+3225.93%)
Mutual labels:  chart, d3js
Webpack Bundle Analyzer
Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Stars: ✭ 11,472 (+42388.89%)
Mutual labels:  chart, treemap
D3 Timeline
A simple D3 Timeline chart
Stars: ✭ 743 (+2651.85%)
Mutual labels:  chart, d3js
Reaviz
📊 Data visualization library for React based on D3
Stars: ✭ 215 (+696.3%)
Mutual labels:  chart, d3js
V Chart Plugin
Easily bind a chart to the data stored in your Vue.js components.
Stars: ✭ 188 (+596.3%)
Mutual labels:  chart, d3js
webtrees-pedigree-chart
SVG based pedigree chart module for webtrees genealogy application.
Stars: ✭ 24 (-11.11%)
Mutual labels:  chart, d3js
d3-gridding
grids for rapid D3 charts mockups
Stars: ✭ 100 (+270.37%)
Mutual labels:  treemap, d3js
Just Dashboard
📊 📋 Dashboards using YAML or JSON files
Stars: ✭ 1,511 (+5496.3%)
Mutual labels:  chart, d3js
D3 Layout Narrative
A d3 layout for creating XKCD style narrative charts
Stars: ✭ 168 (+522.22%)
Mutual labels:  chart, d3js
Simple-charts
Simple responsive charts
Stars: ✭ 15 (-44.44%)
Mutual labels:  chart, d3js
d3-kagi
An open source javascript library to render beautiful Kagi charts using D3.js and pure Javascript
Stars: ✭ 26 (-3.7%)
Mutual labels:  chart, d3js
helm-charts
Helm Charts
Stars: ✭ 24 (-11.11%)
Mutual labels:  chart
align covid
Coronavirus time series aligned by number of cases, not date.
Stars: ✭ 22 (-18.52%)
Mutual labels:  d3js
FancyCandles
An open source candlestick chart control for WPF.
Stars: ✭ 60 (+122.22%)
Mutual labels:  chart
ZingChart-Demos
A collection of tutorials and demos for using ZingChart. Clone, fork, and get started with the best Javascript charting library.
Stars: ✭ 18 (-33.33%)
Mutual labels:  chart

treemap-chart

NPM package Build Size NPM Downloads

An interactive treemap chart for visualizing proportions in hierarchical data, where nodes of a tree are represented as nested fully-packed rectangular tiles.

Supports zooming interactions via mouse-wheel events or by clicking on a node, which focuses the viewport on the associated sub-tree. The chart also responds to data changes by animating the dimensions of each of the nodes into their new positions.

For improved performance, nodes with area (width*height) smaller than a given threshold (minBlockArea) are excluded from the DOM, allowing for representation of large data sets while maintaining a smooth interaction. See here for an example of a randomly generated large data structure.

See also the Circle Pack, Icicle and Sunburst charts.

Quick start

import Treemap from 'treemap-chart';

or

const Treemap = require('treemap-chart');

or even

<script src="//unpkg.com/treemap-chart"></script>

then

const myChart = Treemap();
myChart
  .data(<myData>)
  (<myDOMElement>);

API reference

Method Description Default
data([object]) Getter/setter for chart data (see below for syntax details).
width([number]) Getter/setter for the chart width in px. <window width>
height([number]) Getter/setter for the chart height in px. <window height>
children([string or fn]) Getter/setter for a data node's children accessor, used to establish the hierarchical relationship between nodes. Supports either a string indicating the object's property name, or a function(node) which should return an array of nodes. children
label([string or fn]) Getter/setter for a node object label accessor, used to display labels on the blocks and their tooltips. name
size([string or fn]) Getter/setter for a node object size accessor, used to compute the areas of the blocks. value
padding([number]) Getter/setter for the amount of padding between adjacent blocks, in px. 2.5
color([string or fn]) Getter/setter for a node object color accessor, used to color the blocks. grey
nodeClassName([string or fn]) Getter/setter for a node object classname accessor. Determines the CSS class(es) to apply to each block node.
minBlockArea([number]) Getter/setter for the minimum area of a block (in square px) required for it to be rendered in the DOM. 100
excludeRoot([boolean]) Getter/setter for whether to exclude the root node from the representation. false
sort([fn]) Getter/setter for the compare method used to sort sibling blocks. A value of null (default) maintains the existing order found in the input data structure. This method is equivalent to d3-hierarchy's sort, it receives two arguments representing two sibling nodes and expects a numeric return value (-1, 0 or 1) indicating the order. Each element is an instance of d3-hierarchy node and has several useful properties to specify order: data (the corresponding data object), value (summed value of node and all its descendants) and depth (layer degree). For example, to order blocks by size, use: (a, b) => b.value - a.value. <existing order>
showLabels([boolean]) Getter/setter for whether to show labels in the nodes. Regardless of this setting, labels too large to fit within a block's width are automatically hidden. true
showTooltip([fn]) Getter/setter to specify a node object tooltip's visibility. If this function returns false for a particular node, that node's tooltip will not display at all. If unspecified, all nodes' tooltips will display. () => true
tooltipTitle([fn]) Getter/setter for a node object tooltip title. The function should return a string to be displayed in bold in the first line of the tooltip. If unspecified, the full hierarchical name will be displayed.
tooltipContent([fn]) Getter/setter for a node object tooltip content. Use this to specify extra content in each of the block's tooltips in addition to the title set in tooltipTitle.
zoomToNode([node]) Programmatically zoom the chart to a particular node.
zoomBy([number]) Programmatically zoom the chart by a specific amount. 1 is unity, above one indicates a zoom-in and below a zoom-out.
zoomReset() Programmatically reset the zoom to the global view.
onHover([fn]) Callback function for mouse hover events. Includes the data node object (or null if hovering on background) as single argument.
onClick([fn]) Callback function for click events. Includes the data node object (or null if clicking on the background) as single argument. A falsy value (default) automatically zooms on clicked nodes, equivalent to myChart.onClick(myChart.zoomToNode).
transitionDuration([number]) Getter/setter for the animation duration of transitions between states (opening, zoom in/out) in milliseconds. Enter 0 to disable animations. 800

Data syntax

{
  name: "root",
  children: [
    {
      name: "leafA",
      value: 3
    },
    {
      name: "nodeB",
      children: [
        {
          name: "leafBA",
          value: 5
        },
        {
          name: "leafBB",
          value: 1
        }
      ]
    }
  ]
}

Giving Back

paypal If this project has helped you and you'd like to contribute back, you can always buy me a !

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].