Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- Added | Changed | Deprecated | Removed | Fixed -->

## [0.2.0] - 2025-01-23

### Added

- PyPalettes library dependency, providing 2500+ palettes.
- Colormap reverse flag parameter added to dataclock function.
- Chart polar spine color parameter added to dataclock.
- Chart polar grid color parameter added to dataclock.

### Changed

- Wedge label logic moved to `dataclocklib.utility.add_wedge_labels`.
- Temporal aggregation logic moved to `dataclocklib.utility.aggregate_temporal_columns`.

## [0.1.8] - 2025-01-20

### Added
Expand All @@ -26,7 +40,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved colorbar logic to `dataclocklib.utility.add_colorbar`.
- Dataclock arguments; `chart_title`, `chart_subtitle`, `chart_period`, `chart_source` are keyword only.


## [0.1.7] - 2025-01-15

### Added
Expand Down
81 changes: 63 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,62 @@ data = pd.read_parquet(
"https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

graph_data, fig, ax = dataclock(
data=data.query("Date_Time.dt.year.eq(2015)"),
chart_data, fig, ax = dataclock(
data=data,
date_column="Date_Time",
mode="DOW_HOUR",
spine_color="darkslategrey",
grid_color="black",
default_text=False
)
```

![Data clock chart](https://raw.githubusercontent.com/andyrids/dataclocklib/main/docs/source/_static/images/sphinx_guide_chart_1.png)

```python
import pandas as pd
from dataclocklib.charts import dataclock

data = pd.read_parquet(
"https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

chart_data, fig, ax = dataclock(
data=data,
date_column="Date_Time",
mode="DOW_HOUR",
spine_color="darkslategrey",
grid_color="black",
default_text=True
)
```

![Data clock chart](https://raw.githubusercontent.com/andyrids/dataclocklib/main/docs/source/_static/images/sphinx_guide_chart_2.png)

```python
import pandas as pd
from dataclocklib.charts import dataclock

data = pd.read_parquet(
"https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

chart_data, fig, ax = dataclock(
data=data,
date_column="Date_Time",
agg_column="Number_of_Casualties",
agg="sum",
mode="DOW_HOUR",
cmap_name="CMRmap_r",
chart_title="UK Traffic Accident Casualties",
chart_subtitle=None,
chart_period="Period: 2015",
chart_source="www.kaggle.com/datasets/silicon99/dft-accident-data",
default_text=True,
spine_color="darkslategrey",
grid_color="black",
chart_title="**CUSTOM TITLE**",
chart_subtitle="**CUSTOM SUBTITLE**",
chart_period="**CUSTOM PERIOD**",
chart_source="Source: UK Department for Transport",
dpi=150
)
```

![Data clock chart](https://raw.githubusercontent.com/andyrids/dataclocklib/main/docs/source/_static/images/sphinx_index_chart_1.png)
![Data clock chart](https://raw.githubusercontent.com/andyrids/dataclocklib/main/docs/source/_static/images/sphinx_guide_chart_3.png)

```python
import pandas as pd
Expand All @@ -60,22 +100,27 @@ data = pd.read_parquet(
"https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

graph_data, fig, ax = dataclock(
chart_data, fig, ax = dataclock(
data=data.query("Date_Time.dt.year.eq(2010)"),
date_column="Date_Time",
agg_column=None,
agg="count",
agg_column="Number_of_Casualties",
agg="sum",
mode="DOW_HOUR",
cmap_name="RdYlGn_r",
chart_title="UK Traffic Accidents",
cmap_name="X26",
cmap_reverse=True,
spine_color="honeydew",
grid_color="honeydew",
default_text=True,
chart_title="UK Traffic Accident Casualties",
chart_subtitle=None,
chart_period="Period: 2010",
chart_source="www.kaggle.com/datasets/silicon99/dft-accident-data",
default_text=True,
chart_source="Source: https://data.dft.gov.uk/road-accidents-safety-data/dft-road-casualty-statistics-collision-last-5-years.csv",
dpi=300
)
```

![Data clock chart](https://raw.githubusercontent.com/andyrids/dataclocklib/main/docs/source/_static/images/sphinx_index_chart_2.png)
![Data clock chart](https://raw.githubusercontent.com/andyrids/dataclocklib/main/docs/source/_static/images/sphinx_guide_chart_4.png)


## Installation

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
198 changes: 127 additions & 71 deletions docs/source/guide.ipynb

Large diffs are not rendered by default.

94 changes: 29 additions & 65 deletions docs/source/tutorial.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ keywords = ["matplotlib", "dataclock", "visualisation", "analysis"]
dependencies = [
"matplotlib",
"pandas[parquet]>=2.2.2",
"pypalettes>=0.1.5",
]

[dependency-groups]
Expand Down
Loading
Loading