From 217502166927cee93da5d73aa4a31d0aa6831deb Mon Sep 17 00:00:00 2001 From: mutantsan Date: Mon, 2 Dec 2024 16:39:28 +0200 Subject: [PATCH] doc: refactor and write documentation part 2 --- README.md | 2 + ckanext/charts/chart_builders/base.py | 74 +- ckanext/charts/chart_builders/chartjs.py | 39 +- ckanext/charts/chart_builders/plotly.py | 5 + docs/engines/chartjs.md | 95 + docs/engines/index.md | 2 +- docs/engines/observable.md | 73 + docs/engines/plotly.md | 62 + mkdocs.yml | 5 + .../ChartFieldsHandler/__init__.py | 3 + .../ChartFieldsHandler/handler.py | 63 + .../templates/material/fields.html | 29 + pyproject.toml | 2 +- site/404.html | 71 +- site/assets/_mkdocstrings.css | 27 +- site/caching/base/index.html | 92 +- site/caching/file/index.html | 150 +- site/caching/index.html | 71 +- site/caching/redis/index.html | 92 +- site/configuration/index.html | 71 +- site/engines/chartjs/index.html | 2906 +++++++++++++++++ site/engines/custom/index.html | 77 +- site/engines/index.html | 79 +- site/engines/observable/index.html | 2746 ++++++++++++++++ site/engines/plotly/index.html | 2718 +++++++++++++++ site/fetchers/base/index.html | 76 +- site/fetchers/datastore/index.html | 88 +- site/fetchers/file/index.html | 88 +- site/fetchers/hardcode/index.html | 80 +- site/fetchers/index.html | 71 +- site/fetchers/url/index.html | 92 +- site/helpers/index.html | 80 +- site/index.html | 72 +- site/install/index.html | 71 +- site/search/search_index.json | 2 +- site/sitemap.xml | 12 + site/sitemap.xml.gz | Bin 326 -> 346 bytes site/troubleshooting/index.html | 71 +- site/usage/index.html | 71 +- site/utils/index.html | 104 +- site/validators/index.html | 116 +- 41 files changed, 10346 insertions(+), 302 deletions(-) create mode 100644 docs/engines/chartjs.md create mode 100644 docs/engines/observable.md create mode 100644 docs/engines/plotly.md create mode 100644 mkdocstrings_handlers/ChartFieldsHandler/__init__.py create mode 100644 mkdocstrings_handlers/ChartFieldsHandler/handler.py create mode 100644 mkdocstrings_handlers/ChartFieldsHandler/templates/material/fields.html create mode 100644 site/engines/chartjs/index.html create mode 100644 site/engines/observable/index.html create mode 100644 site/engines/plotly/index.html diff --git a/README.md b/README.md index 2316953..6255883 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ The extension includes features such as chart creation, chart editing, chart emb With ckanext-charts, users can easily generate interactive and visually appealing charts to enhance data analysis and presentation in CKAN. +See the [documentation](https://datashades.github.io/ckanext-charts/) for more information. + ## Quick start - Install it with `PyPi` with `pip install ckanext-charts[pyarrow]` diff --git a/ckanext/charts/chart_builders/base.py b/ckanext/charts/chart_builders/base.py index 1a7ffd4..6e1acb4 100644 --- a/ckanext/charts/chart_builders/base.py +++ b/ckanext/charts/chart_builders/base.py @@ -265,6 +265,7 @@ def column_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: "required": True, "choices": choices, "group": "Data", + "type": "str", "validators": [ self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), @@ -278,6 +279,8 @@ def title_field(self) -> dict[str, Any]: "preset": "title", "form_placeholder": "Chart title", "group": "General", + "type": "str", + "help_text": "Title of the chart view", "validators": [ self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), @@ -291,6 +294,8 @@ def chart_title_field(self) -> dict[str, Any]: "preset": "title", "form_placeholder": "Chart title", "group": "Styles", + "type": "str", + "help_text": "Title of the chart itself", "validators": [ self.get_validator("default")(" "), self.get_validator("unicode_safe"), @@ -303,6 +308,8 @@ def chart_xlabel_field(self) -> dict[str, Any]: "label": "Chart X axe label", "form_placeholder": "X label", "group": "Styles", + "type": "str", + "help_text": "Label for the X-axis", "validators": [ self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), @@ -315,6 +322,8 @@ def chart_ylabel_left_field(self) -> dict[str, Any]: "label": "Chart Y axe left label", "form_placeholder": "Left Y label", "group": "Styles", + "type": "str", + "help_text": "Label for the Y-axis on the left side", "validators": [ self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), @@ -327,6 +336,8 @@ def chart_ylabel_right_field(self) -> dict[str, Any]: "label": "Chart Y axe right label", "form_placeholder": "Right Y label", "group": "Styles", + "type": "str", + "help_text": "Label for the Y-axis on the right side", "validators": [ self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), @@ -340,6 +351,8 @@ def description_field(self) -> dict[str, Any]: "form_snippet": "markdown.html", "form_placeholder": "Information about my view", "group": "General", + "type": "str", + "help_text": "Description of the chart view", "validators": [ self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), @@ -354,6 +367,9 @@ def engine_field(self) -> dict[str, Any]: "required": True, "choices": tk.h.get_available_chart_engines_options(), "group": "Structure", + "type": "str", + "help_text": "Select the chart engine to use", + "default": "plotly", "validators": [ self.get_validator("default")("plotly"), self.get_validator("unicode_safe"), @@ -385,6 +401,9 @@ def type_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: "hx-target": ".charts-view--form", "data-module-clear-button": True, }, + "help_text": "Select the type of the chart, e.g. Line, Bar, Scatter, etc.", + "type": "str", + "default": "Line", } def x_axis_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: @@ -395,6 +414,8 @@ def x_axis_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: "required": True, "choices": choices, "group": "Data", + "type": "str", + "help_text": "Select a column for the X-axes", "validators": [ self.get_validator("charts_if_empty_same_as")("values"), self.get_validator("unicode_safe"), @@ -411,6 +432,7 @@ def y_axis_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: self.get_validator("charts_if_empty_same_as")("names"), self.get_validator("unicode_safe"), ], + "help_text": "Select a column for the Y-axis", }, ) @@ -444,6 +466,7 @@ def y_multi_axis_field( "data-module-multiple": "true", "multiple": 1, }, + "type": "List[str]", "help_text": help_text, } @@ -498,6 +521,8 @@ def split_data_field(self) -> dict[str, Any]: "Split data into different columns by years based on datetime " "column stated for the x-axis" ), + "type": "bool", + "default": False, } def skip_null_values_field(self) -> dict[str, Any]: @@ -511,6 +536,7 @@ def skip_null_values_field(self) -> dict[str, Any]: ], "help_text": """Entries of the data with missing values will not be graphed or will be skipped""", + "type": "bool", } def break_chart_field(self) -> dict[str, Any]: @@ -523,6 +549,7 @@ def break_chart_field(self) -> dict[str, Any]: self.get_validator("boolean_validator"), ], "help_text": "Break the graph at missing values", + "type": "bool", } def sort_x_field(self) -> dict[str, Any]: @@ -535,6 +562,9 @@ def sort_x_field(self) -> dict[str, Any]: self.get_validator("default")(False), self.get_validator("boolean_validator"), ], + "help_text": "Sort the X-axis values", + "type": "bool", + "default": False, } def sort_y_field(self) -> dict[str, Any]: @@ -547,6 +577,9 @@ def sort_y_field(self) -> dict[str, Any]: self.get_validator("default")(False), self.get_validator("boolean_validator"), ], + "help_text": "Sort the Y-axis values", + "type": "bool", + "default": False, } def invert_x_field(self) -> dict[str, Any]: @@ -559,6 +592,9 @@ def invert_x_field(self) -> dict[str, Any]: self.get_validator("default")(False), self.get_validator("boolean_validator"), ], + "help_text": "Invert the X-axis", + "type": "bool", + "default": False, } def invert_y_field(self) -> dict[str, Any]: @@ -571,6 +607,9 @@ def invert_y_field(self) -> dict[str, Any]: self.get_validator("default")(False), self.get_validator("boolean_validator"), ], + "help_text": "Invert the Y-axis", + "type": "bool", + "default": False, } def log_x_field(self) -> dict[str, Any]: @@ -583,6 +622,9 @@ def log_x_field(self) -> dict[str, Any]: self.get_validator("default")(False), self.get_validator("boolean_validator"), ], + "help_text": "Use log scale for the X-axis", + "type": "bool", + "default": False, } def log_y_field(self) -> dict[str, Any]: @@ -595,6 +637,9 @@ def log_y_field(self) -> dict[str, Any]: self.get_validator("default")(False), self.get_validator("boolean_validator"), ], + "help_text": "Use log scale for the Y-axis", + "type": "bool", + "default": False, } def color_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: @@ -608,6 +653,8 @@ def color_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), ], + "help_text": "Select a column for the color", + "type": "str", } def animation_frame_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: @@ -621,6 +668,8 @@ def animation_frame_field(self, choices: list[dict[str, str]]) -> dict[str, Any] self.get_validator("ignore_empty"), self.get_validator("unicode_safe"), ], + "help_text": "Select a column for the animation frame", + "type": "str", } def opacity_field(self) -> dict[str, Any]: @@ -634,6 +683,9 @@ def opacity_field(self) -> dict[str, Any]: self.get_validator("default")(1), self.get_validator("float_validator"), ], + "help_text": "Opacity level of the chart", + "type": "float", + "default": 1, } def limit_field(self, default: int = 100, maximum: int = 10000) -> dict[str, Any]: @@ -649,6 +701,9 @@ def limit_field(self, default: int = 100, maximum: int = 10000) -> dict[str, Any self.get_validator("limit_to_configured_maximum")("", maximum), ], "group": "Data", + "help_text": "Limit the number of rows to show in the chart", + "type": "int", + "default": default, } def values_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: @@ -694,6 +749,9 @@ def width_field(self) -> dict[str, Any]: self.get_validator("limit_to_configured_maximum")("", 1000), ], "group": "Data", + "help_text": "Width of the chart", + "type": "int", + "default": 640, } def height_field(self) -> dict[str, Any]: @@ -709,6 +767,9 @@ def height_field(self) -> dict[str, Any]: self.get_validator("limit_to_configured_maximum")("", 1000), ], "group": "Data", + "help_text": "Height of the chart", + "type": "int", + "default": 400, } def more_info_button_field(self) -> dict[str, Any]: @@ -721,11 +782,20 @@ def more_info_button_field(self) -> dict[str, Any]: "label": "More info", "form_snippet": "chart_more_info_button.html", "group": "Data", + "exclude_from_mkdocs": True, } def size_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: field = self.column_field(choices) - field.update({"field_name": "size", "label": "Size", "group": "Structure"}) + field.update( + { + "field_name": "size", + "label": "Size", + "group": "Structure", + "help_text": "Select a column for the size", + "type": "str" + } + ) return field @@ -740,6 +810,7 @@ def filter_field(self, choices: list[dict[str, str]]) -> dict[str, Any]: self.get_validator("unicode_safe"), ], "group": "Filter", + "exclude_from_mkdocs": True, } def engine_details_field(self) -> dict[str, Any]: @@ -751,4 +822,5 @@ def engine_details_field(self) -> dict[str, Any]: "label": "Engine details", "form_snippet": "chart_engine_details.html", "group": "Structure", + "exclude_from_mkdocs": True, } diff --git a/ckanext/charts/chart_builders/chartjs.py b/ckanext/charts/chart_builders/chartjs.py index a853e62..109b6fa 100644 --- a/ckanext/charts/chart_builders/chartjs.py +++ b/ckanext/charts/chart_builders/chartjs.py @@ -24,28 +24,26 @@ def get_supported_forms(cls) -> list[type[Any]]: ChartJSRadarForm, ] - def create_zoom_and_title_options(self, options: str[dict, Any]) -> dict[str, Any]: + def _create_zoom_and_title_options(self, options: dict[str, Any]) -> dict[str, Any]: """Add zoom and title plugin options to the provided options dictionary""" - zoom_options = { - "zoom": { - "wheel": {"enabled": True}, - "pinch": {"enabled": True}, - "drag": {"enabled": True}, - "mode": "xy", - }, - "pan": { - "enabled": True, - "modifierKey": "shift", - "mode": "xy", - }, - } - if "plugins" not in options: options["plugins"] = {} options["plugins"].update( { - "zoom": zoom_options, + "zoom": { + "zoom": { + "wheel": {"enabled": True}, + "pinch": {"enabled": True}, + "drag": {"enabled": True}, + "mode": "xy", + }, + "pan": { + "enabled": True, + "modifierKey": "shift", + "mode": "xy", + }, + }, "title": { "display": True, "position": "bottom", @@ -95,7 +93,7 @@ def _prepare_data(self) -> dict[str, Any]: ) data["data"]["datasets"] = datasets - data["options"] = self.create_zoom_and_title_options(data["options"]) + data["options"] = self._create_zoom_and_title_options(data["options"]) return data @@ -127,7 +125,6 @@ def get_form_fields(self): self.filter_field(columns), ] - class ChartJSHorizontalBarBuilder(ChartJSBarBuilder): def to_json(self) -> str: data = self._prepare_data() @@ -167,7 +164,7 @@ def to_json(self) -> str: "reverse": self.settings.get("invert_y", False), }, } - data["options"] = self.create_zoom_and_title_options(data["options"]) + data["options"] = self._create_zoom_and_title_options(data["options"]) return json.dumps(data) @@ -292,7 +289,7 @@ def to_json(self) -> str: "data": dataset_data, }, ] - data["options"] = self.create_zoom_and_title_options(data["options"]) + data["options"] = self._create_zoom_and_title_options(data["options"]) return json.dumps(self._configure_date_axis(data)) def _configure_date_axis(self, data: dict[str, Any]) -> dict[str, Any]: @@ -377,7 +374,7 @@ def to_json(self) -> str: data["data"]["datasets"] = [ {"label": self.settings["y"], "data": dataset_data}, ] - data["options"] = self.create_zoom_and_title_options(data["options"]) + data["options"] = self._create_zoom_and_title_options(data["options"]) return json.dumps(self._configure_date_axis(data)) diff --git a/ckanext/charts/chart_builders/plotly.py b/ckanext/charts/chart_builders/plotly.py index df5bc9b..75c4e98 100644 --- a/ckanext/charts/chart_builders/plotly.py +++ b/ckanext/charts/chart_builders/plotly.py @@ -14,6 +14,11 @@ class PlotlyBuilder(BaseChartBuilder): + """Base class for Plotly chart builders. + + Defines supported chart types for Plotly engine. + """ + @classmethod def get_supported_forms(cls) -> list[type[Any]]: return [ diff --git a/docs/engines/chartjs.md b/docs/engines/chartjs.md new file mode 100644 index 0000000..6a8c074 --- /dev/null +++ b/docs/engines/chartjs.md @@ -0,0 +1,95 @@ +The `Chart.JS` chart engine supports the following chart types: + +- Bar chart +- Horizontal bar chart +- Line chart +- Pie chart +- Doughnut chart +- Scatter plot +- Bubble chart +- Radar chart + +::: charts.chart_builders.chartjs.ChartJsBuilder + options: + show_source: true + show_bases: false + +## Bar chart + +The bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. For a horizontal bar chart, use the `Horizontal bar chart` chart type. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Bar + +## Horizontal bar chart + +The horizontal bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars are plotted horizontally. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Horizontal Bar + +## Line chart + +The line chart is a chart that displays information as a series of data points called 'markers' connected by straight line segments. It is useful for showing trends over time. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Line + +## Pie chart + +The pie chart is a circular statistical graphic that is divided into slices to illustrate numerical proportions. The arc length of each slice is proportional to the quantity it represents. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Pie + +## Doughnut chart + +The doughnut chart is a variant of the pie chart, with a hole in the center. It is useful for showing the relationship of parts to a whole. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Doughnut + +## Scatter plot + +The scatter plot is a chart that uses Cartesian coordinates to display values for two variables for a set of data. The data points are represented as individual dots. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Scatter + +## Bubble chart + +The bubble chart is a chart that displays data points as bubbles. The size of the bubble represents a third dimension of the data. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Bubble + +## Radar chart + +The radar chart is a chart that displays multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point. The data points are connected by a line to form a polygon. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: chartjs + chart_type: Radar diff --git a/docs/engines/index.md b/docs/engines/index.md index ebb0cad..4a6425e 100644 --- a/docs/engines/index.md +++ b/docs/engines/index.md @@ -4,5 +4,5 @@ Each engine consists of two classes - chart builder and form builder. The chart The form builder is responsible for generating a form that allows users to configure the chart from the UI. -Read more about how to create a custom chart engine in the [documentation](./custom.md). +Also, you can implement support of a chart library of your choice by creating a custom chart engine. Read more about it [here](./custom.md). diff --git a/docs/engines/observable.md b/docs/engines/observable.md new file mode 100644 index 0000000..af5686e --- /dev/null +++ b/docs/engines/observable.md @@ -0,0 +1,73 @@ +The `Observable Plot` chart engine supports the following chart types: + +- Bar chart +- Horizontal bar chart +- Pie chart +- Line chart +- Scatter plot +- Auto chart + +::: charts.chart_builders.observable.ObservableBuilder + options: + show_source: true + show_bases: false + +## Bar chart + +The bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. For a horizontal bar chart, use the `Horizontal bar chart` chart type. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: observable + chart_type: Bar + +## Horizontal bar chart + +The horizontal bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars are plotted horizontally. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: observable + chart_type: Horizontal Bar + +## Line chart + +The line chart is a chart that displays information as a series of data points called 'markers' connected by straight line segments. It is useful for showing trends over time. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: observable + chart_type: Line + +## Pie chart + +The pie chart is a circular statistical graphic that is divided into slices to illustrate numerical proportions. The arc length of each slice is proportional to the quantity it represents. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: observable + chart_type: Pie + +## Scatter plot + +The scatter plot is a chart that uses Cartesian coordinates to display values for two variables for a set of data. The data points are represented as individual dots. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: observable + chart_type: Scatter + +## Auto chart + +The auto chart is a chart that automatically selects the best chart type based on the data. It is useful for quickly visualizing data without having to manually select a chart type. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: observable + chart_type: Auto diff --git a/docs/engines/plotly.md b/docs/engines/plotly.md new file mode 100644 index 0000000..3bd1398 --- /dev/null +++ b/docs/engines/plotly.md @@ -0,0 +1,62 @@ +The `Plotly` chart engine supports the following chart types: + +- Bar chart +- Horizontal bar chart +- Pie chart +- Line chart +- Scatter plot + +::: charts.chart_builders.plotly.PlotlyBuilder + options: + show_source: true + show_bases: false + +## Bar chart + +The bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. For a horizontal bar chart, use the `Horizontal bar chart` chart type. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: plotly + chart_type: Bar + +## Horizontal bar chart + +The horizontal bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars are plotted horizontally. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: plotly + chart_type: Horizontal Bar + +## Line chart + +The line chart is a chart that displays information as a series of data points called 'markers' connected by straight line segments. It is useful for showing trends over time. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: plotly + chart_type: Bar + +## Pie chart + +The pie chart is a circular statistical graphic that is divided into slices to illustrate numerical proportions. The arc length of each slice is proportional to the quantity it represents. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: plotly + chart_type: Pie + +## Scatter plot + +The scatter plot is a chart that uses Cartesian coordinates to display values for two variables for a set of data. The data points are represented as individual dots. + +::: Chart form fields + handler: ChartFieldsHandler + options: + engine: plotly + chart_type: Scatter diff --git a/mkdocs.yml b/mkdocs.yml index 2e14764..6055d93 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,6 +30,8 @@ plugins: show_symbol_type_heading: true show_source: false docstring_section_style: spacy + mkdocstrings_handlers: + handler_config_option: yes - search: separator: '[\s\-\.\_]+' @@ -81,6 +83,9 @@ nav: - Engines: - engines/index.md + - engines/plotly.md + - engines/chartjs.md + - engines/observable.md - engines/custom.md - Caching: diff --git a/mkdocstrings_handlers/ChartFieldsHandler/__init__.py b/mkdocstrings_handlers/ChartFieldsHandler/__init__.py new file mode 100644 index 0000000..85118d8 --- /dev/null +++ b/mkdocstrings_handlers/ChartFieldsHandler/__init__.py @@ -0,0 +1,3 @@ +from .handler import get_handler + +__all__ = ["get_handler"] diff --git a/mkdocstrings_handlers/ChartFieldsHandler/handler.py b/mkdocstrings_handlers/ChartFieldsHandler/handler.py new file mode 100644 index 0000000..ceb97ea --- /dev/null +++ b/mkdocstrings_handlers/ChartFieldsHandler/handler.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +import os +import importlib +from typing import Mapping, MutableMapping, Any +from unittest.mock import patch, MagicMock + +from mkdocstrings.handlers.base import BaseHandler, CollectorItem + +from ckan.config.middleware import make_app +from ckan.cli import CKANConfigLoader + +from ckanext.charts.utils import get_chart_form_builder + +config_path = os.environ["CKAN_INI"] + +if not os.path.exists(config_path): + raise RuntimeError("CKAN config file not found: {}".format(config_path)) + + +class ChartFieldsHandler(BaseHandler): + """Custom handler for documenting the chart engine fields according to the + form fields schema.""" + def collect( + self, identifier: str, config: MutableMapping[str, Any] + ) -> CollectorItem: + if not os.environ.get("CHARTS_FIELDS"): + return {} + + if "engine" not in config or "chart_type" not in config: + return {} + + # init CKAN, because we're using helpers and validators in get_form_fields + ckan_config = CKANConfigLoader(config_path).get_config() + make_app(ckan_config) + + # mock the fetcher, cause we don't have a resource to fetch data from + mock = MagicMock() + patcher = patch("ckanext.charts.fetchers.DatastoreDataFetcher", mock) + patcher.start() + mock.fetch_data.return_value = {} + + form_builder = get_chart_form_builder(config["engine"], config["chart_type"])( + "xxx" + ) + + return { + "fields": form_builder.get_form_fields(), + } + + def render(self, data: CollectorItem, config: Mapping[str, Any]) -> str: + if not data.get("fields"): + return "" + + return self.env.get_template("fields.html").render( + **{ + "fields": data["fields"], + }, + ) + + +def get_handler(**kwargs: Any) -> ChartFieldsHandler: + return ChartFieldsHandler(handler="ChartFieldsHandler", theme=kwargs["theme"]) diff --git a/mkdocstrings_handlers/ChartFieldsHandler/templates/material/fields.html b/mkdocstrings_handlers/ChartFieldsHandler/templates/material/fields.html new file mode 100644 index 0000000..a4fe2c8 --- /dev/null +++ b/mkdocstrings_handlers/ChartFieldsHandler/templates/material/fields.html @@ -0,0 +1,29 @@ +{% for field in fields %} + {% if not field.exclude_from_mkdocs %} +
+

+ {{ field.label }} + ({{ field.field_name }}) + + {% if field.required %} + [Required] + {% endif %} +

+

{{ field.help_text }}

+

Type: {{ field.type }}

+ + {% if field.default %} +

Default: {{ field.default }}

+ {% endif %} + + {% if field.choices %} +

Choices: + {% for choice in field.choices %} + {{ choice.label or choice.text }}{% if not loop.last %}, {% endif %} + {% endfor %} +

+ {% endif %} +
+
+ {% endif %} +{% endfor %} diff --git a/pyproject.toml b/pyproject.toml index 9624a44..e036bec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ ] license = {text = "AGPL"} requires-python = ">=3.8" -version = "1.1.1.post1" +version = "1.1.2" [project.optional-dependencies] pyarrow = ["pyarrow>=16.0.0,<17.0.0"] diff --git a/site/404.html b/site/404.html index 20a9c4b..7a1d7bb 100644 --- a/site/404.html +++ b/site/404.html @@ -12,7 +12,7 @@ - + @@ -336,6 +336,12 @@ + + + + + + @@ -384,6 +390,69 @@ +
  • + + + + + Plotly + + + + +
  • + + + + + + + + + + +
  • + + + + + Chartjs + + + + +
  • + + + + + + + + + + +
  • + + + + + Observable + + + + +
  • + + + + + + + + + +
  • diff --git a/site/assets/_mkdocstrings.css b/site/assets/_mkdocstrings.css index b500381..8b83f70 100644 --- a/site/assets/_mkdocstrings.css +++ b/site/assets/_mkdocstrings.css @@ -26,33 +26,20 @@ float: right; } -/* Parameter headings must be inline, not blocks. */ -.doc-heading-parameter { - display: inline; -} - -/* Prefer space on the right, not the left of parameter permalinks. */ -.doc-heading-parameter .headerlink { - margin-left: 0 !important; - margin-right: 0.2rem; -} - /* Backward-compatibility: docstring section titles in bold. */ .doc-section-title { font-weight: bold; } /* Symbols in Navigation and ToC. */ -:root, :host, +:root, [data-md-color-scheme="default"] { - --doc-symbol-parameter-fg-color: #df50af; --doc-symbol-attribute-fg-color: #953800; --doc-symbol-function-fg-color: #8250df; --doc-symbol-method-fg-color: #8250df; --doc-symbol-class-fg-color: #0550ae; --doc-symbol-module-fg-color: #5cad0f; - --doc-symbol-parameter-bg-color: #df50af1a; --doc-symbol-attribute-bg-color: #9538001a; --doc-symbol-function-bg-color: #8250df1a; --doc-symbol-method-bg-color: #8250df1a; @@ -61,14 +48,12 @@ } [data-md-color-scheme="slate"] { - --doc-symbol-parameter-fg-color: #ffa8cc; --doc-symbol-attribute-fg-color: #ffa657; --doc-symbol-function-fg-color: #d2a8ff; --doc-symbol-method-fg-color: #d2a8ff; --doc-symbol-class-fg-color: #79c0ff; --doc-symbol-module-fg-color: #baff79; - --doc-symbol-parameter-bg-color: #ffa8cc1a; --doc-symbol-attribute-bg-color: #ffa6571a; --doc-symbol-function-bg-color: #d2a8ff1a; --doc-symbol-method-bg-color: #d2a8ff1a; @@ -83,15 +68,6 @@ code.doc-symbol { font-weight: bold; } -code.doc-symbol-parameter { - color: var(--doc-symbol-parameter-fg-color); - background-color: var(--doc-symbol-parameter-bg-color); -} - -code.doc-symbol-parameter::after { - content: "param"; -} - code.doc-symbol-attribute { color: var(--doc-symbol-attribute-fg-color); background-color: var(--doc-symbol-attribute-bg-color); @@ -141,3 +117,4 @@ code.doc-symbol-module::after { color: inherit; border-bottom: 1px dotted currentcolor; } + diff --git a/site/caching/base/index.html b/site/caching/base/index.html index bd28922..c8ed579 100644 --- a/site/caching/base/index.html +++ b/site/caching/base/index.html @@ -18,7 +18,7 @@ - + @@ -347,6 +347,12 @@ + + + + + + @@ -395,6 +401,69 @@ +
  • + + + + + Plotly + + + + +
  • + + + + + + + + + + +
  • + + + + + Chartjs + + + + +
  • + + + + + + + + + + +
  • + + + + + Observable + + + + +
  • + + + + + + + + + +
  • @@ -1002,11 +1071,6 @@

    Base Cache Strategy

    - - - - -
    @@ -1044,9 +1108,7 @@

    - - key - + key

    The cache key to retrieve the data.

    @@ -1117,9 +1179,7 @@

    - - key - + key

    The cache key to invalidate.

    @@ -1166,9 +1226,7 @@

    - - key - + key

    The cache key to store the data.

    @@ -1182,9 +1240,7 @@

    - - data - + data

    The data to be stored.

    diff --git a/site/caching/file/index.html b/site/caching/file/index.html index 442828d..f02ae3f 100644 --- a/site/caching/file/index.html +++ b/site/caching/file/index.html @@ -18,7 +18,7 @@ - + @@ -347,6 +347,12 @@ + + + + + + @@ -395,6 +401,69 @@ +
  • + + + + + Plotly + + + + +
  • + + + + + + + + + + +
  • + + + + + Chartjs + + + + +
  • + + + + + + + + + + +
  • + + + + + Observable + + + + +
  • + + + + + + + + + +
  • @@ -1214,11 +1283,6 @@

    - - - - -
    @@ -1252,9 +1316,7 @@

    - - key - + key

    The cache key to generate the filename.

    @@ -1321,9 +1383,7 @@

    - - key - + key

    The cache key to retrieve the data.

    @@ -1390,9 +1450,7 @@

    - - key - + key

    The cache key to invalidate.

    @@ -1440,9 +1498,7 @@

    - - file_path - + file_path

    The path to the file.

    @@ -1509,9 +1565,7 @@

    - - key - + key

    The cache key to generate the file path.

    @@ -1582,9 +1636,7 @@

    - - file - + file

    The file object to read the data.

    @@ -1651,9 +1703,7 @@

    - - key - + key

    The cache key to store the data.

    @@ -1667,9 +1717,7 @@

    - - data - + data

    The data to be stored.

    @@ -1716,9 +1764,7 @@

    - - file_path - + file_path

    The path to the file.

    @@ -1732,9 +1778,7 @@

    - - data - + data

    The data to be stored.

    @@ -1783,11 +1827,6 @@

    - - - - -
    @@ -1821,9 +1860,7 @@

    - - file - + file

    The file object to read the data.

    @@ -1890,9 +1927,7 @@

    - - file_path - + file_path

    The path to the file.

    @@ -1906,9 +1941,7 @@

    - - data - + data

    The data to be stored.

    @@ -1957,11 +1990,6 @@

    - - - - -
    @@ -1995,9 +2023,7 @@

    - - file - + file

    The file object to read the data.

    @@ -2064,9 +2090,7 @@

    - - file_path - + file_path

    The path to the file.

    @@ -2080,9 +2104,7 @@

    - - data - + data

    The data to be stored.

    diff --git a/site/caching/index.html b/site/caching/index.html index d5bf20d..746507b 100644 --- a/site/caching/index.html +++ b/site/caching/index.html @@ -18,7 +18,7 @@ - + @@ -347,6 +347,12 @@ + + + + + + @@ -395,6 +401,69 @@ +
  • + + + + + Plotly + + + + +
  • + + + + + + + + + + +
  • + + + + + Chartjs + + + + +
  • + + + + + + + + + + +
  • + + + + + Observable + + + + +
  • + + + + + + + + + +
  • diff --git a/site/caching/redis/index.html b/site/caching/redis/index.html index f460c5a..1a9e285 100644 --- a/site/caching/redis/index.html +++ b/site/caching/redis/index.html @@ -18,7 +18,7 @@ - + @@ -347,6 +347,12 @@ + + + + + + @@ -395,6 +401,69 @@ +
  • + + + + + Plotly + + + + +
  • + + + + + + + + + + +
  • + + + + + Chartjs + + + + +
  • + + + + + + + + + + +
  • + + + + + Observable + + + + +
  • + + + + + + + + + +
  • @@ -955,11 +1024,6 @@

    Redis Cache

    - - - - -
    @@ -993,9 +1057,7 @@

    - - key - + key

    The cache key to retrieve the data.

    @@ -1062,9 +1124,7 @@

    - - key - + key

    The cache key to invalidate.

    @@ -1107,9 +1167,7 @@

    - - key - + key

    The cache key to store the data.

    @@ -1123,9 +1181,7 @@

    - - data - + data

    The data to be stored.

    diff --git a/site/configuration/index.html b/site/configuration/index.html index 75e4063..7043b71 100644 --- a/site/configuration/index.html +++ b/site/configuration/index.html @@ -18,7 +18,7 @@ - + @@ -470,6 +470,12 @@ + + + + + + @@ -518,6 +524,69 @@ +
  • + + + + + Plotly + + + + +
  • + + + + + + + + + + +
  • + + + + + Chartjs + + + + +
  • + + + + + + + + + + +
  • + + + + + Observable + + + + +
  • + + + + + + + + + +
  • diff --git a/site/engines/chartjs/index.html b/site/engines/chartjs/index.html new file mode 100644 index 0000000..ebe5304 --- /dev/null +++ b/site/engines/chartjs/index.html @@ -0,0 +1,2906 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Chartjs - ckanext-charts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + +

    Chartjs

    + +

    The Chart.JS chart engine supports the following chart types:

    +
      +
    • Bar chart
    • +
    • Horizontal bar chart
    • +
    • Line chart
    • +
    • Pie chart
    • +
    • Doughnut chart
    • +
    • Scatter plot
    • +
    • Bubble chart
    • +
    • Radar chart
    • +
    + + +
    + + + + +
    + + +
    + Source code in ckanext/charts/chart_builders/chartjs.py +
    13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    class ChartJsBuilder(BaseChartBuilder):
    +    @classmethod
    +    def get_supported_forms(cls) -> list[type[Any]]:
    +        return [
    +            ChartJSBarForm,
    +            ChartJSHorizontalBarForm,
    +            ChartJSLineForm,
    +            ChartJSPieForm,
    +            ChartJSDoughnutForm,
    +            ChartJSScatterForm,
    +            ChartJSBubbleForm,
    +            ChartJSRadarForm,
    +        ]
    +
    +    def _create_zoom_and_title_options(self, options: dict[str, Any]) -> dict[str, Any]:
    +        """Add zoom and title plugin options to the provided options dictionary"""
    +        if "plugins" not in options:
    +            options["plugins"] = {}
    +
    +        options["plugins"].update(
    +            {
    +                "zoom": {
    +                    "zoom": {
    +                        "wheel": {"enabled": True},
    +                        "pinch": {"enabled": True},
    +                        "drag": {"enabled": True},
    +                        "mode": "xy",
    +                    },
    +                    "pan": {
    +                        "enabled": True,
    +                        "modifierKey": "shift",
    +                        "mode": "xy",
    +                    },
    +                },
    +                "title": {
    +                    "display": True,
    +                    "position": "bottom",
    +                },
    +            },
    +        )
    +        return options
    +
    +
    + + + +
    + + + + + + + + + + + +
    + +
    + +

    Bar chart

    +

    The bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. For a horizontal bar chart, use the Horizontal bar chart chart type.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + X Axis + (x) + + + [Required] + +

    +

    Select a column for the X-axes

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Y Axis + (y) + + + [Required] + +

    +

    Select one or more columns for the Y-axis

    +

    Type: List[str]

    + + + + +
    +
    + + + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + +

    Horizontal bar chart

    +

    The horizontal bar chart is a chart with rectangular bars with lengths proportional to the values that they represent. The bars are plotted horizontally.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + X Axis + (x) + + + [Required] + +

    +

    Select a column for the X-axes

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Y Axis + (y) + + + [Required] + +

    +

    Select one or more columns for the Y-axis

    +

    Type: List[str]

    + + + + +
    +
    + + + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + +

    Line chart

    +

    The line chart is a chart that displays information as a series of data points called 'markers' connected by straight line segments. It is useful for showing trends over time.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + X Axis + (x) + + + [Required] + +

    +

    Select a column for the X-axes

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Y Axis + (y) + + + [Required] + +

    +

    Select one or more columns for the Y-axis

    +

    Type: List[str]

    + + + + +
    +
    + + + + + +
    +

    + Sort X-axis + (sort_x) + + +

    +

    Sort the X-axis values

    +

    Type: bool

    + + + + +
    +
    + + + +
    +

    + Sort Y-axis + (sort_y) + + +

    +

    Sort the Y-axis values

    +

    Type: bool

    + + + + +
    +
    + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + +
    +

    + Invert X-axis + (invert_x) + + +

    +

    Invert the X-axis

    +

    Type: bool

    + + + + +
    +
    + + + +
    +

    + Invert Y-axis + (invert_y) + + +

    +

    Invert the Y-axis

    +

    Type: bool

    + + + + +
    +
    + + + +

    Pie chart

    +

    The pie chart is a circular statistical graphic that is divided into slices to illustrate numerical proportions. The arc length of each slice is proportional to the quantity it represents.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + Values + (values) + + + [Required] + +

    +

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Names + (names) + + + [Required] + +

    +

    +

    Type: str

    + + + + +
    +
    + + + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + +

    Doughnut chart

    +

    The doughnut chart is a variant of the pie chart, with a hole in the center. It is useful for showing the relationship of parts to a whole.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + Values + (values) + + + [Required] + +

    +

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Names + (names) + + + [Required] + +

    +

    +

    Type: str

    + + + + +
    +
    + + + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + +

    Scatter plot

    +

    The scatter plot is a chart that uses Cartesian coordinates to display values for two variables for a set of data. The data points are represented as individual dots.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + X Axis + (x) + + + [Required] + +

    +

    Select a column for the X-axes

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Y Axis + (y) + + + [Required] + +

    +

    Select a column for the Y-axis

    +

    Type: str

    + + + + +
    +
    + + + + + +
    +

    + Sort X-axis + (sort_x) + + +

    +

    Sort the X-axis values

    +

    Type: bool

    + + + + +
    +
    + + + +
    +

    + Sort Y-axis + (sort_y) + + +

    +

    Sort the Y-axis values

    +

    Type: bool

    + + + + +
    +
    + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + +

    Bubble chart

    +

    The bubble chart is a chart that displays data points as bubbles. The size of the bubble represents a third dimension of the data.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + X Axis + (x) + + + [Required] + +

    +

    Select a column for the X-axes

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Y Axis + (y) + + + [Required] + +

    +

    Select a column for the Y-axis

    +

    Type: str

    + + + + +
    +
    + + + + + +
    +

    + Sort X-axis + (sort_x) + + +

    +

    Sort the X-axis values

    +

    Type: bool

    + + + + +
    +
    + + + +
    +

    + Sort Y-axis + (sort_y) + + +

    +

    Sort the Y-axis values

    +

    Type: bool

    + + + + +
    +
    + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + + + +
    +

    + Size + (size) + + + [Required] + +

    +

    Select a column for the size

    +

    Type: str

    + + + + +
    +
    + +

    Radar chart

    +

    The radar chart is a chart that displays multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point. The data points are connected by a line to form a polygon.

    + + +
    +

    + Title + (title) + + +

    +

    Title of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Description + (description) + + +

    +

    Description of the chart view

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Engine + (engine) + + + [Required] + +

    +

    Select the chart engine to use

    +

    Type: str

    + + +

    Default: plotly

    + + + +

    Choices: + + plotly, + + observable, + + chartjs + +

    + +
    +
    + + + +
    +

    + Type + (type) + + + [Required] + +

    +

    Select the type of the chart, e.g. Line, Bar, Scatter, etc.

    +

    Type: str

    + + +

    Default: Line

    + + + +

    Choices: + + Bar, + + Horizontal Bar, + + Line, + + Pie, + + Doughnut, + + Scatter, + + Bubble, + + Radar + +

    + +
    +
    + + + + + +
    +

    + Names + (names) + + + [Required] + +

    +

    +

    Type: str

    + + + + +
    +
    + + + +
    +

    + Values + (values) + + + [Required] + +

    +

    Select 3 or more different categorical variables (dimensions)

    +

    Type: List[str]

    + + + + +
    +
    + + + + + +
    +

    + Limit + (limit) + + +

    +

    Limit the number of rows to show in the chart

    +

    Type: int

    + + +

    Default: 100

    + + + +
    +
    + + + + + + + + + + + + + +
    +
    + + + +
    + + + +
    + + + +
    +
    +
    +
    + +
    + + + + + + + + + + \ No newline at end of file diff --git a/site/engines/custom/index.html b/site/engines/custom/index.html index caaf990..18c8a8f 100644 --- a/site/engines/custom/index.html +++ b/site/engines/custom/index.html @@ -11,14 +11,14 @@ - + - + @@ -349,6 +349,12 @@ + + + + + + @@ -395,6 +401,69 @@ + + +
  • + + + + + Plotly + + + + +
  • + + + + + + + + + + +
  • + + + + + Chartjs + + + + +
  • + + + + + + + + + + +
  • + + + + + Observable + + + + +
  • + + + + + + + + @@ -1097,7 +1166,7 @@

    HTML container