Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure panels and data layers as arrays in the layout #68

Closed
Frencil opened this issue Jun 16, 2016 · 1 comment
Closed

Structure panels and data layers as arrays in the layout #68

Frencil opened this issue Jun 16, 2016 · 1 comment

Comments

@Frencil
Copy link
Contributor

Frencil commented Jun 16, 2016

As described by @jonathonl, the current convention for defining lists of primary objects in the layout (panels and data layers) is confusing:

var layout = {
  ...
  panels: {
    panel_1_id: {
      ...
      data_layers: {
        data_layer_1_id: {
          ...
        }
      }
    },
    panel_2_id: {
      ...
    }
  }
};

The problem here is that panel and data layer IDs are expressed as keys in a map, a space generally reserved for supported/documented attribute names, not user-defined values. A more intuitive approach would make the id value a named parameter and use arrays, like so:

var layout = {
  ...
  panels: [
    {
      id: "panel_1_id",
      data_layers: [
        {
          id: "data_layer_1_id",
          ...
        }
      ]
    },
    {
      id: "panel_2_id",
      ...
    }
  ]
};

While this is a pretty significant breaking change it makes the layout much more internally consistent.

@Frencil
Copy link
Contributor Author

Frencil commented Jul 5, 2016

Resolved in v0.4.0

@Frencil Frencil closed this as completed Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant