question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More flexible widgets grid (allow finer control over height/width)

See original GitHub issue

User should be able to control widget’s placement, width and height

Current implementation

Currently editing a dashboard works as follow:

  1. When adding a widget you select its width: regular (half width) or double (full width). Height is set based on the content.
  2. When opening the “Edit Dashboard” dialog, you can rearrange the order of the widgets.

Edit Dashboard Dialog

Issues with the current approach:

  • You can’t change widget size after placing it.
  • You can’t change widget’s height.
  • You can’t control widget’s width beyond the current two options.

Solution

To solve this we want to have a flexible (but still responsive) grid that the user can freely place and move widgets on.

  • Each visualization will define minimum width and height sizes (derived from the visualization type). This will be the default sizes for the widget when placed on the grid, but the user will be able to resize it to be larger (but not smaller) afterwards.
  • Once entering dashboard “edit mode”, the user will be able to move around and resize the widgets in place instead of a dedicated UI.
  • We should probably change other behaviors in the UI (move add widget to be part of the edit mode, change dashboard title editing to be in place, etc), but we will leave it to second iteration after the grid behavior is implemented.

Technical Notes

  • We currently use angular-gridster to allow moving around the widgets in the Edit Dashboard dialog. Maybe we can use it for the grid or a similar library.
  • Currently the widget knows nothing about its placement, but only its size (width). The dashboard has a layout property, which is an array of arrays of widgets ids (each item in the array is a row/array of widgets). This is error prone and makes layout changes harder. If possible, it will be better if each widget retains its own placement information.
  • The API to update a widget currently supports only updating a textbox widget. We will need to extend it to support all widget types.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
pdfforgecommented, Nov 22, 2016

This is open for some time now, any plans on implementing this? We would love it!

3reactions
arikfrcommented, Oct 1, 2017

As this feature is going to be implemented soon, I’ve updated the details. Feel free to comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set Custom height for Widget in GridView in Flutter?
@xskxzr I have to show grid in 1:1 (width:height) ratio but height should have additional 100 pixels extra. eg. How can i do?...
Read more >
Layout - Foundations - Human Interface Guidelines - Design
Inset full-width buttons. Respect the standard system-defined margins on the sides of full-width buttons. A full-width button at the bottom of the screen ......
Read more >
A Complete Guide to Flexbox | CSS-Tricks
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible ...
Read more >
Setting 100% height and resize on container resize for grid ...
Keep in mind that if the grid is nested inside containers, at least one of them should have fixed height dimension in pixels....
Read more >
App widgets overview - Android Developers
Resizing allows users to adjust the height and/or the width of a widget within the constraints of the home screen placement grid.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found