How to use the @vx/hierarchy.hierarchy function in @vx/hierarchy

To help you get started, we’ve selected a few @vx/hierarchy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hshoff / vx / packages / vx-demo / src / components / tiles / treemap.js View on Github external
height,
      // events = false,
      margin = {
        top: 0,
        left: 30,
        right: 40,
        bottom: 80,
      },
    } = this.props;

    const { tileMethod } = this.state;

    if (width < 10) return null;

    const yMax = height - margin.top - margin.bottom;
    const root = hierarchy(data).sort((a, b) => b.value - a.value);

    return (
      <div>
        <label>tile method</label>{' '}
        <select> e.stopPropagation()}
          onChange={e =&gt; this.setState({ tileMethod: e.target.value })}
          value={tileMethod}
        &gt;
          {Object.keys(tileMethods).map(tile =&gt; (
            <option value="{tile}">
              {tile}
            </option>
          ))}
        </select>
        <div></div></div>

@vx/hierarchy

vx tree

MIT
Latest version published 4 years ago

Package Health Score

75 / 100
Full package analysis

Popular @vx/hierarchy functions