Skip to content

Commit

Permalink
LLCAXCHZF-57/add engine details field
Browse files Browse the repository at this point in the history
  • Loading branch information
TomeCirun committed Jul 29, 2024
1 parent ca80e63 commit 4ce241f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ckanext/charts/chart_builders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,14 @@ def filter_field(self, choices: list[dict[str, str]]) -> dict[str, Any]:
],
"group": "Filter",
}

def engine_details_field(self) -> dict[str, Any]:
"""
Provides details about zoom functionality support in various charting libraries.
"""
return {
"field_name": "engine_details",
"label": "Engine details",
"form_snippet": "chart_engine_details.html",
"group": "Structure",
}
5 changes: 5 additions & 0 deletions ckanext/charts/chart_builders/chartjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_multi_axis_field(columns),
self.limit_field(),
Expand Down Expand Up @@ -185,6 +186,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_multi_axis_field(columns),
self.sort_x_field(),
Expand Down Expand Up @@ -243,6 +245,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.values_field(columns),
self.names_field(columns),
self.limit_field(),
Expand Down Expand Up @@ -308,6 +311,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_axis_field(columns),
self.sort_x_field(),
Expand Down Expand Up @@ -432,6 +436,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.names_field(columns),
self.values_multi_field(
columns,
Expand Down
5 changes: 5 additions & 0 deletions ckanext/charts/chart_builders/observable.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_axis_field(columns),
self.sort_x_field(),
Expand Down Expand Up @@ -110,6 +111,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_axis_field(columns),
self.invert_x_field(),
Expand Down Expand Up @@ -185,6 +187,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.values_field(columns),
self.names_field(columns),
self.opacity_field(),
Expand Down Expand Up @@ -225,6 +228,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_axis_field(columns),
self.sort_x_field(),
Expand Down Expand Up @@ -263,6 +267,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_axis_field(columns),
self.sort_x_field(),
Expand Down
4 changes: 4 additions & 0 deletions ckanext/charts/chart_builders/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_axis_field(columns),
self.log_x_field(),
Expand Down Expand Up @@ -141,6 +142,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.values_field(columns),
self.names_field(columns),
self.opacity_field(),
Expand Down Expand Up @@ -183,6 +185,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.plotly_y_multi_axis_field(columns, 2),
self.invert_x_field(),
Expand Down Expand Up @@ -227,6 +230,7 @@ def get_form_fields(self):
self.description_field(),
self.engine_field(),
self.type_field(chart_types),
self.engine_details_field(),
self.x_axis_field(columns),
self.y_axis_field(columns),
self.log_x_field(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<div class="form-group control-full control-large">
<div class="controls">
<button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#engineDetailsModal">
{{ _("Engine Details") }}
</button>
</div>
</div>


<div class="modal fade" id="engineDetailsModal" tabindex="-1" role="dialog" aria-labelledby="engineDetailsModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="moreInfoModalLabel">{{ _("Engine Details") }}</h5>
<button type="button" class="btn-close close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
<p>
{{ _("The zoom functionality is currently supported for Chart.js and Plotly charts. These libraries offer built-in zoom and pan features, allowing users to interact with the data by zooming in, out, or panning across the chart.") }}
</p>
<p>
{{ _("Observable Plot, however, does not natively support zoom and pan functionality like some other charting libraries. Adding such functionality to Observable Plot requires additional customization and integration with external libraries such as D3.js. As a result, zoom and pan may not work seamlessly out of the box and may require further development to be fully integrated.") }}
</p>
<p>
{{ _("We are actively working to enhance our charting capabilities and may include native support for zoom and pan in Observable Plot in future updates.") }}
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">{{ _("Close") }}</button>
</div>
</div>
</div>
</div>

0 comments on commit 4ce241f

Please sign in to comment.