AmoebeLabs / swiss-army-knife-card

The versatile custom Swiss Army Knife card for Home Assistant allows you to create your unique visualization using several graphical tools, styling options and animations.
237 stars 21 forks source link

Migrate existing widgets per type to separate classes #2

Closed AmoebeLabs closed 3 years ago

AmoebeLabs commented 4 years ago

The Problem To Be Solved

Currently all widgets are maintained in separate lists per type. This takes a lot of code to maintain. Furthermore, as the widgets are drawn per type, it is not easy to force a certain drawing order to make sure that some objects are layed out on top of other objects.

Using assemblies to group tools makes this possible. For this, the existing widgets must be changed to classes.

The following widgets (tools) should be migrated to classes:

(Optional): Suggested Solution

Create base class and separate classes per type of tool that can be displayed on the screen. Each class takes care of its own initialization, configuration, updates and rendering.

Events must be forwarded to these tool objects.

AmoebeLabs commented 4 years ago

EllipseTool added

AmoebeLabs commented 4 years ago

Segmented Arc migrated

AmoebeLabs commented 4 years ago

Horse Shoe added

AmoebeLabs commented 3 years ago

UserSvg added for images. Should do it for now 😄