Skip to content

Add new FlowElement: ImageWidget#31

Merged
alnitak merged 8 commits intoalnitak:devfrom
easyhour:image_widget
Sep 4, 2024
Merged

Add new FlowElement: ImageWidget#31
alnitak merged 8 commits intoalnitak:devfrom
easyhour:image_widget

Conversation

@mauriziopinotti
Copy link
Copy Markdown

Description

The ImageWidget takes an ImageProvider as parameter and renders as an image. The size of the element, if not specified, is automatically set to the image size.

Screenshot from 2024-08-29 12-15-36

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

The ImageWidget takes an ImageProvider as parameter and renders as an
image. The size of the element, if not specified, is automatically set
to the image size.
Two changes to improve resizing of ImageWidget:
- give users a better feedback with a gray background behind the image,
- fit the image using BoxFit.contain so that it doesn't stretch
@mauriziopinotti mauriziopinotti marked this pull request as draft August 30, 2024 16:46
@mauriziopinotti
Copy link
Copy Markdown
Author

Converting to draft as Image widget is missing save/load implementation.

@SL-Pirate
Copy link
Copy Markdown
Collaborator

Converting to draft as Image widget is missing save/load implementation.

Suggestion: you could convert the image to base64 to save/load 😄

- refactor loadDashboard to split file read and data parsing
- add loadDashboardData to create dashboard from json content
- add Web support in the example to load and save dashboards
@mauriziopinotti mauriziopinotti marked this pull request as ready for review September 1, 2024 07:56
@mauriziopinotti mauriziopinotti marked this pull request as draft September 1, 2024 15:36
Add a new parameter backgroundImage to add a background image to the
dashboard. The image moves and zooms along with the grid.
Old UniqueKey causes all elements to be re-drawn from scratch each time.
With a ValueKey tied to the element id elements are not redrawn.
This is particularily visible with the ImageWidget since its rendering
is not istantaneous and the user notices the continuous loading.
@mauriziopinotti mauriziopinotti marked this pull request as ready for review September 2, 2024 15:33
@mauriziopinotti mauriziopinotti marked this pull request as draft September 2, 2024 15:36
@mauriziopinotti mauriziopinotti marked this pull request as ready for review September 3, 2024 13:22
@alnitak alnitak changed the base branch from main to dev September 4, 2024 10:26
@alnitak alnitak merged commit 8d86c5c into alnitak:dev Sep 4, 2024
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

Successfully merging this pull request may close these issues.

3 participants