Hello everyone. This is a simple calculator that allows you to evaluate the location of blocks on the dashboard. After specifying the structure of the dashboard and the sizes of some blocks, the calculator will calculate the position of all blocks and their sizes. This calculator allows you to easily place blocks by coordinates. All dimensions are in pixels.
Example
User Guide
The main dashboard_calculator function is in the defs_calculator. The Size_notebook contains a small example of how the function works.
You need to specify the size of the dashboard.
You also need to specify the structure of the dashboard. The db_hor_sizes parameter specifies the number of blocks on each line and their width.
If you specify 'Auto' instead of size for blocks, the calculator will automatically calculate their sizes depending on the remaining width. That is, if there are 500 pixels left (in width) and 'Auto' was specified for two blocks, then the system will create two blocks of 250 pixels each. The red arrows mark the width that was calculated automatically, and the orange arrows indicate the width that was originally set.
It is not necessary to specify the height of each block, instead db_ver_sizes sets the height for all blocks in the line.
These four parameters are required to specify. The result is a picture with the desired coordinates and dimensions.
Additional Options
● global_borders - size of borders between blocks (type - int, default - 8);
● img_name_and_format - path, image name and type (type - st, default - '');
● save - should the image be saved? (type - str, default - 'No');
● show - should the image be showed? (type - str, default - 'Yes');
● font - text font (default - ImageFont.truetype("arial.ttf", size=30));
● background_color - background color (type - str, default - '#E5E5E5');
● block_color - block_color (type - str, default - 'white');
● text_color - text color (type - str, default - '#484848');
● outer_padding - outer padding of text (type - int, default - 4);
● text_pos_correction - this setting needs to be adjusted if the default font has been changed (type - int, default - 35).