How to use d3-state-visualizer - 10 common examples

To help you get started, we’ve selected a few d3-state-visualizer 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 zhw2590582 / chrome-extension-vuexTree / chrome / js / devtools_panel.js View on Github external
port.postMessage({tabId: chrome.devtools.inspectedWindow.tabId});

// 生成状态树
const config = {
  state: {},
  id: 'vuexTree',
  size: window.innerWidth - 20,
  aspectRatio: 0.5,
  isSorted: false,
  widthBetweenNodesCoeff: 1.5,
  heightBetweenNodesCoeff: 2,
  tooltipOptions: { offset: { left: 30, top: 10 }, indentationSize: 2 },
  transitionDuration: 700
}

const render = tree(document.getElementById('app'), config);

let stateOld = {};
port.onMessage.addListener(function(message, sender, sendResponse) {
  if(!message && JSON.stringify(stateOld) === '{}') return;
  if(JSON.stringify(message) === JSON.stringify(stateOld)) return;
  removeElement(document.getElementById('notFound'));
  stateOld = message;
  render(message);
});
github romseguy / react2tree / examples / visualizer / index.js View on Github external
import React from 'react';
import d3 from 'd3';
import App from './components/App';
import react2tree from 'react2tree';
import { tree } from 'd3-state-visualizer';

const hierarchy = React.render(, document.createElement('div'));

const initialize = tree();

const render = initialize(d3, document.getElementById('root'), {
  tree: react2tree(hierarchy),
  heightBetweenNodesCoeff: 1.5
});

render();
github zalmoxisus / remotedev-app / src / app / containers / monitors / InspectorWrapper / ChartTab.js View on Github external
componentDidMount() {
    this.renderChart = tree(
      this.node,
      { ...defaultOptions, onClickText: this.onClickText }
    );
    this.renderChart(this.props.data);
  }
github reduxjs / redux-devtools / packages / redux-devtools-core / src / app / containers / monitors / InspectorWrapper / ChartTab.js View on Github external
createChart(props) {
    this.renderChart = tree(this.node, this.getChartTheme(props.theme));
    this.renderChart(props.data);
  }
github reduxjs / redux-devtools-chart-monitor / src / Chart.js View on Github external
componentDidMount() {
    const { select, state, defaultIsVisible } = this.props;
    this.renderChart = tree(findDOMNode(this), this.props);
    if (defaultIsVisible) {
      this.renderChart(select(state));
    }
  }
github reduxjs / d3-state-visualizer / examples / tree / index.js View on Github external
{ title: 'visualizer' },
      { title: 'tree' }
    ],
    completedCount: 1,
    alphabeticalOrder: true
  },
  someStore: {
    someProperty: 0,
    someObject: {
      anotherProperty: 'value',
      someArray: [0, 1, 2]
    }
  }
};

const render = tree(document.getElementById('root'), {
  state: appState,
  id: 'treeExample',
  size: 1000,
  aspectRatio: 0.5,
  isSorted: false,
  widthBetweenNodesCoeff: 1.5,
  heightBetweenNodesCoeff: 2,
  style: {border: '1px solid black'},
  tooltipOptions: {offset: {left: 30, top: 10}, indentationSize: 2}
});

render();
github rbrahul / Awesome-JSON-Viewer / src / ChartView.js View on Github external
left: 50,
                    top: 10
                },
                indentationSize: 2,
                style: {
                    background: '#222',
                    padding: '8px',
                    color: '#4FDEE5',
                    'border-radius': '2px',
                    'box-shadow': '0 7px 7px 0 #111',
                    'font-size': '13px',
                    'line-height': '1.3'
                }
            }
        };
        this.renderChart = tree(findDOMNode(this), config);
        this.renderChart();
    }
github reduxjs / d3-state-visualizer / examples / graph / index.js View on Github external
import { forceGraph } from 'd3-state-visualizer';
import d3 from 'd3';

const appState = {
  foo: ['1', '2', '3'],
  bar: 3,
  baz: { some: 'value' },
  todo: ['a', 'b']
};

const nodes = Object.keys(appState).map(key => ({
  key,
  [key]: appState[key]
}));

const initialize = forceGraph();

const render = initialize(d3, document.getElementById('root'), {
  data: nodes,
  id: 'forceGraphExample',
  size: 1000,
  aspectRatio: 1,
  charge: -50,
  linkDistance: 50,
  maxNodeSize: 50
});

render();
github reduxjs / d3-state-visualizer / examples / react-graph / index.js View on Github external
import { forceGraph } from 'd3-state-visualizer';
import Chart from './components/Chart';

const appState = {
  foo: ['1', '2', '3'],
  bar: 3,
  baz: { some: 'value' },
  todo: ['a', 'b']
};

const nodes = Object.keys(appState).map(key => ({
  key,
  [key]: appState[key]
}));

const initialize = forceGraph();

React.render(
  
  , document.getElementById('root')
);
github reduxjs / d3-state-visualizer / examples / react-tree / components / Chart.js View on Github external
componentDidMount() {
    this.renderChart = tree(React.findDOMNode(this), this.props);
    this.renderChart();
  }

d3-state-visualizer

Visualize your app state with a range of reusable charts

MIT
Latest version published 7 months ago

Package Health Score

83 / 100
Full package analysis