eea.plotly 1.2__tar.gz → 1.3__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.
Files changed (134) hide show
  1. {eea_plotly-1.2/eea.plotly.egg-info → eea_plotly-1.3}/PKG-INFO +6 -1
  2. {eea_plotly-1.2 → eea_plotly-1.3}/docs/HISTORY.txt +5 -0
  3. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/browser/preview.py +20 -9
  4. eea_plotly-1.3/eea/plotly/browser/preview_adapter/adapter.py +23 -0
  5. eea_plotly-1.3/eea/plotly/browser/preview_adapter/soer_miniature.py +74 -0
  6. eea_plotly-1.3/eea/plotly/version.txt +1 -0
  7. {eea_plotly-1.2 → eea_plotly-1.3/eea.plotly.egg-info}/PKG-INFO +6 -1
  8. {eea_plotly-1.2 → eea_plotly-1.3}/eea.plotly.egg-info/SOURCES.txt +2 -0
  9. eea_plotly-1.2/eea/plotly/version.txt +0 -1
  10. {eea_plotly-1.2 → eea_plotly-1.3}/CONTRIBUTING.md +0 -0
  11. {eea_plotly-1.2 → eea_plotly-1.3}/MANIFEST.in +0 -0
  12. {eea_plotly-1.2 → eea_plotly-1.3}/README.rst +0 -0
  13. {eea_plotly-1.2 → eea_plotly-1.3}/docs/LICENSE.GPL +0 -0
  14. {eea_plotly-1.2 → eea_plotly-1.3}/docs/LICENSE.txt +0 -0
  15. {eea_plotly-1.2 → eea_plotly-1.3}/eea/__init__.py +0 -0
  16. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/README.txt +0 -0
  17. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/__init__.py +0 -0
  18. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/behaviors.py +0 -0
  19. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/browser/__init__.py +0 -0
  20. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/browser/configure.zcml +0 -0
  21. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/browser/controlpanel.py +0 -0
  22. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/browser/pt/visualization_view.pt +0 -0
  23. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/configure.zcml +0 -0
  24. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/controlpanel.py +0 -0
  25. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/deserializer/blocks.py +0 -0
  26. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/deserializer/configure.zcml +0 -0
  27. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/deserializer/dxcontent.py +0 -0
  28. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/deserializer/dxfields.py +0 -0
  29. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/interfaces.py +0 -0
  30. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/io_csv.py +0 -0
  31. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/__init__.py +0 -0
  32. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/bg/LC_MESSAGES/eea.po +0 -0
  33. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/bg/LC_MESSAGES/plone.po +0 -0
  34. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/cs/LC_MESSAGES/eea.po +0 -0
  35. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/cs/LC_MESSAGES/plone.po +0 -0
  36. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/da/LC_MESSAGES/eea.po +0 -0
  37. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/da/LC_MESSAGES/plone.po +0 -0
  38. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/de/LC_MESSAGES/eea.po +0 -0
  39. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/de/LC_MESSAGES/plone.po +0 -0
  40. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/eea.pot +0 -0
  41. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/el/LC_MESSAGES/eea.po +0 -0
  42. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/el/LC_MESSAGES/plone.po +0 -0
  43. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/en/LC_MESSAGES/eea.po +0 -0
  44. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/en/LC_MESSAGES/plone.po +0 -0
  45. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/es/LC_MESSAGES/eea.po +0 -0
  46. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/es/LC_MESSAGES/plone.po +0 -0
  47. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/et/LC_MESSAGES/eea.po +0 -0
  48. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/et/LC_MESSAGES/plone.po +0 -0
  49. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/eu/LC_MESSAGES/eea.po +0 -0
  50. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/eu/LC_MESSAGES/plone.po +0 -0
  51. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/fi/LC_MESSAGES/eea.po +0 -0
  52. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/fi/LC_MESSAGES/plone.po +0 -0
  53. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/fr/LC_MESSAGES/eea.po +0 -0
  54. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/fr/LC_MESSAGES/plone.po +0 -0
  55. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/hr/LC_MESSAGES/eea.po +0 -0
  56. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/hr/LC_MESSAGES/plone.po +0 -0
  57. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/hu/LC_MESSAGES/eea.po +0 -0
  58. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/hu/LC_MESSAGES/plone.po +0 -0
  59. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/is/LC_MESSAGES/eea.po +0 -0
  60. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/is/LC_MESSAGES/plone.po +0 -0
  61. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/it/LC_MESSAGES/eea.po +0 -0
  62. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/it/LC_MESSAGES/plone.po +0 -0
  63. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/kl/LC_MESSAGES/eea.po +0 -0
  64. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/kl/LC_MESSAGES/plone.po +0 -0
  65. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/lt/LC_MESSAGES/eea.po +0 -0
  66. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/lt/LC_MESSAGES/plone.po +0 -0
  67. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/lv/LC_MESSAGES/eea.po +0 -0
  68. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/lv/LC_MESSAGES/plone.po +0 -0
  69. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/mt/LC_MESSAGES/eea.po +0 -0
  70. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/mt/LC_MESSAGES/plone.po +0 -0
  71. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/nl/LC_MESSAGES/eea.po +0 -0
  72. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/nl/LC_MESSAGES/plone.po +0 -0
  73. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/no/LC_MESSAGES/eea.po +0 -0
  74. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/no/LC_MESSAGES/plone.po +0 -0
  75. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/pl/LC_MESSAGES/eea.po +0 -0
  76. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/pl/LC_MESSAGES/plone.po +0 -0
  77. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/plone-manual.pot +0 -0
  78. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/pt/LC_MESSAGES/eea.po +0 -0
  79. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/pt/LC_MESSAGES/plone.po +0 -0
  80. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/pt_BR/LC_MESSAGES/eea.po +0 -0
  81. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/pt_BR/LC_MESSAGES/plone.po +0 -0
  82. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/ro/LC_MESSAGES/eea.po +0 -0
  83. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/ro/LC_MESSAGES/plone.po +0 -0
  84. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/ru/LC_MESSAGES/eea.po +0 -0
  85. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/ru/LC_MESSAGES/plone.po +0 -0
  86. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/sk/LC_MESSAGES/eea.po +0 -0
  87. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/sk/LC_MESSAGES/plone.po +0 -0
  88. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/sl/LC_MESSAGES/eea.po +0 -0
  89. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/sl/LC_MESSAGES/plone.po +0 -0
  90. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/sv/LC_MESSAGES/eea.po +0 -0
  91. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/sv/LC_MESSAGES/plone.po +0 -0
  92. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/tr/LC_MESSAGES/eea.po +0 -0
  93. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/tr/LC_MESSAGES/plone.po +0 -0
  94. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/update.sh +0 -0
  95. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/zh_TW/LC_MESSAGES/eea.po +0 -0
  96. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/locales/zh_TW/LC_MESSAGES/plone.po +0 -0
  97. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/permissions.zcml +0 -0
  98. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/default/browserlayer.xml +0 -0
  99. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/default/controlpanel.xml +0 -0
  100. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/default/metadata.xml +0 -0
  101. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/default/registry.xml +0 -0
  102. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/default/rolemap.xml +0 -0
  103. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/default/types/visualization.xml +0 -0
  104. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/default/types.xml +0 -0
  105. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/uninstall/browserlayer.xml +0 -0
  106. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/uninstall/controlpanel.xml +0 -0
  107. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles/uninstall/registry.xml +0 -0
  108. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/profiles.zcml +0 -0
  109. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/restapi/__init__.py +0 -0
  110. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/restapi/configure.zcml +0 -0
  111. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/restapi/controlpanel/__init__.py +0 -0
  112. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/restapi/controlpanel/configure.zcml +0 -0
  113. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/restapi/controlpanel/get.py +0 -0
  114. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/restapi/visualization/configure.zcml +0 -0
  115. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/restapi/visualization/get.py +0 -0
  116. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/serializer/blocks.py +0 -0
  117. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/serializer/configure.zcml +0 -0
  118. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/serializer/dxfields.py +0 -0
  119. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/serializer/utils.py +0 -0
  120. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/setuphandlers.py +0 -0
  121. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/tests/__init__.py +0 -0
  122. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/tests/base.py +0 -0
  123. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/tests/test_doctests.py +0 -0
  124. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/upgrades/__init__.py +0 -0
  125. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/upgrades/configure.zcml +0 -0
  126. {eea_plotly-1.2 → eea_plotly-1.3}/eea/plotly/utils.py +0 -0
  127. {eea_plotly-1.2 → eea_plotly-1.3}/eea.plotly.egg-info/dependency_links.txt +0 -0
  128. {eea_plotly-1.2 → eea_plotly-1.3}/eea.plotly.egg-info/entry_points.txt +0 -0
  129. {eea_plotly-1.2 → eea_plotly-1.3}/eea.plotly.egg-info/namespace_packages.txt +0 -0
  130. {eea_plotly-1.2 → eea_plotly-1.3}/eea.plotly.egg-info/not-zip-safe +0 -0
  131. {eea_plotly-1.2 → eea_plotly-1.3}/eea.plotly.egg-info/requires.txt +0 -0
  132. {eea_plotly-1.2 → eea_plotly-1.3}/eea.plotly.egg-info/top_level.txt +0 -0
  133. {eea_plotly-1.2 → eea_plotly-1.3}/setup.cfg +0 -0
  134. {eea_plotly-1.2 → eea_plotly-1.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eea.plotly
3
- Version: 1.2
3
+ Version: 1.3
4
4
  Summary: volto-plotlycharts backend support
5
5
  Home-page: https://github.com/eea/eea.plotly
6
6
  Author: European Environment Agency: IDM2 A-Team
@@ -145,6 +145,11 @@ EEA_ - European Environment Agency (EU)
145
145
  Changelog
146
146
  =========
147
147
 
148
+ 1.3 - (2025-05-29)
149
+ ---------------------------
150
+ * Change: Add preview adapter
151
+ [razvanMiu]
152
+
148
153
  1.2 - (2025-03-13)
149
154
  ---------------------------
150
155
  * Change: Add theme property
@@ -1,6 +1,11 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 1.3 - (2025-05-29)
5
+ ---------------------------
6
+ * Change: Add preview adapter
7
+ [razvanMiu]
8
+
4
9
  1.2 - (2025-03-13)
5
10
  ---------------------------
6
11
  * Change: Add theme property
@@ -10,6 +10,8 @@ from Products.Five.browser import BrowserView
10
10
  from eea.plotly.controlpanel import IPlotlySettings
11
11
  from eea.plotly.utils import sanitizeVisualization
12
12
 
13
+ from .preview_adapter.adapter import get_preview_adapter
14
+
13
15
 
14
16
  def deepUpdate(original, update):
15
17
  """ Recursively update a dictionary with another dictionary."""
@@ -27,16 +29,19 @@ def deepUpdate(original, update):
27
29
  class PlotlyPreview(BrowserView):
28
30
  """Plotly Preview"""
29
31
 
32
+ visualization = None
30
33
  name = None
34
+ width = 1200
35
+ height = 900
31
36
 
32
37
  def render(self):
33
38
  """Render"""
34
39
 
35
- visualization = copy.deepcopy(
40
+ self.visualization = copy.deepcopy(
36
41
  sanitizeVisualization(self.context.visualization)
37
42
  )
38
43
 
39
- if not visualization:
44
+ if not self.visualization:
40
45
  self.request.response.setStatus(404)
41
46
  return {
42
47
  "message": "Visualization is not defined",
@@ -54,24 +59,28 @@ class PlotlyPreview(BrowserView):
54
59
  if t.get("id") == self.name:
55
60
  theme = copy.deepcopy(t)
56
61
  break
57
- if theme and "layout" in visualization:
62
+ if theme and "layout" in self.visualization:
58
63
  data = theme.get("data", {})
59
64
  layout = theme.get("layout", {})
60
- for trIndex, tr in enumerate(visualization.get("data", [])):
65
+ for trIndex, tr in enumerate(
66
+ self.visualization.get("data", [])):
61
67
  trType = tr.get("type", "")
62
68
  if trType in data:
63
69
  newTrIndex = min(trIndex, len(data[trType])-1)
64
70
  newTr = data[trType][newTrIndex]
65
71
  deepUpdate(tr, newTr)
66
- deepUpdate(visualization["layout"], layout)
67
- visualization["layout"]["template"] = theme
72
+ deepUpdate(self.visualization["layout"], layout)
73
+ self.visualization["layout"]["template"] = theme
74
+
75
+ get_preview_adapter(self, self.name)
68
76
 
69
- fig = pio.from_json(json.dumps(visualization), skip_invalid=True)
77
+ fig = pio.from_json(json.dumps(self.visualization), skip_invalid=True)
70
78
 
71
- if "template" not in visualization["layout"]:
79
+ if "template" not in self.visualization["layout"]:
72
80
  fig.update_layout(template=None)
73
81
 
74
- image = fig.to_image(format="svg", width=1200, height=900)
82
+ image = fig.to_image(
83
+ format="svg", width=self.width, height=self.height)
75
84
 
76
85
  sh = self.request.response.setHeader
77
86
 
@@ -86,6 +95,8 @@ class PlotlyPreview(BrowserView):
86
95
  def publishTraverse(self, request, name):
87
96
  """used for traversal via publisher, i.e. when using as a url"""
88
97
  self.name = name
98
+ self.width = int(request.form.get("width", self.width))
99
+ self.height = int(request.form.get("height", self.height))
89
100
  return self
90
101
 
91
102
  def __call__(self):
@@ -0,0 +1,23 @@
1
+ """ Preview adapter for Plotly browser. """
2
+
3
+ adapters = {
4
+ "soer_miniature": (
5
+ "eea.plotly.browser.preview_adapter.soer_miniature.serialize"
6
+ ),
7
+ }
8
+
9
+
10
+ def get_preview_adapter(context, name):
11
+ """ Get the preview adapter for a given name.
12
+
13
+ Args:
14
+ name (str): The name of the preview adapter.
15
+
16
+ Returns:
17
+ class: The preview adapter class if found, otherwise None.
18
+ """
19
+ if name in adapters:
20
+ module_name, func = adapters[name].rsplit(".", 1)
21
+ module = __import__(module_name, fromlist=[func])
22
+ return getattr(module, func)(context)
23
+ return None
@@ -0,0 +1,74 @@
1
+ """ SOER miniature theme for Plotly visualizations. """
2
+ import math
3
+
4
+
5
+ def nice_step(vmin, vmax, target_ticks=5):
6
+ """ Calculate a 'nice' step size for the axis ticks. """
7
+ span = abs(vmax - vmin)
8
+ if span == 0:
9
+ return 1 # arbitrary fallback
10
+
11
+ # Initial guess for raw step size
12
+ raw_step = span / target_ticks
13
+
14
+ # Determine the power of 10
15
+ magnitude = 10 ** math.floor(math.log10(raw_step))
16
+ residual = raw_step / magnitude
17
+
18
+ # Choose a nice multiplier
19
+ if residual < 1.5:
20
+ nice_multiplier = 1
21
+ elif residual < 3:
22
+ nice_multiplier = 2
23
+ elif residual < 7:
24
+ nice_multiplier = 5
25
+ else:
26
+ nice_multiplier = 10
27
+
28
+ return nice_multiplier * magnitude
29
+
30
+
31
+ def getMin(arr):
32
+ """ Get minimum value from array """
33
+ return min(float(v) for v in arr if v is not None)
34
+
35
+
36
+ def getMax(arr):
37
+ """ Get maximum value from array """
38
+ return max(float(v) for v in arr if v is not None)
39
+
40
+
41
+ def serialize(context):
42
+ """ Serialize the context for SOER miniature theme"""
43
+
44
+ # Solve x axis range
45
+ if context.visualization is None or len(context.visualization["data"]) < 2:
46
+ return False
47
+
48
+ years = context.visualization["data"][0].get("x", [])
49
+ tickvals = context.visualization["layout"]["xaxis"].get("tickvals", [])
50
+
51
+ if tickvals and years:
52
+ min_year = getMin(tickvals)
53
+ max_year = getMax(years)
54
+
55
+ context.visualization["layout"]["xaxis"]["range"] = [
56
+ min_year - 1, max_year + 1]
57
+ context.visualization["layout"]["xaxis"]["autorange"] = False
58
+
59
+ # Solve y axis range
60
+
61
+ y_values = context.visualization["data"][0].get(
62
+ "y", []) + context.visualization["data"][1].get("y", [])
63
+
64
+ if y_values:
65
+ min_y = getMin(y_values)
66
+ max_y = getMax(y_values)
67
+
68
+ step = nice_step(min_y, max_y, 10)
69
+
70
+ context.visualization["layout"]["yaxis"]["range"] = [
71
+ min_y - step, max_y + step]
72
+ context.visualization["layout"]["yaxis"]["autorange"] = False
73
+
74
+ return True
@@ -0,0 +1 @@
1
+ 1.3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eea.plotly
3
- Version: 1.2
3
+ Version: 1.3
4
4
  Summary: volto-plotlycharts backend support
5
5
  Home-page: https://github.com/eea/eea.plotly
6
6
  Author: European Environment Agency: IDM2 A-Team
@@ -145,6 +145,11 @@ EEA_ - European Environment Agency (EU)
145
145
  Changelog
146
146
  =========
147
147
 
148
+ 1.3 - (2025-05-29)
149
+ ---------------------------
150
+ * Change: Add preview adapter
151
+ [razvanMiu]
152
+
148
153
  1.2 - (2025-03-13)
149
154
  ---------------------------
150
155
  * Change: Add theme property
@@ -30,6 +30,8 @@ eea/plotly/browser/__init__.py
30
30
  eea/plotly/browser/configure.zcml
31
31
  eea/plotly/browser/controlpanel.py
32
32
  eea/plotly/browser/preview.py
33
+ eea/plotly/browser/preview_adapter/adapter.py
34
+ eea/plotly/browser/preview_adapter/soer_miniature.py
33
35
  eea/plotly/browser/pt/visualization_view.pt
34
36
  eea/plotly/deserializer/blocks.py
35
37
  eea/plotly/deserializer/configure.zcml
@@ -1 +0,0 @@
1
- 1.2
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes