Skip to content

Commit

Permalink
DATASHADES-344 / add comments and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmorev committed Jan 14, 2025
1 parent 702668e commit a53ef14
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 160 deletions.
1 change: 0 additions & 1 deletion ckanext/charts/assets/js/charts-render-observable.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ckan.module("charts-render-observable", function ($, _) {
plot = Plot.barX(this.options.config.data, this.options.config.settings).plot(this.options.config.plot);
break;
case "scatter":
this.options.config.settings["r"] = (d) => d.radius;
plot = Plot.dot(this.options.config.data, this.options.config.settings).plot(this.options.config.plot);
break;
case "line":
Expand Down
16 changes: 9 additions & 7 deletions ckanext/charts/chart_builders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ def chart_title_field(self) -> dict[str, Any]:
],
}

def chart_xlabel_field(self) -> dict[str, Any]:
def x_axis_label_field(self) -> dict[str, Any]:
return {
"field_name": "chart_xlabel",
"field_name": "x_axis_label",
"label": "Chart X axe label",
"form_placeholder": "X label",
"group": "Styles",
Expand All @@ -316,23 +316,23 @@ def chart_xlabel_field(self) -> dict[str, Any]:
],
}

def chart_ylabel_field(self) -> dict[str, Any]:
def y_axis_label_field(self) -> dict[str, Any]:
return {
"field_name": "chart_ylabel",
"field_name": "y_axis_label",
"label": "Chart Y axe label",
"form_placeholder": "Y label",
"group": "Styles",
"type": "str",
"help_text": "Label for the Y-axis on the left side",
"help_text": "Label for the Y-axis",
"validators": [
self.get_validator("ignore_empty"),
self.get_validator("unicode_safe"),
],
}

def chart_ylabel_right_field(self) -> dict[str, Any]:
def y_axis_label_right_field(self) -> dict[str, Any]:
return {
"field_name": "chart_ylabel_right",
"field_name": "y_axis_label_right",
"label": "Chart Y axe right label",
"form_placeholder": "Right Y label",
"group": "Styles",
Expand Down Expand Up @@ -838,4 +838,6 @@ def size_max_field(self) -> dict[str, Any]:
self.get_validator("default")(100),
self.get_validator("int_validator"),
],
"type": "int",
"help_text": "Maximum size of dots or bubbles",
}
Loading

0 comments on commit a53ef14

Please sign in to comment.