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

Add support for switching between widgets #24

Closed
juhamust opened this issue Feb 17, 2015 · 5 comments
Closed

Add support for switching between widgets #24

juhamust opened this issue Feb 17, 2015 · 5 comments

Comments

@juhamust
Copy link
Contributor

While switching between dashboards is nice, sometimes one wants to switch only certain widgets (while keeping the others). Thus, Mozaik should support defining multiple widgets per region.

Ideally it would be as easy as:

{
  type: ['github.user_badge', 'heroku.app_info'],
  user: 'plouc',
  app: 'mozaik',
  columns: 1, rows: 1,
  x: 0, y: 0
}

As for the widget params, both should be defined. Naturally this can be challenging with conflicting names, but it could use same array approach:

{
  type: ['weather.weather', 'weather.weather'],
  city: ['Tokyo', 'London'],
  country: ['JP', 'EN'],
  lang: 'en',
  limit: 2,
  columns: 1, rows: 1,
  x: 0, y: 1
}

I've implemented similar feature in Dashing, but I'm not yet that familiar with Flux and/or Mozaik so that I could create a PR at this point.

@plouc
Copy link
Owner

plouc commented Feb 17, 2015

I've thought of a similar feature, (with a nice flipping effect, it could be nice), but while the second approach is feasible, the first one isn't because of the different requirements for each widgets, another option:

{
  type: 'widget.switcher',
  switchTime: 2000,
  widgets: [
    {
      type: 'weather.weather',
      //…
    },
    {
      type: 'time.clock',
      //…
    }
  ]
}

@juhamust
Copy link
Contributor Author

Yes, a special widget type could be an option, too :) With my first example I thought that: "all the parameters are passed to both widgets, it does not matter whether they needed them or not".

But additional challenge with my proposal comes if parameter value happens to be an array. Thus, I prefer your proposal.

@juhamust
Copy link
Contributor Author

juhamust commented Oct 1, 2016

With multiple widgets, this feature comes more and more wanted. Thus, here is my initial version for it: https://github.com/juhamust/mozaik-ext-switcher

However, it has some problem with data loading, as sometimes (most of the time) the data is not loaded properly. Care to share some consultancy, @plouc, what might be the issue ?

@juhamust
Copy link
Contributor Author

Never mind, I figured out by myself: juhamust/mozaik-ext-switch@81e3a64#diff-3654cc213698058980abcf63f19994a0R40

@juhamust
Copy link
Contributor Author

Described behavior can be achieved with mozaik-ext-switch

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

2 participants