rclement / datasette-dashboards

Datasette plugin providing data dashboards from metadata
https://datasette-dashboards-demo.vercel.app
Apache License 2.0
137 stars 7 forks source link

Allow dashboards to enter fullscreen #77

Closed rclement closed 1 year ago

rclement commented 1 year ago

It would be nice for the dashboards to be allowed to toggle a fullscreen mode at the click of a button.

Here is a snippet to toggle fullscreen mode:

<button
  onclick="document.fullscreenElement
    ? document.exitFullscreen()
    : document.body.requestFullscreen()
  "
>
  Toggle Fullscreen
</button>

Instead of document.body it is more advisable to select a sub-section of the page to be made fullscreen: for instance, it could be only the central dashboarding part (title, description, filters, chart grid) without header nor footer.

rclement commented 1 year ago

Also the background color is lost when entering fullscreen and must be specified using the following selectors:

:fullscreen, ::backdrop {
  background-color: #F8FAFB;
}
rclement commented 1 year ago

It would be useful to introduce a global dashboard setting configuration, such as:

dashboards:
  my-dashboard:
    settings:
      allow_fullscreen: true