How to use 3d-force-graph - 7 common examples

To help you get started, we’ve selected a few 3d-force-graph 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 artyomtrityak / d3-explorer / static / javascript / components / 3d-charts / force-3d-camera.js View on Github external
componentDidMount() {
    this.graph = ForceGraph3D()(this.chartRef)
      .width(this.chartRef.clientWidth - 100)
      .height(window.innerHeight - 200)
      .forceEngine("ngraph")
      .backgroundColor("#FFFFFF")
      .nodeAutoColorBy("group")
      .graphData(this.state.data);

    this.startOrbit();
  }
github artyomtrityak / d3-explorer / static / javascript / components / 3d-charts / force-3d-three-object.js View on Github external
componentDidMount() {
    const canvas = document.createElement("canvas");
    const ctx = canvas.getContext("2d");

    this.graph = ForceGraph3D()(this.chartRef)
      .width(this.chartRef.clientWidth - 100)
      .height(window.innerHeight - 200)
      .backgroundColor("#FFFFFF")
      .nodeAutoColorBy("type")
      .linkWidth(2)
      .nodeThreeObject(node => {
        if (node.type === "application") {
          var geometry = new THREE.DodecahedronGeometry(10);

          var diffuseColor = new THREE.Color(0x5e9ccb);
          var material = new THREE.MeshPhysicalMaterial({
            color: diffuseColor,
            metalness: 0,
            roughness: 0.5,
            clearCoat: 1.0,
            clearCoatRoughness: 1.0,
github artyomtrityak / d3-explorer / static / javascript / components / 3d-charts / force-3d-d3.js View on Github external
componentDidMount() {
    this.graph = ForceGraph3D()(this.chartRef)
      .width(this.chartRef.clientWidth - 100)
      .height(window.innerHeight - 200)
      .backgroundColor("#FFFFFF")
      .nodeColor(d => {
        switch (d.type) {
          case "application":
            return "blue";
          case "environment":
            return "yellow";
          case "microservice":
            return "purple";
          case "K8Container":
            return "green";
          case "K8Pod":
            return "red";
          case "K8Cluster":
github artyomtrityak / d3-explorer / static / javascript / components / 3d-charts / force-3d-ng.js View on Github external
componentDidMount() {
    this.graph = ForceGraph3D()(this.chartRef)
      .width(this.chartRef.clientWidth - 100)
      .height(window.innerHeight - 200)
      .backgroundColor("#FFFFFF")
      .forceEngine("ngraph")
      .nodeColor(d => {
        switch (d.type) {
          case "application":
            return "blue";
          case "environment":
            return "yellow";
          case "microservice":
            return "purple";
          case "K8Container":
            return "green";
          case "K8Pod":
            return "red";
github hkparker / Wave / frontend / src / components / Visualization.vue View on Github external
data: function() {
      return {
        devicesByMAC: new Map(),
        associationsByKey: new Map(),
        isAssociated: new Map(),
        devices: [],
        associations: [],
        onlyShowAssociated: false,
        graph: ForceGraph3D(),
        displayDetails: false,
        selectedNodeMAC: "",
        selectedNodeVendor: "",
        selectedNodeProbedFor: "",
      }
    },
    methods: {
github artyomtrityak / d3-explorer / static / javascript / components / 3d-charts / force-3d-node-geometries.js View on Github external
componentDidMount() {
    this.graph = ForceGraph3D()(this.chartRef)
      .width(this.chartRef.clientWidth - 100)
      .height(window.innerHeight - 200)
      .backgroundColor("#FFFFFF")
      .nodeAutoColorBy("group")
      .linkWidth(2)
      .linkColor((d, d2) => {
        return d.source < 10 ? "#FF0000" : "#000000";
      })
      .nodeThreeObject(
        ({ id }) =>
          new THREE.Mesh(
            [
              new THREE.BoxGeometry(
                Math.random() * 20,
                Math.random() * 20,
                Math.random() * 20
github artyomtrityak / d3-explorer / static / javascript / components / 3d-charts / force-3d-1.js View on Github external
componentDidMount() {
    this.graph = ForceGraph3D()(this.chartRef)
      .width(this.chartRef.clientWidth - 100)
      .height(window.innerHeight - 200)
      .backgroundColor("#FFFFFF")
      .nodeAutoColorBy("group")
      .linkWidth(3)
      .linkColor((d, d2) => {
        return d.source < 20 ? "#FF0000" : "#000000";
      })
      .graphData(this.state.data);
  }

3d-force-graph

UI component for a 3D force-directed graph using ThreeJS and d3-force-3d layout engine

MIT
Latest version published 22 days ago

Package Health Score

76 / 100
Full package analysis

Popular 3d-force-graph functions