8000 I’m trying to render my graph using a JSON file · clientIO joint · Discussion #2938 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

I’m trying to render my graph using a JSON file #2938

Answered by kumilingus
omoghadasi asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you should listen to add and reset graph events.

    graph.on('add', (cell) => {
      switch (cell.get("type")) {
        case "ControlValve":
          SliderValveControl.add(cell.findView(paper), "root", "slider", {
            name: cell.attr("label/text"),
          });
          break;
        case "HandValve":
          ToggleValveControl.add(cell.findView(paper), "root", "button");
          break;
        case "Pump":
          PumpControl.add(cell.findView(paper), "root", "selection");
          break;
        case "ChartBar":
          ChartController.add(cell.findView(paper), "root", "chartCanvas");
          break;
      }
    });

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@omoghadasi
Comment options

@kumilingus
Comment options

@omoghadasi
Comment options

@kumilingus
Comment options

Answer selected by omoghadasi
@omoghadasi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
0