chiasm-project / chiasm

A browser based environment for interactive data visualizations.
MIT License
184 stars 24 forks source link

Chiasm as WebComponent #55

Open curran opened 9 years ago

curran commented 9 years ago

This code should work one day:

<chiasm>
  {
    "layout": {
      "plugin": "layout",
      "state": {
        "containerSelector": "#chiasm-container",
        "layout": {
          "orientation": "vertical",
          "children": [
            "A", {
              "orientation": "horizontal",
              "children": [
                "B", {
                  "orientation": "vertical",
                  "children": [ "C", "D" ]
                },
                "E"
              ]
            }
          ]
        }
      }
    },
    "A": { "plugin": "coloredRectangle" },
    "B": {
      "plugin": "coloredRectangle",
      "state": { "color": "#a8f0ff" }
    },
    "C": {
      "plugin": "coloredRectangle",
      "state": { "color": "#ffe2a8" }
    },
    "D": {
      "plugin": "coloredRectangle",
      "state": { "color": "#99e2c8" }
    },
    "E": {
      "plugin": "coloredRectangle",
      "state": { "color": "#a8ffd0" }
    }
  }
</chiasm>

Using one of