Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9492d17
Add custom Jinja templates for mkdocstrings
FeodorFitsner Aug 20, 2025
d8c9ef7
Remove "python" templates
FeodorFitsner Aug 21, 2025
c932160
Create placeholder.txt
FeodorFitsner Aug 21, 2025
aae30b4
Original mkdocs templates
FeodorFitsner Aug 21, 2025
94c9768
Customized templates
FeodorFitsner Aug 21, 2025
7f70866
Updated mkdocs settings and extra css
FeodorFitsner Aug 21, 2025
3524976
Improve chart docs and PlotlyChart docstring formatting
FeodorFitsner Aug 21, 2025
2635b9e
Update doc symbol styles and TOC entry settings
FeodorFitsner Aug 22, 2025
af47320
Update docs and styles for platform support and branding
FeodorFitsner Aug 22, 2025
30b7dca
Update logo.svg with new design and dimensions
FeodorFitsner Aug 22, 2025
4bf2f1a
Better logo
FeodorFitsner Aug 22, 2025
b220f8c
Update Material Symbols font settings in CSS
FeodorFitsner Aug 22, 2025
42633ba
Enable summary by default for all classes
FeodorFitsner Aug 23, 2025
599e636
Update logo.svg
FeodorFitsner Aug 23, 2025
50b84c7
Refactor chart controls to use LayoutControl
FeodorFitsner Sep 24, 2025
2ad8250
Merge branch 'main' into custom-templates
FeodorFitsner Sep 24, 2025
d3b377b
Remove docs workflow and update documentation link
FeodorFitsner Sep 24, 2025
f452b5e
Add GitHub repo icon to MkDocs theme
FeodorFitsner Sep 24, 2025
1093cd1
Update copyright and theme settings in mkdocs.yml
FeodorFitsner Sep 24, 2025
532cded
Refactor chart docs to use macros for class rendering
FeodorFitsner Sep 24, 2025
0f395fd
Rename 'screenshot' to 'image' in chart docs
FeodorFitsner Sep 24, 2025
3bf83a5
Rename screenshot argument to image in class_summary macro
FeodorFitsner Sep 24, 2025
f0c756a
Hide Material for MkDocs generator message
FeodorFitsner Sep 24, 2025
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
48 changes: 0 additions & 48 deletions .github/workflows/docs.yml

This file was deleted.

18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,15 @@ It is based on the [fl_chart](https://pub.dev/packages/fl_chart) Flutter package

## Documentation

Detailed documentation to this package can be found [here](https://flet-dev.github.io/flet-charts/).
Detailed documentation to this package can be found [here](https://flet-charts.docs.flet.dev/).

## Platform Support

This package supports the following platforms:

| Platform | Supported |
|----------|:---------:|
| Windows | ✅ |
| macOS | ✅ |
| Linux | ✅ |
| iOS | ✅ |
| Android | ✅ |
| Web | ✅ |
| Platform | Windows | macOS | Linux | iOS | Android | Web |
|----------|---------|-------|-------|-----|---------|-----|
| Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |

## Usage

Expand All @@ -42,11 +37,6 @@ To install the `flet-charts` package and add it to your project dependencies:
```
After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.

- Using `poetry`:
```bash
poetry add flet-charts
```

### Examples

For examples, see [these](./examples).
9 changes: 8 additions & 1 deletion docs/bar_chart.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
class_name: flet_charts.bar_chart.BarChart
image: assets/bar-chart-diagram.svg
---

{{ class_summary(class_name, image) }}

## Examples

### Example 1
Expand All @@ -20,4 +27,4 @@
--8<-- "examples/charts_example/src/bar_chart/example_2.py"
```

::: flet_charts.bar_chart.BarChart
{{ class_members(class_name) }}
2 changes: 1 addition & 1 deletion docs/bar_chart_group.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: flet_charts.bar_chart_group.BarChartGroup
{{ class_all_options("flet_charts.bar_chart_group.BarChartGroup") }}
2 changes: 1 addition & 1 deletion docs/bar_chart_rod.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: flet_charts.bar_chart_rod.BarChartRod
{{ class_all_options("flet_charts.bar_chart_rod.BarChartRod") }}
2 changes: 1 addition & 1 deletion docs/bar_chart_rod_stack_item.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: flet_charts.bar_chart_rod_stack_item.BarChartRodStackItem
{{ class_all_options("flet_charts.bar_chart_rod_stack_item.BarChartRodStackItem") }}
2 changes: 1 addition & 1 deletion docs/chart_axis.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: flet_charts.chart_axis.ChartAxis
{{ class_all_options("flet_charts.chart_axis.ChartAxis") }}
2 changes: 1 addition & 1 deletion docs/chart_axis_label.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: flet_charts.chart_axis.ChartAxisLabel
{{ class_all_options("flet_charts.chart_axis.ChartAxisLabel") }}
88 changes: 88 additions & 0 deletions docs/extras/css/mkdocstrings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* Material Symbols font with selected icons */
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,200,1,200&icon_names=account_tree,bolt,build,category,deployed_code");

/* Hide the original label text */
code.doc-symbol { font-size: 0; }

/* Show only the icon */
code.doc-symbol::before {
font-family: "Material Symbols Outlined";
font-variation-settings: 'FILL' 1, 'GRAD' 200, 'opsz' 24, 'wght' 200;
font-size: .82rem;
position: relative;
top: .25em;
}

.doc-heading .doc-symbol::before {
font-size: 1.0rem;
top: .21em;
}

code.doc-symbol-class::before {
content: "category";
}

code.doc-symbol-attribute::before {
content: "build";
}

code.doc-symbol-event::before {
content: "bolt";
}

code.doc-symbol-method::before {
content: "deployed_code";
}

/* Overrides */
[data-md-color-scheme="default"] {
--doc-symbol-class-fg-color: #f0a502;
--doc-symbol-attribute-fg-color: #0b8dd9; /* ae106f */
--doc-symbol-attribute-bg-color: #9500721a;

--doc-symbol-event-fg-color: #f8aa01;
--doc-symbol-event-bg-color: #e5ff001a;
}

[data-md-color-scheme="slate"] {
--doc-symbol-class-fg-color: #f0a502;
--doc-symbol-attribute-fg-color: #0b8dd9; /* ae106f */
--doc-symbol-attribute-bg-color: #9500721a;

--doc-symbol-event-fg-color: #f8aa01;
--doc-symbol-event-bg-color: #e5ff001a;
}

code.doc-symbol-event,
a code.doc-symbol-event {
color: var(--doc-symbol-event-fg-color);
background-color: var(--doc-symbol-event-bg-color);
}

/* Overrides */

/* Command symbol */
:root, :host,
/* Light mode */
[data-md-color-scheme="default"] {
--doc-symbol-command-fg-color: #9538001;
--doc-symbol-command-bg-color: #9538001a;
}

/* Dark mode */
[data-md-color-scheme="slate"] {
--doc-symbol-command-fg-color: #ffa6571;
--doc-symbol-command-bg-color: #ffa6571a;
}

code.doc-symbol-command,
a code.doc-symbol-command {
color: var(--doc-symbol-command-fg-color);
background-color: var(--doc-symbol-command-bg-color);
}

code.doc-symbol-command::after {
content: "cmd";
}

/* Command symbol */
46 changes: 46 additions & 0 deletions docs/extras/macros/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
def define_env(env):
@env.macro
def class_all_options(class_name, separate_signature=True):
return f"""
::: {class_name}
options:
show_root_toc_entry: true
show_bases: true
separate_signature: {str(separate_signature).lower()}
extra:
show_class_docstring: true
show_children: true
summary:
attributes: true
functions: true
"""

@env.macro
def class_summary(class_name, image=None):
control_name = class_name.split(".")[-1]
image_md = f"\n\n![{control_name}]({image})\n\n" if image else ""
return f"""
::: {class_name}
options:
show_root_toc_entry: true
extra:
show_class_docstring: true

{image_md}

::: {class_name}
options:
show_bases: true
summary:
attributes: true
functions: true
"""

@env.macro
def class_members(class_name):
return f"""
::: {class_name}
options:
extra:
show_children: true
"""
48 changes: 29 additions & 19 deletions docs/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 6 additions & 16 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# flet-charts
# Getting started

[![pypi](https://img.shields.io/pypi/v/flet-charts.svg)](https://pypi.python.org/pypi/flet-charts)
[![downloads](https://static.pepy.tech/badge/flet-charts/month)](https://pepy.tech/project/flet-charts)
[![license](https://img.shields.io/github/license/flet-dev/flet-charts.svg)](https://github.com/flet-dev/flet-charts/blob/main/LICENSE)

A [Flet](https://flet.dev) extension for creating interactive charts and graphs.
`flet-charts` is a [Flet](https://flet.dev) extension for creating interactive charts and graphs.

It is based on the [fl_chart](https://pub.dev/packages/fl_chart) Flutter package.

## Platform Support

This package supports the following platforms:
This package is supported on the following platforms:

| Platform | Supported |
|----------|:---------:|
| Windows | ✅ |
| macOS | ✅ |
| Linux | ✅ |
| iOS | ✅ |
| Android | ✅ |
| Web | ✅ |
| Windows | macOS | Linux | iOS | Android | Web |
|---------|-------|-------|-----|---------|-----|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |

## Usage

Expand All @@ -39,11 +34,6 @@ To install the `flet-charts` package and add it to your project dependencies:

1. After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.

=== "poetry"
```bash
poetry add flet-charts
```

## Examples

You can find examples in the respective documentation pages for each chart type:
Expand Down
9 changes: 8 additions & 1 deletion docs/line_chart.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
class_name: flet_charts.line_chart.LineChart
image: assets/line-chart-diagram.svg
---

{{ class_summary(class_name, image) }}

## Examples

### Example 1
Expand All @@ -20,4 +27,4 @@
--8<-- "examples/charts_example/src/line_chart/example_2.py"
```

::: flet_charts.line_chart.LineChart
{{ class_members(class_name) }}
2 changes: 1 addition & 1 deletion docs/line_chart_data.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: flet_charts.line_chart_data.LineChartData
{{ class_all_options("flet_charts.line_chart_data.LineChartData") }}
2 changes: 1 addition & 1 deletion docs/line_chart_data_point.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: flet_charts.line_chart_data_point.LineChartDataPoint
{{ class_all_options("flet_charts.line_chart_data_point.LineChartDataPoint") }}
Loading