Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Feb 20, 2024
1 parent ec2f422 commit ef807c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shinyecharts/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def set_data(self, data: DataFrame | dict) -> Chart:
return self

def add_series(self, series: dict) -> Chart:
"""Add series attribute of option object"""
if SeriesType(series["type"]).value == "bar":
self._option["xAxis"] = dict(type="category")

Expand All @@ -76,7 +77,7 @@ def encode(
type: SeriesType | str = SeriesType.LINE,
**kwargs,
) -> Chart:
"""Add series to option object"""
"""Add series attribute to option object"""
series = dict(name=y, type=type, encode=dict(x=x, y=y)) | kwargs
self.add_series(series)
return self
Expand All @@ -87,6 +88,7 @@ def set_option(self, option: dict | ChartOption | BaseOption) -> Chart:
return self

def to_dict(self) -> dict:
# TODO: Create dataset when setting 'self._data'
dataset = (
df_to_dataset(self._data) if isinstance(self._data, DataFrame) else dict()
)
Expand Down
4 changes: 4 additions & 0 deletions shinyecharts/express.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ==========================
# TODO: Module is DEPRECATED
# ==========================

from __future__ import annotations

from pandas import DataFrame
Expand Down

0 comments on commit ef807c2

Please sign in to comment.