|
1 |
<?php
|
|
2 |
|
|
3 |
declare(strict_types=1);
|
|
4 |
|
|
5 |
namespace Gambio\Admin\Modules\Statistics\App\Overview\Model\Entities\WidgetDefinition;
|
|
6 |
|
|
7 |
use Gambio\Admin\Modules\Statistics\App\Data\Factory as DataFactory;
|
|
8 |
use Gambio\Admin\Modules\Statistics\App\Overview\Factory as OverviewFactory;
|
|
9 |
use Gambio\Admin\Modules\Statistics\App\Overview\Model\Collections\Options;
|
|
10 |
use Gambio\Admin\Modules\Statistics\Model\ValueObjects\Data;
|
|
11 |
use Gambio\Core\Application\ValueObjects\UserPreferences;
|
|
12 |
|
|
13 |
class GambioTestRadialWidget extends GambioWidgetDefinition
|
|
14 |
{
|
|
15 |
private const TYPE = 'gambio.test.radial.widget';
|
|
16 |
|
|
17 |
private const VERSION = '0.1.0';
|
|
18 |
|
|
19 |
private const ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAACoCAYAAAAGoZArAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAF5pJREFUeJzt3XuUHNV9J/Dv73dvVVfPTM/7pZFGDyRkyICBlbHANsqIh2QhI8lAy4uIYkLM+HWIgxezCbajxutkvcnx2qzWwXacZRPbHCzFXggYbIKxIIiHMMaICCwhGSSE5v2e6e7prrp3/5AFSGikefRMdc/8PufUH5o5VffXNepf3XcBQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQoi8l0gkOJFIcNhxiNOjsAMQM9fdd//SyzpdtxDZ1SCygH2oTOPOjRs3ZsKOTZycDjsAMXNlI52fIUsbAAIsANC1/RlKAvhWyKGJUUg1TkwZa3BFEAROEAROYIw21iqwvSzsuMTopIYgcsjS3OUr51Kgl7AJanv7+mtcN1J+7LdEsCMj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
|
|
21 |
private const WIDGET_TITLE = [
|
|
22 |
self::LANGUAGE_CODE_GERMAN => 'Radial',
|
|
23 |
self::LANGUAGE_CODE_ENGLISH => 'Radial'
|
|
24 |
];
|
|
25 |
/**
|
|
26 |
* @var DataFactory
|
|
27 |
*/
|
|
28 |
private $dataFactory;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* @var UserPreferences
|
|
32 |
*/
|
|
33 |
private $userPreferences;
|
|
34 |
|
|
35 |
|
|
36 |
/**
|
|
37 |
* GambioTestRadialWidget constructor.
|
|
38 |
*
|
|
39 |
* @param OverviewFactory $overviewFactory
|
|
40 |
* @param DataFactory $dataFactory
|
|
41 |
* @param UserPreferences $userPreferences
|
|
42 |
*/
|
|
43 |
public function __construct(
|
|
44 |
OverviewFactory $overviewFactory,
|
|
45 |
DataFactory $dataFactory,
|
|
46 |
UserPreferences $userPreferences
|
|
47 |
) {
|
|
48 |
$this->dataFactory = $dataFactory;
|
|
49 |
$this->userPreferences = $userPreferences;
|
|
50 |
|
|
51 |
parent::__construct($overviewFactory->createType(self::TYPE),
|
|
52 |
$overviewFactory->createVersion(self::VERSION),
|
|
53 |
$overviewFactory->createIconUsingData(self::ICON),
|
|
54 |
$overviewFactory->useVisualizations()->createRadialBarChart(),
|
|
55 |
$overviewFactory->useOptions()->createOptions($overviewFactory->useOptions()
|
|
56 |
->usePredefined()
|
|
57 |
->createTimespanDropdownIncludingToday($overviewFactory)),
|
|
58 |
$overviewFactory->createTitles($overviewFactory->createTitle($overviewFactory->createLanguageCode(self::LANGUAGE_CODE_GERMAN),
|
|
59 |
self::WIDGET_TITLE[self::LANGUAGE_CODE_GERMAN]),
|
|
60 |
$overviewFactory->createTitle($overviewFactory->createLanguageCode(self::LANGUAGE_CODE_ENGLISH),
|
|
61 |
self::WIDGET_TITLE[self::LANGUAGE_CODE_ENGLISH])));
|
|
62 |
}
|
|
63 |
|
|
64 |
|
|
65 |
/**
|
|
66 |
* @inheritDoc
|
|
67 |
*/
|
|
68 |
public function data(Options $options): Data
|
|
69 |
{
|
|
70 |
return $this->dataFactory->useNumberData()->createNumberData($this->dataFactory->useNumberData()->createValue(44));
|
|
71 |
}
|
|
72 |
}
|