layrz-sdk 3.1.11__tar.gz → 3.1.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of layrz-sdk might be problematic. Click here for more details.
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/CHANGELOG.md +4 -0
- {layrz_sdk-3.1.11/layrz_sdk.egg-info → layrz_sdk-3.1.12}/PKG-INFO +1 -1
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/asset.py +6 -6
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/case.py +4 -3
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/bar_chart.py +7 -7
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/chart_color.py +2 -2
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/column_chart.py +8 -8
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/html_chart.py +3 -3
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/line_chart.py +7 -7
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/map_chart.py +9 -9
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/number_chart.py +3 -3
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/pie_chart.py +7 -7
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/radar_chart.py +5 -5
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/radial_bar_chart.py +4 -4
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/scatter_chart.py +7 -7
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/scatter_serie.py +1 -3
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/table_chart.py +6 -6
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/timeline_chart.py +5 -5
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/timeline_serie.py +1 -3
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/checkpoint.py +1 -2
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/custom_report_page.py +1 -1
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/message.py +2 -2
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report.py +6 -6
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report_page.py +2 -4
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report_row.py +2 -2
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/helpers/__init__.py +1 -4
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/helpers/color.py +2 -2
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/lcl/__init__.py +1 -3
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/lcl/core.py +59 -59
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12/layrz_sdk.egg-info}/PKG-INFO +1 -1
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/pyproject.toml +1 -1
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/uv.lock +1 -1
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/.github/workflows/checks.yml +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/.github/workflows/deploy.yml +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/.gitignore +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/.vscode/extensions.json +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/.vscode/settings.json +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/CODE_OF_CONDUCT.md +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/CONTRIBUTING.md +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/LICENSE +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/README.md +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/__init__.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/constants.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/__init__.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/asset_operation_mode.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/broadcast_request.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/broadcast_response.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/broadcast_result.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/broadcast_status.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/case_ignored_status.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/case_status.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/axis_config.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/chart_alignment.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/chart_configuration.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/chart_data_serie.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/chart_data_serie_type.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/chart_data_type.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/chart_render_technology.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/map_center_type.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/map_point.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/scatter_serie_item.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/table_header.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/table_row.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/charts/timeline_serie_item.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/comment.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/custom_field.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/device.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/event.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/geofence.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/last_message.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/outbound_service.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/position.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/presence_type.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report_col.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report_configuration.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report_data_type.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report_format.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/report_header.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/sensor.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/text_alignment.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/trigger.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/user.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/entities/waypoint.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk/py.typed +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk.egg-info/SOURCES.txt +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk.egg-info/dependency_links.txt +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk.egg-info/requires.txt +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/layrz_sdk.egg-info/top_level.txt +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/manual_deploy.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/setup.cfg +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/tests/__init__.py +0 -0
- {layrz_sdk-3.1.11 → layrz_sdk-3.1.12}/tests/test_lcl.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: layrz-sdk
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.12
|
|
4
4
|
Summary: Layrz SDK for Python
|
|
5
5
|
Author-email: "Golden M, Inc." <software@goldenm.com>
|
|
6
6
|
Maintainer-email: Kenny Mochizuki <kenny@goldenm.com>, Luis Reyes <lreyes@goldenm.com>, Kasen Li <kli@goldenm.com>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Asset Entity"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field, model_validator
|
|
7
7
|
|
|
@@ -28,15 +28,15 @@ class Asset(BaseModel):
|
|
|
28
28
|
plate: Optional[str] = Field(default=None, description='Defines the plate number of the asset')
|
|
29
29
|
asset_type: Optional[int] = Field(description='Defines the type of the asset', alias='kind_id', default=None)
|
|
30
30
|
operation_mode: AssetOperationMode = Field(description='Defines the operation mode of the asset')
|
|
31
|
-
sensors:
|
|
32
|
-
custom_fields:
|
|
31
|
+
sensors: list[Sensor] = Field(default_factory=list, description='Defines the list of sensors of the asset')
|
|
32
|
+
custom_fields: list[CustomField] = Field(
|
|
33
33
|
default_factory=list, description='Defines the list of custom fields of the asset'
|
|
34
34
|
)
|
|
35
|
-
devices:
|
|
36
|
-
children:
|
|
35
|
+
devices: list[Device] = Field(default_factory=list, description='Defines the list of devices of the asset')
|
|
36
|
+
children: list[Self] = Field(default_factory=list, description='Defines the list of children of the asset')
|
|
37
37
|
|
|
38
38
|
@model_validator(mode='before')
|
|
39
|
-
def _validate_model(cls: Self, data:
|
|
39
|
+
def _validate_model(cls: Self, data: dict[str, Any]) -> dict[str, Any]:
|
|
40
40
|
"""Validate model"""
|
|
41
41
|
operation_mode: Optional[str] = data.get('operation_mode')
|
|
42
42
|
if operation_mode == AssetOperationMode.ASSETMULTIPLE.name:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Events entities"""
|
|
2
|
+
|
|
2
3
|
import sys
|
|
3
4
|
from datetime import datetime
|
|
4
|
-
from typing import Any,
|
|
5
|
+
from typing import Any, Optional
|
|
5
6
|
|
|
6
7
|
from pydantic import BaseModel, Field, model_validator
|
|
7
8
|
|
|
@@ -22,7 +23,7 @@ class Case(BaseModel):
|
|
|
22
23
|
pk: int = Field(description='Defines the primary key of the case')
|
|
23
24
|
trigger: Trigger = Field(description='Defines the trigger of the case')
|
|
24
25
|
asset_id: int = Field(description='Defines the asset ID of the case')
|
|
25
|
-
comments:
|
|
26
|
+
comments: list[Comment] = Field(default_factory=list, description='Defines the comments of the case')
|
|
26
27
|
opened_at: datetime = Field(description='Defines the date when the case was opened')
|
|
27
28
|
closed_at: Optional[datetime] = Field(default=None, description='Defines the date when the case was closed')
|
|
28
29
|
status: CaseStatus = Field(description='Defines the status of the case', default=CaseStatus.CLOSED)
|
|
@@ -36,7 +37,7 @@ class Case(BaseModel):
|
|
|
36
37
|
)
|
|
37
38
|
|
|
38
39
|
@model_validator(mode='before')
|
|
39
|
-
def _validate_model(cls: Self, data:
|
|
40
|
+
def _validate_model(cls: Self, data: dict[str, Any]) -> dict[str, Any]:
|
|
40
41
|
"""Validate model"""
|
|
41
42
|
sequence = data.get('sequence')
|
|
42
43
|
if sequence is not None and isinstance(sequence, int):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Bar chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -21,7 +21,7 @@ class BarChart(BaseModel):
|
|
|
21
21
|
"""Bar chart configuration"""
|
|
22
22
|
|
|
23
23
|
x_axis: ChartDataSerie = Field(description='Defines the X Axis of the chart')
|
|
24
|
-
y_axis:
|
|
24
|
+
y_axis: list[ChartDataSerie] = Field(description='Defines the Y Axis of the chart', default_factory=list)
|
|
25
25
|
title: str = Field(default='Chart', description='Title of the chart')
|
|
26
26
|
align: ChartAlignment = Field(default=ChartAlignment.CENTER, description='Alignment of the title')
|
|
27
27
|
x_axis_config: AxisConfig = Field(
|
|
@@ -36,7 +36,7 @@ class BarChart(BaseModel):
|
|
|
36
36
|
def render(
|
|
37
37
|
self: Self,
|
|
38
38
|
technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
|
|
39
|
-
) ->
|
|
39
|
+
) -> dict[str, Any]:
|
|
40
40
|
"""
|
|
41
41
|
Render chart to a graphic Library.
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ class BarChart(BaseModel):
|
|
|
44
44
|
:type technology: ChartRenderTechnology
|
|
45
45
|
|
|
46
46
|
:return: The configuration of the chart.
|
|
47
|
-
:rtype:
|
|
47
|
+
:rtype: dict[str, Any]
|
|
48
48
|
"""
|
|
49
49
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
50
50
|
return {
|
|
@@ -73,7 +73,7 @@ class BarChart(BaseModel):
|
|
|
73
73
|
'configuration': [f'Unsupported rendering technology {technology.name}'],
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
def _render_syncfusion_flutter_charts(self: Self) ->
|
|
76
|
+
def _render_syncfusion_flutter_charts(self: Self) -> dict[str, Any]:
|
|
77
77
|
"""
|
|
78
78
|
Converts the configuration of the chart to Syncfusion Flutter Charts.
|
|
79
79
|
"""
|
|
@@ -111,7 +111,7 @@ class BarChart(BaseModel):
|
|
|
111
111
|
},
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
def _render_graphic(self: Self) ->
|
|
114
|
+
def _render_graphic(self: Self) -> list[dict[str, Any]]:
|
|
115
115
|
"""
|
|
116
116
|
Converts the configuration of the chart to Flutter library graphic.
|
|
117
117
|
"""
|
|
@@ -132,7 +132,7 @@ class BarChart(BaseModel):
|
|
|
132
132
|
|
|
133
133
|
return series
|
|
134
134
|
|
|
135
|
-
def _render_apexcharts(self: Self) ->
|
|
135
|
+
def _render_apexcharts(self: Self) -> dict[str, Any]:
|
|
136
136
|
"""
|
|
137
137
|
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
138
138
|
"""
|
|
@@ -34,11 +34,11 @@ class ChartColor(Enum):
|
|
|
34
34
|
return f'ChartColor.{self.name}'
|
|
35
35
|
|
|
36
36
|
@staticmethod
|
|
37
|
-
def get_colors() ->
|
|
37
|
+
def get_colors() -> list[str]:
|
|
38
38
|
"""Get a color from the list"""
|
|
39
39
|
return [color.value for color in ChartColor]
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def get_color_list() ->
|
|
42
|
+
def get_color_list() -> list[str]:
|
|
43
43
|
"""Get all colors"""
|
|
44
44
|
return ChartColor.get_colors()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Column chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from layrz_sdk.helpers import convert_to_rgba
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ class ColumnChart(BaseModel):
|
|
|
22
22
|
"""Column chart configuration"""
|
|
23
23
|
|
|
24
24
|
x_axis: ChartDataSerie = Field(description='Defines the X Axis of the chart')
|
|
25
|
-
y_axis:
|
|
25
|
+
y_axis: list[ChartDataSerie] = Field(description='Defines the Y Axis of the chart', default_factory=list)
|
|
26
26
|
title: str = Field(default='Chart', description='Title of the chart')
|
|
27
27
|
align: ChartAlignment = Field(default=ChartAlignment.CENTER, description='Alignment of the title')
|
|
28
28
|
x_axis_config: AxisConfig = Field(
|
|
@@ -45,7 +45,7 @@ class ColumnChart(BaseModel):
|
|
|
45
45
|
:type technology: ChartRenderTechnology
|
|
46
46
|
|
|
47
47
|
:return: The configuration of the chart.
|
|
48
|
-
:rtype:
|
|
48
|
+
:rtype: dict[str, Any]
|
|
49
49
|
"""
|
|
50
50
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
51
51
|
return {
|
|
@@ -74,7 +74,7 @@ class ColumnChart(BaseModel):
|
|
|
74
74
|
'configuration': [f'Unsupported {technology}'],
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
def _render_syncfusion_flutter_charts(self: Self) ->
|
|
77
|
+
def _render_syncfusion_flutter_charts(self: Self) -> dict[str, Any]:
|
|
78
78
|
"""
|
|
79
79
|
Converts the configuration of the chart to Syncfusion Flutter Charts.
|
|
80
80
|
"""
|
|
@@ -112,7 +112,7 @@ class ColumnChart(BaseModel):
|
|
|
112
112
|
},
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
def _render_graphic(self: Self) ->
|
|
115
|
+
def _render_graphic(self: Self) -> list[dict[str, Any]]:
|
|
116
116
|
"""
|
|
117
117
|
Converts the configuration of the chart to Flutter library graphic.
|
|
118
118
|
"""
|
|
@@ -133,18 +133,18 @@ class ColumnChart(BaseModel):
|
|
|
133
133
|
|
|
134
134
|
return series
|
|
135
135
|
|
|
136
|
-
def _render_apexcharts(self: Self) ->
|
|
136
|
+
def _render_apexcharts(self: Self) -> dict[str, Any]:
|
|
137
137
|
"""
|
|
138
138
|
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
139
139
|
"""
|
|
140
140
|
|
|
141
141
|
series = []
|
|
142
142
|
colors = []
|
|
143
|
-
stroke:
|
|
143
|
+
stroke: dict[str, Any] = {'width': [], 'dashArray': []}
|
|
144
144
|
markers = []
|
|
145
145
|
|
|
146
146
|
for serie in self.y_axis:
|
|
147
|
-
modified_serie:
|
|
147
|
+
modified_serie: dict[str, Any] = {
|
|
148
148
|
'name': serie.label,
|
|
149
149
|
}
|
|
150
150
|
if serie.serie_type == ChartDataSerieType.SCATTER:
|
|
@@ -17,7 +17,7 @@ class HTMLChart(BaseModel):
|
|
|
17
17
|
content: str = Field(description='HTML content of the chart', default='<p>N/A</p>')
|
|
18
18
|
title: str = Field(description='Title of the chart', default='Chart')
|
|
19
19
|
|
|
20
|
-
def render(self: Self) ->
|
|
20
|
+
def render(self: Self) -> dict[str, Any]:
|
|
21
21
|
"""
|
|
22
22
|
Render chart to a graphic Library.
|
|
23
23
|
|
|
@@ -25,11 +25,11 @@ class HTMLChart(BaseModel):
|
|
|
25
25
|
:type technology: ChartRenderTechnology
|
|
26
26
|
|
|
27
27
|
:return: The configuration of the chart.
|
|
28
|
-
:rtype:
|
|
28
|
+
:rtype: dict[str, Any]
|
|
29
29
|
"""
|
|
30
30
|
return {'library': 'HTML', 'configuration': self._render_html()}
|
|
31
31
|
|
|
32
|
-
def _render_html(self: Self) ->
|
|
32
|
+
def _render_html(self: Self) -> dict[str, Any]:
|
|
33
33
|
"""
|
|
34
34
|
Converts the configuration of the chart to HTML render engine.
|
|
35
35
|
"""
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
import sys
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import Any
|
|
6
6
|
|
|
7
7
|
from pydantic import BaseModel, Field
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ class LineChart(BaseModel):
|
|
|
25
25
|
"""Line chart configuration"""
|
|
26
26
|
|
|
27
27
|
x_axis: ChartDataSerie = Field(description='Defines the X Axis of the chart')
|
|
28
|
-
y_axis:
|
|
28
|
+
y_axis: list[ChartDataSerie] = Field(description='Defines the Y Axis of the chart', default_factory=list)
|
|
29
29
|
title: str = Field(default='Chart', description='Title of the chart')
|
|
30
30
|
align: ChartAlignment = Field(default=ChartAlignment.CENTER, description='Alignment of the title')
|
|
31
31
|
x_axis_config: AxisConfig = Field(
|
|
@@ -37,7 +37,7 @@ class LineChart(BaseModel):
|
|
|
37
37
|
description='Configuration of the Y Axis',
|
|
38
38
|
)
|
|
39
39
|
|
|
40
|
-
def render(self: Self, technology: ChartRenderTechnology) ->
|
|
40
|
+
def render(self: Self, technology: ChartRenderTechnology) -> dict[str, Any]:
|
|
41
41
|
"""
|
|
42
42
|
Render chart to a graphic Library.
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ class LineChart(BaseModel):
|
|
|
45
45
|
:type technology: ChartRenderTechnology
|
|
46
46
|
|
|
47
47
|
:return: The configuration of the chart.
|
|
48
|
-
:rtype:
|
|
48
|
+
:rtype: dict[str, Any]
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
51
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
@@ -75,7 +75,7 @@ class LineChart(BaseModel):
|
|
|
75
75
|
'configuration': [f'Unsupported {technology}'],
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
def _render_syncfusion_flutter_charts(self: Self) ->
|
|
78
|
+
def _render_syncfusion_flutter_charts(self: Self) -> dict[str, Any]:
|
|
79
79
|
"""
|
|
80
80
|
Converts the configuration of the chart to a Flutter library syncfusion_flutter_charts.
|
|
81
81
|
"""
|
|
@@ -138,7 +138,7 @@ class LineChart(BaseModel):
|
|
|
138
138
|
},
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
def _render_graphic(self: Self) ->
|
|
141
|
+
def _render_graphic(self: Self) -> list[dict[str, Any]]:
|
|
142
142
|
"""
|
|
143
143
|
Converts the configuration of the chart to a Flutter library Graphic.
|
|
144
144
|
"""
|
|
@@ -173,7 +173,7 @@ class LineChart(BaseModel):
|
|
|
173
173
|
|
|
174
174
|
return series
|
|
175
175
|
|
|
176
|
-
def _render_canvasjs(self: Self) ->
|
|
176
|
+
def _render_canvasjs(self: Self) -> dict[str, Any]:
|
|
177
177
|
"""
|
|
178
178
|
Converts the configuration of the chart to Javascript library CanvasJS.
|
|
179
179
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Map chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional, Tuple
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -18,12 +18,12 @@ else:
|
|
|
18
18
|
class MapChart(BaseModel):
|
|
19
19
|
"""Map chart configuration"""
|
|
20
20
|
|
|
21
|
-
points:
|
|
21
|
+
points: list[MapPoint] = Field(description='Points of the chart', default_factory=list)
|
|
22
22
|
title: str = Field(description='Title of the chart', default='Chart')
|
|
23
23
|
center: MapCenterType = Field(description='Center of the chart', default=MapCenterType.CONTAIN)
|
|
24
|
-
center_latlng: Optional[
|
|
24
|
+
center_latlng: Optional[list[float]] = Field(description='Center of the chart in latlng format', default=None)
|
|
25
25
|
|
|
26
|
-
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER_MAP) ->
|
|
26
|
+
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER_MAP) -> dict[str, Any]:
|
|
27
27
|
"""
|
|
28
28
|
Render chart to a graphic Library.
|
|
29
29
|
|
|
@@ -31,7 +31,7 @@ class MapChart(BaseModel):
|
|
|
31
31
|
:type technology: ChartRenderTechnology
|
|
32
32
|
|
|
33
33
|
:return: The configuration of the chart.
|
|
34
|
-
:rtype:
|
|
34
|
+
:rtype: dict[str, Any]
|
|
35
35
|
"""
|
|
36
36
|
if technology == ChartRenderTechnology.FLUTTER_MAP:
|
|
37
37
|
return {
|
|
@@ -46,7 +46,7 @@ class MapChart(BaseModel):
|
|
|
46
46
|
'configuration': [f'Unsupported {technology}'],
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
def _render_flutter_map(self: Self) ->
|
|
49
|
+
def _render_flutter_map(self: Self) -> dict[str, Any]:
|
|
50
50
|
"""
|
|
51
51
|
Converts the configuration to the chart to Flutter Map engine.
|
|
52
52
|
"""
|
|
@@ -66,7 +66,7 @@ class MapChart(BaseModel):
|
|
|
66
66
|
if self.center == MapCenterType.FIXED:
|
|
67
67
|
center = 'FIXED'
|
|
68
68
|
|
|
69
|
-
config:
|
|
69
|
+
config: dict[str, Any] = {
|
|
70
70
|
'points': points,
|
|
71
71
|
'center': center,
|
|
72
72
|
}
|
|
@@ -79,7 +79,7 @@ class MapChart(BaseModel):
|
|
|
79
79
|
|
|
80
80
|
return config
|
|
81
81
|
|
|
82
|
-
def _render_leaflet(self: Self) ->
|
|
82
|
+
def _render_leaflet(self: Self) -> dict[str, Any]:
|
|
83
83
|
"""
|
|
84
84
|
Converts the configuration of the chart to Leaflet map engine.
|
|
85
85
|
"""
|
|
@@ -93,7 +93,7 @@ class MapChart(BaseModel):
|
|
|
93
93
|
if self.center == MapCenterType.FIXED:
|
|
94
94
|
center = 'FIXED'
|
|
95
95
|
|
|
96
|
-
config:
|
|
96
|
+
config: dict[str, Any] = {
|
|
97
97
|
'points': points,
|
|
98
98
|
'title': self.title,
|
|
99
99
|
'center': center,
|
|
@@ -20,7 +20,7 @@ class NumberChart(BaseModel):
|
|
|
20
20
|
color: str = Field(description='Color of the number')
|
|
21
21
|
label: str = Field(description='Label of the number')
|
|
22
22
|
|
|
23
|
-
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER) ->
|
|
23
|
+
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER) -> dict[str, Any]:
|
|
24
24
|
"""
|
|
25
25
|
Render chart to a graphic Library.
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ class NumberChart(BaseModel):
|
|
|
28
28
|
:type technology: ChartRenderTechnology
|
|
29
29
|
|
|
30
30
|
:return: The configuration of the chart.
|
|
31
|
-
:rtype:
|
|
31
|
+
:rtype: dict[str, Any]
|
|
32
32
|
"""
|
|
33
33
|
if technology == ChartRenderTechnology.FLUTTER:
|
|
34
34
|
return {
|
|
@@ -43,7 +43,7 @@ class NumberChart(BaseModel):
|
|
|
43
43
|
'configuration': [f'Unsupported {technology}'],
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
def _render_flutter(self: Self) ->
|
|
46
|
+
def _render_flutter(self: Self) -> dict[str, Any]:
|
|
47
47
|
"""
|
|
48
48
|
Converts the configuration of the chart to a Flutter native components.
|
|
49
49
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Pie chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -18,14 +18,14 @@ else:
|
|
|
18
18
|
class PieChart(BaseModel):
|
|
19
19
|
"""Pie chart configuration"""
|
|
20
20
|
|
|
21
|
-
series:
|
|
21
|
+
series: list[ChartDataSerie] = Field(description='List of series to be displayed in the chart', default_factory=list)
|
|
22
22
|
title: str = Field(description='Title of the chart', default='Chart')
|
|
23
23
|
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
24
24
|
|
|
25
25
|
def render(
|
|
26
26
|
self: Self,
|
|
27
27
|
technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
|
|
28
|
-
) ->
|
|
28
|
+
) -> dict[str, Any]:
|
|
29
29
|
"""
|
|
30
30
|
Render chart to a graphic Library.
|
|
31
31
|
|
|
@@ -33,7 +33,7 @@ class PieChart(BaseModel):
|
|
|
33
33
|
:type technology: ChartRenderTechnology
|
|
34
34
|
|
|
35
35
|
:return: The configuration of the chart.
|
|
36
|
-
:rtype:
|
|
36
|
+
:rtype: dict[str, Any]
|
|
37
37
|
"""
|
|
38
38
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
39
39
|
return {
|
|
@@ -62,7 +62,7 @@ class PieChart(BaseModel):
|
|
|
62
62
|
'configuration': [f'Unsupported {technology}'],
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
def _render_syncfusion_flutter_charts(self: Self) ->
|
|
65
|
+
def _render_syncfusion_flutter_charts(self: Self) -> dict[str, Any]:
|
|
66
66
|
"""
|
|
67
67
|
Converts the configuration of the chart to Syncfusion Flutter Charts.
|
|
68
68
|
"""
|
|
@@ -79,7 +79,7 @@ class PieChart(BaseModel):
|
|
|
79
79
|
|
|
80
80
|
return {'series': series}
|
|
81
81
|
|
|
82
|
-
def _render_graphic(self: Self) ->
|
|
82
|
+
def _render_graphic(self: Self) -> list[dict[str, Any]]:
|
|
83
83
|
"""
|
|
84
84
|
Converts the configuration of the chart to a Flutter library Graphic.
|
|
85
85
|
"""
|
|
@@ -96,7 +96,7 @@ class PieChart(BaseModel):
|
|
|
96
96
|
|
|
97
97
|
return series
|
|
98
98
|
|
|
99
|
-
def _render_apexcharts(self: Self) ->
|
|
99
|
+
def _render_apexcharts(self: Self) -> dict[str, Any]:
|
|
100
100
|
"""
|
|
101
101
|
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
102
102
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Radar chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -19,11 +19,11 @@ class RadarChart(BaseModel):
|
|
|
19
19
|
"""Radar chart configuration"""
|
|
20
20
|
|
|
21
21
|
x_axis: ChartDataSerie = Field(description='X Axis of the chart')
|
|
22
|
-
y_axis:
|
|
22
|
+
y_axis: list[ChartDataSerie] = Field(description='Y Axis of the chart', default_factory=list)
|
|
23
23
|
title: str = Field(description='Title of the chart', default='Chart')
|
|
24
24
|
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
25
25
|
|
|
26
|
-
def render(self: Self) ->
|
|
26
|
+
def render(self: Self) -> dict[str, Any]:
|
|
27
27
|
"""
|
|
28
28
|
Render chart to a graphic Library.
|
|
29
29
|
|
|
@@ -31,11 +31,11 @@ class RadarChart(BaseModel):
|
|
|
31
31
|
:type technology: ChartRenderTechnology
|
|
32
32
|
|
|
33
33
|
:return: The configuration of the chart.
|
|
34
|
-
:rtype:
|
|
34
|
+
:rtype: dict[str, Any]
|
|
35
35
|
"""
|
|
36
36
|
return {'library': 'APEXCHARTS', 'configuration': self._render_apexcharts()}
|
|
37
37
|
|
|
38
|
-
def _render_apexcharts(self: Self) ->
|
|
38
|
+
def _render_apexcharts(self: Self) -> dict[str, Any]:
|
|
39
39
|
"""
|
|
40
40
|
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
41
41
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Radial Bar chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -18,14 +18,14 @@ else:
|
|
|
18
18
|
class RadialBarChart(BaseModel):
|
|
19
19
|
"""Radial Bar chart configuration"""
|
|
20
20
|
|
|
21
|
-
series:
|
|
21
|
+
series: list[ChartDataSerie] = Field(description='List of series to be displayed in the chart', default_factory=list)
|
|
22
22
|
title: str = Field(description='Title of the chart', default='Chart')
|
|
23
23
|
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
24
24
|
|
|
25
25
|
def render(
|
|
26
26
|
self: Self,
|
|
27
27
|
technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
|
|
28
|
-
) ->
|
|
28
|
+
) -> dict[str, Any]:
|
|
29
29
|
"""
|
|
30
30
|
Render chart to a graphic Library.
|
|
31
31
|
|
|
@@ -33,7 +33,7 @@ class RadialBarChart(BaseModel):
|
|
|
33
33
|
:type technology: ChartRenderTechnology
|
|
34
34
|
|
|
35
35
|
:return: The configuration of the chart.
|
|
36
|
-
:rtype:
|
|
36
|
+
:rtype: dict[str, Any]
|
|
37
37
|
"""
|
|
38
38
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
39
39
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Scatter chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ else:
|
|
|
20
20
|
class ScatterChart(BaseModel):
|
|
21
21
|
"""Scatter chart configuration"""
|
|
22
22
|
|
|
23
|
-
series:
|
|
23
|
+
series: list[ScatterSerie] = Field(description='List of series to be displayed in the chart', default_factory=list)
|
|
24
24
|
title: str = Field(description='Title of the chart', default='Chart')
|
|
25
25
|
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
26
26
|
x_axis_config: AxisConfig = Field(
|
|
@@ -35,7 +35,7 @@ class ScatterChart(BaseModel):
|
|
|
35
35
|
def render(
|
|
36
36
|
self: Self,
|
|
37
37
|
technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
|
|
38
|
-
) ->
|
|
38
|
+
) -> dict[str, Any]:
|
|
39
39
|
"""
|
|
40
40
|
Render chart to a graphic Library.
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ class ScatterChart(BaseModel):
|
|
|
43
43
|
:type technology: ChartRenderTechnology
|
|
44
44
|
|
|
45
45
|
:return: The configuration of the chart.
|
|
46
|
-
:rtype:
|
|
46
|
+
:rtype: dict[str, Any]
|
|
47
47
|
"""
|
|
48
48
|
if technology == ChartRenderTechnology.GRAPHIC:
|
|
49
49
|
return {
|
|
@@ -72,7 +72,7 @@ class ScatterChart(BaseModel):
|
|
|
72
72
|
'configuration': [f'Unsupported {technology}'],
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
def _render_syncfusion_flutter_charts(self: Self) ->
|
|
75
|
+
def _render_syncfusion_flutter_charts(self: Self) -> dict[str, Any]:
|
|
76
76
|
"""
|
|
77
77
|
Converts the configuration of the chart to Flutter library Graphic.
|
|
78
78
|
"""
|
|
@@ -130,7 +130,7 @@ class ScatterChart(BaseModel):
|
|
|
130
130
|
},
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
def _render_graphic(self: Self) ->
|
|
133
|
+
def _render_graphic(self: Self) -> list[dict[str, Any]]:
|
|
134
134
|
"""
|
|
135
135
|
Converts the configuration of the chart to Flutter library Graphic.
|
|
136
136
|
"""
|
|
@@ -167,7 +167,7 @@ class ScatterChart(BaseModel):
|
|
|
167
167
|
|
|
168
168
|
return series
|
|
169
169
|
|
|
170
|
-
def _render_apexcharts(self: Self) ->
|
|
170
|
+
def _render_apexcharts(self: Self) -> dict[str, Any]:
|
|
171
171
|
"""
|
|
172
172
|
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
173
173
|
"""
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
1
|
from pydantic import BaseModel, Field
|
|
4
2
|
|
|
5
3
|
from .chart_data_serie_type import ChartDataSerieType
|
|
@@ -9,7 +7,7 @@ from .scatter_serie_item import ScatterSerieItem
|
|
|
9
7
|
class ScatterSerie(BaseModel):
|
|
10
8
|
"""Chart Data Serie for Timeline charts"""
|
|
11
9
|
|
|
12
|
-
data:
|
|
10
|
+
data: list[ScatterSerieItem] = Field(description='List of data points', default_factory=list)
|
|
13
11
|
color: str = Field(description='Color of the serie', default='')
|
|
14
12
|
label: str = Field(description='Label of the serie', default='')
|
|
15
13
|
serie_type: ChartDataSerieType = Field(description='Type of the serie', default=ChartDataSerieType.SCATTER)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Number chart"""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -18,10 +18,10 @@ else:
|
|
|
18
18
|
class TableChart(BaseModel):
|
|
19
19
|
"""Table chart configuration"""
|
|
20
20
|
|
|
21
|
-
columns:
|
|
22
|
-
rows:
|
|
21
|
+
columns: list[TableHeader] = Field(description='List of columns', default_factory=list)
|
|
22
|
+
rows: list[TableRow] = Field(description='List of rows', default_factory=list)
|
|
23
23
|
|
|
24
|
-
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER) ->
|
|
24
|
+
def render(self: Self, technology: ChartRenderTechnology = ChartRenderTechnology.FLUTTER) -> dict[str, Any]:
|
|
25
25
|
"""
|
|
26
26
|
Render chart to a graphic Library.
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ class TableChart(BaseModel):
|
|
|
29
29
|
:type technology: ChartRenderTechnology
|
|
30
30
|
|
|
31
31
|
:return: The configuration of the chart.
|
|
32
|
-
:rtype:
|
|
32
|
+
:rtype: dict[str, Any]
|
|
33
33
|
"""
|
|
34
34
|
if technology == ChartRenderTechnology.FLUTTER:
|
|
35
35
|
return {
|
|
@@ -44,7 +44,7 @@ class TableChart(BaseModel):
|
|
|
44
44
|
'configuration': [f'Unsupported {technology}'],
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
def _render_flutter(self: Self) ->
|
|
47
|
+
def _render_flutter(self: Self) -> dict[str, Any]:
|
|
48
48
|
"""
|
|
49
49
|
Converts the configuration of the chart to a Flutter native components.
|
|
50
50
|
"""
|