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

Allow multiple modules to be laid out on a page #4

Open
ramnathv opened this issue Feb 17, 2019 · 1 comment
Open

Allow multiple modules to be laid out on a page #4

ramnathv opened this issue Feb 17, 2019 · 1 comment

Comments

@ramnathv
Copy link
Contributor

ramnathv commented Feb 17, 2019

In many situations, a page consists of standalone submodules that are assembled as a combination of tabs and rows. This can be made easier by extending the API of satin.

- text: Item 1
   menu:
     - text: Sub Item 1
       module:
          tabs:
          - text: Tab 1
            module:
             tab1:
               id: tab1
          - text: Tab 2
            module: tab2

In this case module_tabs is a satin module that accepts a list of modules and turns them into tabs on a page. module_rows would turn a list of modules into rows. The advantage of this approach is consistency and the ability for users to define custom higher-level modules to aggregate submodules.

It does introduce an extra layer of nesting which might be annoying, but I think consistency scores higher than the annoyance introduced by a little nesting.

@ramnathv
Copy link
Contributor Author

ramnathv commented Feb 17, 2019

The alternative is to support a flatter API.

- text: Engagement
  rows:
    - module:
        panel_metric:
          id: product_engagement_active_users
          plot_type: line
    - module:
        panel_metric:
          id: product_engagement_time_spent
          plot_type: line
        
        
- text: Engagement
  tabs:
    - text: Active Users
      module: 
        panel_metric:
          id: product_engagement_active_users
          plot_type: line
    - text: Time Spent
      module:
        panel_metric:
          id: product_engagement_time_spent
          plot_type: line

This reduces the extent of nesting and also makes the intent clear that the modules are to be laid out as tabs (or rows). I need to think about how it might reduce flexibility in comparison to the approach outlined previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant