diff --git a/.gitignore b/.gitignore index 2e74f6d1..53515fb6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,11 +9,12 @@ dist vizzu-lib -.venv +.venv* .pdm-python .tox .coverage +placeholder-plugin.yaml site .chromium node_modules diff --git a/docs/environments/bi/mode.md b/docs/environments/bi/mode.md index c735c824..3764b616 100644 --- a/docs/environments/bi/mode.md +++ b/docs/environments/bi/mode.md @@ -60,7 +60,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/ide/pycharm.md b/docs/environments/ide/pycharm.md index 0dd91407..0360c895 100644 --- a/docs/environments/ide/pycharm.md +++ b/docs/environments/ide/pycharm.md @@ -66,7 +66,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/ide/vscode.md b/docs/environments/ide/vscode.md index 0a9d6adc..1b190dfd 100644 --- a/docs/environments/ide/vscode.md +++ b/docs/environments/ide/vscode.md @@ -66,7 +66,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/notebook/colab.md b/docs/environments/notebook/colab.md index f5e63457..e1852725 100644 --- a/docs/environments/notebook/colab.md +++ b/docs/environments/notebook/colab.md @@ -64,7 +64,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/notebook/databricks.md b/docs/environments/notebook/databricks.md index b11f7f85..0589aaa1 100644 --- a/docs/environments/notebook/databricks.md +++ b/docs/environments/notebook/databricks.md @@ -64,7 +64,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/notebook/datacamp.md b/docs/environments/notebook/datacamp.md index e0c10651..616ef2ed 100644 --- a/docs/environments/notebook/datacamp.md +++ b/docs/environments/notebook/datacamp.md @@ -65,7 +65,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) chart.animate(data) diff --git a/docs/environments/notebook/deepnote.md b/docs/environments/notebook/deepnote.md index d7f78ac1..4e298535 100644 --- a/docs/environments/notebook/deepnote.md +++ b/docs/environments/notebook/deepnote.md @@ -64,7 +64,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/notebook/jupyterlab.md b/docs/environments/notebook/jupyterlab.md index ad22ce9c..9bdb05e0 100644 --- a/docs/environments/notebook/jupyterlab.md +++ b/docs/environments/notebook/jupyterlab.md @@ -69,7 +69,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/notebook/jupyterlite.md b/docs/environments/notebook/jupyterlite.md index 6886d47f..253e3b1b 100644 --- a/docs/environments/notebook/jupyterlite.md +++ b/docs/environments/notebook/jupyterlite.md @@ -65,7 +65,7 @@ chart = Chart( # add data to Chart # download data from -# "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" +# "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" # and place it in your JupyterLite workspace DB_NAME = "JupyterLite Storage" diff --git a/docs/environments/notebook/jupyternotebook.md b/docs/environments/notebook/jupyternotebook.md index 135ce26a..18608c18 100644 --- a/docs/environments/notebook/jupyternotebook.md +++ b/docs/environments/notebook/jupyternotebook.md @@ -69,7 +69,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/notebook/kaggle.md b/docs/environments/notebook/kaggle.md index d980703e..dc6e6367 100644 --- a/docs/environments/notebook/kaggle.md +++ b/docs/environments/notebook/kaggle.md @@ -67,7 +67,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/notebook/noteable.md b/docs/environments/notebook/noteable.md index 5e1d85f6..72a5ab22 100644 --- a/docs/environments/notebook/noteable.md +++ b/docs/environments/notebook/noteable.md @@ -63,7 +63,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/platform/flask.md b/docs/environments/platform/flask.md index 4c451b6f..bb19f6b0 100644 --- a/docs/environments/platform/flask.md +++ b/docs/environments/platform/flask.md @@ -64,7 +64,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/platform/mercury.md b/docs/environments/platform/mercury.md index 23e9c05e..f7418de5 100644 --- a/docs/environments/platform/mercury.md +++ b/docs/environments/platform/mercury.md @@ -84,7 +84,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/platform/panel.md b/docs/environments/platform/panel.md index d3cb9324..4f91cb14 100644 --- a/docs/environments/platform/panel.md +++ b/docs/environments/platform/panel.md @@ -61,7 +61,7 @@ def create_chart(): data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/platform/streamlit.md b/docs/environments/platform/streamlit.md index 8e3363ef..f814da96 100644 --- a/docs/environments/platform/streamlit.md +++ b/docs/environments/platform/streamlit.md @@ -66,7 +66,7 @@ def create_chart(): data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/environments/platform/voila.md b/docs/environments/platform/voila.md index c42ee43e..3033deee 100644 --- a/docs/environments/platform/voila.md +++ b/docs/environments/platform/voila.md @@ -69,7 +69,7 @@ chart = Chart( data = Data() df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data.add_df(df) diff --git a/docs/showcases/music.md b/docs/showcases/music.md index a3ab9f66..ae30542e 100644 --- a/docs/showcases/music.md +++ b/docs/showcases/music.md @@ -15,7 +15,7 @@ import pandas as pd from ipyvizzu import Chart, Data, Config, Style df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/music/music.csv", + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/music/music.csv", dtype={"Year": str}, ) data = Data() diff --git a/docs/showcases/musicformats.md b/docs/showcases/musicformats.md index 2f5ba984..3407bf70 100644 --- a/docs/showcases/musicformats.md +++ b/docs/showcases/musicformats.md @@ -15,7 +15,7 @@ import pandas as pd from ipyvizzu import Chart, Data, Config, Style, DisplayTarget df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/musicformats/musicformats.csv", + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/musicformats/musicformats.csv", dtype={"Year": str}, ) data = Data() diff --git a/docs/showcases/nadal.md b/docs/showcases/nadal.md index 9804ec72..00d98199 100644 --- a/docs/showcases/nadal.md +++ b/docs/showcases/nadal.md @@ -15,7 +15,7 @@ import pandas as pd from ipyvizzu import Chart, Data, Config, Style, DisplayTarget df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/nadal/nadal.csv", + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/nadal/nadal.csv", dtype={ "Year": str, "Round": str, diff --git a/docs/showcases/sales.md b/docs/showcases/sales.md index 044cf621..c73b7188 100644 --- a/docs/showcases/sales.md +++ b/docs/showcases/sales.md @@ -15,7 +15,7 @@ import pandas as pd from ipyvizzu import Chart, Data, Config, Style df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/sales/sales.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/sales/sales.csv" ) data = Data() data.add_df(df) diff --git a/docs/showcases/titanic.md b/docs/showcases/titanic.md index 918c78df..902271e6 100644 --- a/docs/showcases/titanic.md +++ b/docs/showcases/titanic.md @@ -15,7 +15,7 @@ import pandas as pd from ipyvizzu import Chart, Data, Config df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/showcases/titanic/titanic.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/showcases/titanic/titanic.csv" ) data = Data() data.add_df(df) diff --git a/docs/tutorial/aggregating_data.md b/docs/tutorial/aggregating_data.md index 5096990a..fc21149a 100644 --- a/docs/tutorial/aggregating_data.md +++ b/docs/tutorial/aggregating_data.md @@ -13,21 +13,7 @@ within `Genres`.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - ``` +{% include-markdown "tutorial/assets/setup/setup_a.md" %} ```python chart.animate(Config({"channels": {"y": {"set": ["Popularity"]}}})) diff --git a/docs/tutorial/align_range.md b/docs/tutorial/align_range.md index c6a7c205..2e4a8232 100644 --- a/docs/tutorial/align_range.md +++ b/docs/tutorial/align_range.md @@ -21,34 +21,7 @@ whereas on a bar chart, horizontally.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} Change align and configures the y axis labels to disappear during the animation. diff --git a/docs/tutorial/animation_control_keyframes.md b/docs/tutorial/animation_control_keyframes.md index 64840725..3788cfde 100644 --- a/docs/tutorial/animation_control_keyframes.md +++ b/docs/tutorial/animation_control_keyframes.md @@ -5,40 +5,13 @@ csv_url: ../../assets/data/music_data.csv # Animation control & keyframes Using the `control` property provided by the chart you can play, pause, stop, -seek or reverse the animations. +seek, speed up or reverse the animations. In this step, we seek forward to `50%` of progress after the animation starts.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config, Keyframe - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( diff --git a/docs/tutorial/animation_options.md b/docs/tutorial/animation_options.md index 2e400db3..31ef552a 100644 --- a/docs/tutorial/animation_options.md +++ b/docs/tutorial/animation_options.md @@ -14,34 +14,7 @@ the default animation options.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( diff --git a/docs/tutorial/assets/setup/config_a.md b/docs/tutorial/assets/setup/config_a.md new file mode 100644 index 00000000..5faf7e2d --- /dev/null +++ b/docs/tutorial/assets/setup/config_a.md @@ -0,0 +1,3 @@ +```python +chart.animate(data) +``` diff --git a/docs/tutorial/assets/setup/config_b.md b/docs/tutorial/assets/setup/config_b.md new file mode 100644 index 00000000..ea73fccf --- /dev/null +++ b/docs/tutorial/assets/setup/config_b.md @@ -0,0 +1,12 @@ +```python +chart.animate( + Config( + { + "channels": { + "y": {"set": ["Popularity"]}, + "x": {"set": ["Genres"]}, + }, + } + ) +) +``` diff --git a/docs/tutorial/assets/setup/config_c.md b/docs/tutorial/assets/setup/config_c.md new file mode 100644 index 00000000..597562d3 --- /dev/null +++ b/docs/tutorial/assets/setup/config_c.md @@ -0,0 +1,15 @@ +```python +chart.animate( + data, + Config( + { + "channels": { + "y": {"set": ["Popularity", "Kinds"]}, + "x": {"set": ["Genres"]}, + "color": {"set": ["Kinds"]}, + "label": {"set": ["Popularity"]}, + }, + } + ), +) +``` diff --git a/docs/tutorial/assets/setup/init.md b/docs/tutorial/assets/setup/init.md new file mode 100644 index 00000000..1ae428ed --- /dev/null +++ b/docs/tutorial/assets/setup/init.md @@ -0,0 +1,12 @@ +```python +import pandas as pd +from ipyvizzu import Chart, Data, Config + +df = pd.read_csv( + "https://xIPYVIZZU_MINOR_VERSIONx/assets/data/music_data.csv" +) +data = Data() +data.add_df(df) + +chart = Chart() +``` diff --git a/docs/tutorial/assets/setup/setup_a.md b/docs/tutorial/assets/setup/setup_a.md new file mode 100644 index 00000000..0d60a2c4 --- /dev/null +++ b/docs/tutorial/assets/setup/setup_a.md @@ -0,0 +1,4 @@ +??? info "Info - How to setup Chart" + {% include-markdown "tutorial/assets/setup/init.md" %} + + {% include-markdown "tutorial/assets/setup/config_a.md" %} diff --git a/docs/tutorial/assets/setup/setup_b.md b/docs/tutorial/assets/setup/setup_b.md new file mode 100644 index 00000000..c5ba8b9e --- /dev/null +++ b/docs/tutorial/assets/setup/setup_b.md @@ -0,0 +1,4 @@ +??? info "Info - How to setup Chart" + {% include-markdown "tutorial/assets/setup/init.md" %} + + {% include-markdown "tutorial/assets/setup/config_b.md" %} diff --git a/docs/tutorial/assets/setup/setup_c.md b/docs/tutorial/assets/setup/setup_c.md new file mode 100644 index 00000000..a27eb220 --- /dev/null +++ b/docs/tutorial/assets/setup/setup_c.md @@ -0,0 +1,4 @@ +??? info "Info - How to setup Chart" + {% include-markdown "tutorial/assets/setup/init.md" %} + + {% include-markdown "tutorial/assets/setup/config_c.md" %} diff --git a/docs/tutorial/axes_title_tooltip.md b/docs/tutorial/axes_title_tooltip.md index ed626759..6c5a2a1e 100644 --- a/docs/tutorial/axes_title_tooltip.md +++ b/docs/tutorial/axes_title_tooltip.md @@ -15,21 +15,7 @@ the measure (`Popularity`) to the y-axis using the set property.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, ChartProperty, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - ``` +{% include-markdown "tutorial/assets/setup/setup_a.md" %} ```python chart.animate( @@ -93,7 +79,7 @@ browser console. chart.log(ChartProperty.CONFIG) ``` -Setting the chart title with the title command. +Setting the chart title with the title property.
diff --git a/docs/tutorial/changing_dimensions.md b/docs/tutorial/changing_dimensions.md index d4bffd26..fa7d6997 100644 --- a/docs/tutorial/changing_dimensions.md +++ b/docs/tutorial/changing_dimensions.md @@ -15,34 +15,7 @@ the elements.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( diff --git a/docs/tutorial/channels_legend.md b/docs/tutorial/channels_legend.md index 07114008..c6597c74 100644 --- a/docs/tutorial/channels_legend.md +++ b/docs/tutorial/channels_legend.md @@ -19,32 +19,7 @@ you can set them differently with the `Style` object introduced in the
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity"]}, - "x": {"set": ["Genres"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_b.md" %} ```python chart.animate( @@ -60,7 +35,7 @@ columns’ height and lightness represent the same values. The legend for the !!! info This is an example when we explicitly instruct `ipyvizzu` to show the legend. By default `ipyvizzu` automatically shows/hides the legend when it's - necessary. You can also turn it off with the `legend`: `None` command or set + necessary. You can also turn it off with the `legend`: `None` setting or set back to automatic mode with `legend`: `"auto"`.
diff --git a/docs/tutorial/chart_layout.md b/docs/tutorial/chart_layout.md index 52f39273..96bc6f57 100644 --- a/docs/tutorial/chart_layout.md +++ b/docs/tutorial/chart_layout.md @@ -18,34 +18,7 @@ are aligned.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config, Style - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( diff --git a/docs/tutorial/chart_presets.md b/docs/tutorial/chart_presets.md index 5ce102e8..3674f1da 100644 --- a/docs/tutorial/chart_presets.md +++ b/docs/tutorial/chart_presets.md @@ -19,21 +19,7 @@ using its preset.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config, Style - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - ``` +{% include-markdown "tutorial/assets/setup/setup_a.md" %} ```python chart.animate( diff --git a/docs/tutorial/chart_settings.md b/docs/tutorial/chart_settings.md index 07a82e02..1eedc9a0 100644 --- a/docs/tutorial/chart_settings.md +++ b/docs/tutorial/chart_settings.md @@ -137,7 +137,7 @@ chart.show() ### Vizzu library `ipyvizzu` requires and automatically downloads the -[Vizzu](https://lib.vizzuhq.com/latest/) JavaScript/C++ library from +[Vizzu](https://xLIB_MINOR_VERSIONx/) JavaScript/C++ library from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/vizzu), but you can also use a self-hosted version. diff --git a/docs/tutorial/color_palette_fonts.md b/docs/tutorial/color_palette_fonts.md index 20e149f4..686d394e 100644 --- a/docs/tutorial/color_palette_fonts.md +++ b/docs/tutorial/color_palette_fonts.md @@ -5,12 +5,10 @@ csv_url: ../../assets/data/music_data.csv # Color palette & fonts This and the next chapter provide a quick intro to the styling of the charts. -You can either use the `Style` object like in the following examples or use +You can either use the `style` property like in the following examples or use `CSS`. By using `CSS`, it's easier to set the same style for multiple charts on -one page or re-use style settings. - -If you use `CSS`, don't change the set parameters later on via the `Style` -object. +one page or re-use style settings. `CSS` parameter usage is disabled by default +and can be enabled by `chart.feature("cssProperties", True)`. The font sizes automatically adjust to the chart size to help readability, and can also be set separately or for specific groups. @@ -23,34 +21,7 @@ you should add
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config, Style, ChartProperty - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( @@ -109,7 +80,6 @@ chart.animate(Style(None)) ``` For information on all available style parameters see the [Style](./style.md) -chapter or the -[Vizzu Code reference](https://lib.vizzuhq.com/latest/reference/interfaces/Styles.Chart/#properties). +chapter. diff --git a/docs/tutorial/data.md b/docs/tutorial/data.md index 5dd7d08b..cb3b8575 100644 --- a/docs/tutorial/data.md +++ b/docs/tutorial/data.md @@ -178,7 +178,7 @@ from ipyvizzu import Data df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" + "https://xIPYVIZZU_MINOR_VERSIONx/assets/data/music_data.csv" ) data = Data() @@ -195,7 +195,7 @@ from ipyvizzu import Data df = pd.read_excel( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.xlsx" + "https://xIPYVIZZU_MINOR_VERSIONx/assets/data/music_data.xlsx" ) data = Data() diff --git a/docs/tutorial/events.js b/docs/tutorial/events.js index 7447a750..a766b829 100644 --- a/docs/tutorial/events.js +++ b/docs/tutorial/events.js @@ -7,11 +7,11 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => { const mdchart = new MdChart(data, './vizzu.js', 'tutorial') const clickHandler = (event) => { - alert(JSON.stringify(event.data)) // eslint-disable-line no-alert + alert(JSON.stringify(event.target)) // eslint-disable-line no-alert } const labelDrawHandler = (event) => { - event.renderingContext.fillStyle = event.data.text === 'Jazz' ? 'red' : 'gray' + event.renderingContext.fillStyle = event.target.value === 'Jazz' ? 'red' : 'gray' } const logoDrawHandler = (event) => { @@ -27,8 +27,8 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => { image, 0, 0, - event.data.rect.size.x, - event.data.rect.size.y + event.detail.rect.size.x, + event.detail.rect.size.y ) event.preventDefault() } @@ -58,7 +58,7 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => { }, (chart) => { chart.on('click', clickHandler) - chart.render.updateFrame(true) + chart.feature.rendering.update() return chart } ] @@ -81,7 +81,7 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => { }, (chart) => { chart.on('plot-axis-label-draw', labelDrawHandler) - chart.render.updateFrame(true) + chart.feature.rendering.update() return chart } ] @@ -104,7 +104,7 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => { }, (chart) => { chart.on('logo-draw', logoDrawHandler) - chart.render.updateFrame(true) + chart.feature.rendering.update() return chart } ] @@ -128,7 +128,7 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => { (chart) => { const registerHandler = () => { chart.on('background-draw', backgroundImageHandler) - chart.render.updateFrame(true) + chart.feature.rendering.update() } if (!image.complete) image.onload = registerHandler else registerHandler() diff --git a/docs/tutorial/events.md b/docs/tutorial/events.md index cdb4df73..6ba0bc02 100644 --- a/docs/tutorial/events.md +++ b/docs/tutorial/events.md @@ -5,7 +5,7 @@ csv_url: ../../assets/data/music_data.csv # Events You can register handlers for various events. There are pointer events (`click`, -`pointeron`), animation events (`begin`, `update`, `complete`), and rendering +`pointermove`), animation events (`begin`, `update`, `complete`), and rendering events that are called before rendering the chart elements. Handlers can be registered/unregistered with the `on`, `off` method pair. @@ -15,41 +15,14 @@ registered/unregistered with the `on`, `off` method pair. below. We are registering a handler for the `click` event which will show an alert -block with information about the clicked marker. +block with information about the clicked chart element.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python -click_handler = "alert(JSON.stringify(event.data));" +click_handler = "alert(JSON.stringify(event.target));" click = chart.on("click", click_handler) ``` @@ -67,7 +40,7 @@ Here we override the axis label color for `Jazz` to red and all others to gray. ```python label_draw_handler = ( "event.renderingContext.fillStyle =" - + " (event.data.text === 'Jazz') ? 'red' : 'gray';" + + " (event.target.value === 'Jazz') ? 'red' : 'gray';" ) label_draw = chart.on("plot-axis-label-draw", label_draw_handler) @@ -110,7 +83,7 @@ if (!window.bgImage) { window.bgImage.src = 'data:image/gif;base64,R0lGODlhAwACAPIAAJLf6q/i7M/r8un0+PT6+/n8/QAAAAAAACH5BAQAAAAALAAAAAADAAIAAAMEWBMkkAA7'; } event.renderingContext.drawImage(window.bgImage, 0, 0, - event.data.rect.size.x, event.data.rect.size.y); + event.detail.rect.size.x, event.detail.rect.size.y); event.preventDefault(); """ diff --git a/docs/tutorial/filter_add_new_records.md b/docs/tutorial/filter_add_new_records.md index 0d20cd5d..9d644e81 100644 --- a/docs/tutorial/filter_add_new_records.md +++ b/docs/tutorial/filter_add_new_records.md @@ -16,34 +16,7 @@ from the chart.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data1 = Data() - data1.add_df(df) - - chart = Chart() - - chart.animate(data1) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python filter1 = Data.filter( diff --git a/docs/tutorial/geometry.md b/docs/tutorial/geometry.md index 1eb041f6..0748ed29 100644 --- a/docs/tutorial/geometry.md +++ b/docs/tutorial/geometry.md @@ -12,32 +12,7 @@ Switching the geometry to area.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity"]}, - "x": {"set": ["Genres"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_b.md" %} ```python chart.animate(Config({"geometry": "area"})) diff --git a/docs/tutorial/group_stack.md b/docs/tutorial/group_stack.md index d985a1be..77e82ef4 100644 --- a/docs/tutorial/group_stack.md +++ b/docs/tutorial/group_stack.md @@ -13,32 +13,7 @@ we also add the same dimension to the color channel.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity"]}, - "x": {"set": ["Genres"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_b.md" %} ```python chart.animate( diff --git a/docs/tutorial/index.md b/docs/tutorial/index.md index 10acea64..fb7899f4 100644 --- a/docs/tutorial/index.md +++ b/docs/tutorial/index.md @@ -1,10 +1,9 @@ # Tutorial This is the tutorial of `ipyvizzu` - the `Python` integration of the free, -open-source `JavaScript`/`C++` library -[`Vizzu`](https://lib.vizzuhq.com/latest/). You can create animated charts, data -stories, interactive reports and dashboards with it in Jupyter and similar -notebooks and app building platforms. +open-source `JavaScript`/`C++` library [`Vizzu`](https://xLIB_MINOR_VERSIONx/). +You can create animated charts, data stories, interactive reports and dashboards +with it in Jupyter and similar notebooks and app building platforms. This is an excellent starting point to get acquainted with `ipyvizzu`, as it walks you through the installation of the library, introduces the logic it diff --git a/docs/tutorial/orientation_split_polar.md b/docs/tutorial/orientation_split_polar.md index 5f541528..8c9d9d9a 100644 --- a/docs/tutorial/orientation_split_polar.md +++ b/docs/tutorial/orientation_split_polar.md @@ -14,34 +14,7 @@ only use temporarily.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( diff --git a/docs/tutorial/shorthands_store.md b/docs/tutorial/shorthands_store.md index f8d37689..3013d6f1 100644 --- a/docs/tutorial/shorthands_store.md +++ b/docs/tutorial/shorthands_store.md @@ -13,35 +13,7 @@ that state or animation once again.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config, Style - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "title": "Store function", - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( @@ -138,6 +110,12 @@ chart.animate( ) ``` +Shorthands feature can be switched off if not needed: + +```python +chart.feature("shorthands", False) +``` + This is how you can reuse a previously stored animation.
diff --git a/docs/tutorial/sorting.md b/docs/tutorial/sorting.md index 0445dffd..18799f28 100644 --- a/docs/tutorial/sorting.md +++ b/docs/tutorial/sorting.md @@ -13,34 +13,7 @@ ascending order.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Popularity", "Kinds"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( diff --git a/docs/tutorial/stacking_explanation.js b/docs/tutorial/stacking_explanation.js new file mode 100644 index 00000000..c4ca76ee --- /dev/null +++ b/docs/tutorial/stacking_explanation.js @@ -0,0 +1,147 @@ +const mdChartLoaded = import('../assets/javascripts/mdchart.js') +const animOptions = { + duration: 2, + delay: 3 +} + +Promise.all([mdChartLoaded]).then((results) => { + const MdChart = results[0].default + const data = { + series: [ + { name: 'D', values: ['A', 'B', 'C'] }, + { name: 'M', values: [6.1, 3.5, 1.4] }, + { name: 'i', values: [1, 1, 1] } + ] + } + const mdchart = new MdChart(data, './vizzu.js', 'tutorial') + + mdchart.create([ + // tutorial_01 + { + anims: [ + (chart) => + chart.animate( + { + config: { + title: 'Dimension only', + channels: { + x: { + set: ['D', 'i'], + range: { max: 3 }, + axis: true, + labels: false, + title: 'x: [ dimension ]', + interlacing: false, + markerGuides: true, + ticks: false + }, + y: { + set: null, + axis: true, + labels: false, + title: null, + interlacing: false + }, + color: 'D', + label: ['D'] + }, + legend: null + } + }, + { ...animOptions, delay: 0 } + ), + (chart) => + chart.animate( + { + config: { + title: 'Measure and dimension', + channels: { + x: { + set: ['D', 'M'], + range: { max: 12 }, + axis: true, + labels: true, + title: 'x: [ measure, dimension ]', + interlacing: false, + markerGuides: true, + ticks: true + }, + y: { + set: null, + axis: true, + labels: false, + title: null, + interlacing: false + }, + color: 'D', + label: ['D'] + } + } + }, + animOptions + ), + (chart) => + chart.animate( + { + config: { + title: 'Measure only', + channels: { + x: { + set: 'M', + range: { max: 7 }, + axis: true, + labels: true, + title: 'x: [ measure ]', + interlacing: false, + markerGuides: true, + ticks: true + }, + y: { + set: null, + axis: true, + labels: false, + title: null, + interlacing: false + }, + color: 'D', + label: ['D'] + } + } + }, + animOptions + ), + (chart) => + chart.animate( + { + config: { + title: 'Dimension only', + channels: { + x: { + set: ['D', 'i'], + range: { max: 3 }, + axis: true, + labels: false, + title: 'x: [ dimension ]', + interlacing: false, + markerGuides: true, + ticks: false + }, + y: { + set: null, + axis: true, + labels: false, + title: null, + interlacing: false + }, + color: 'D', + label: ['D'] + }, + legend: null + } + }, + animOptions + ) + ] + } + ]) +}) diff --git a/docs/tutorial/stacking_explanation.md b/docs/tutorial/stacking_explanation.md new file mode 100644 index 00000000..48e81007 --- /dev/null +++ b/docs/tutorial/stacking_explanation.md @@ -0,0 +1,17 @@ +# Stacking explanation + +In the following animation you can see an example how selecting different +measures and dimensions cause different stacking behaviour in the chart. + +First we set the x channel to a dimension and an arbitrary constant value to +illustrate stacking. (The dimension divides the bar to equal sections along the +x-axis.) Then by changing the constant to a measure the markers’ width change +according to the values. Finally when the dimension is removed the bars get +ordered by the measure. + +Note that when no dimension is present then the markers are measured from the +origo. + +
+ + diff --git a/docs/tutorial/without_coordinates_noop_channel.md b/docs/tutorial/without_coordinates_noop_channel.md index 544b3713..a15bebe9 100644 --- a/docs/tutorial/without_coordinates_noop_channel.md +++ b/docs/tutorial/without_coordinates_noop_channel.md @@ -14,34 +14,7 @@ still on the `color` channel.
-??? info "Info - How to setup Chart" - ```python - import pandas as pd - from ipyvizzu import Chart, Data, Config - - df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/music_data.csv" - ) - data = Data() - data.add_df(df) - - chart = Chart() - - chart.animate(data) - - chart.animate( - Config( - { - "channels": { - "y": {"set": ["Kinds", "Popularity"]}, - "x": {"set": ["Genres"]}, - "color": {"set": ["Kinds"]}, - "label": {"set": ["Popularity"]}, - }, - } - ) - ) - ``` +{% include-markdown "tutorial/assets/setup/setup_c.md" %} ```python chart.animate( diff --git a/pdm.lock b/pdm.lock index b270ebf7..83a9a489 100644 --- a/pdm.lock +++ b/pdm.lock @@ -6,7 +6,7 @@ groups = ["codequality", "docs", "env", "packagedeps", "packagetool"] cross_platform = true static_urls = false lock_version = "4.3" -content_hash = "sha256:fe653078f524b91032623ad8e70c98b2d34d3abb1562c9752b3407fae6d0a910" +content_hash = "sha256:4cc426f4faed80c5204ab42053f54138c2d44e1335e9dcd2037c91eea917b094" [[package]] name = "adagio" @@ -229,15 +229,15 @@ files = [ [[package]] name = "astroid" -version = "3.0.1" +version = "3.0.2" requires_python = ">=3.8.0" summary = "An abstract syntax tree for Python with inference support." dependencies = [ "typing-extensions>=4.0.0; python_version < \"3.11\"", ] files = [ - {file = "astroid-3.0.1-py3-none-any.whl", hash = "sha256:7d5895c9825e18079c5aeac0572bc2e4c83205c95d416e0b4fee8bc361d2d9ca"}, - {file = "astroid-3.0.1.tar.gz", hash = "sha256:86b0bb7d7da0be1a7c4aedb7974e391b32d4ed89e33de6ed6902b4b15c97577e"}, + {file = "astroid-3.0.2-py3-none-any.whl", hash = "sha256:d6e62862355f60e716164082d6b4b041d38e2a8cf1c7cd953ded5108bac8ff5c"}, + {file = "astroid-3.0.2.tar.gz", hash = "sha256:4a61cf0a59097c7bb52689b0fd63717cd2a8a14dc9f1eee97b82d814881c8c91"}, ] [[package]] @@ -287,15 +287,12 @@ files = [ [[package]] name = "babel" -version = "2.13.1" +version = "2.14.0" requires_python = ">=3.7" summary = "Internationalization utilities" -dependencies = [ - "setuptools; python_version >= \"3.12\"", -] files = [ - {file = "Babel-2.13.1-py3-none-any.whl", hash = "sha256:7077a4984b02b6727ac10f1f7294484f737443d7e2e66c5e4380e41a3ae0b4ed"}, - {file = "Babel-2.13.1.tar.gz", hash = "sha256:33e0952d7dd6374af8dbf6768cc4ddf3ccfefc244f9986d4074704f2fbd18900"}, + {file = "Babel-2.14.0-py3-none-any.whl", hash = "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287"}, + {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, ] [[package]] @@ -395,6 +392,16 @@ files = [ {file = "bleach-6.1.0.tar.gz", hash = "sha256:0a31f1837963c41d46bbf1331b8778e1308ea0791db03cc4e7357b97cf42a8fe"}, ] +[[package]] +name = "bracex" +version = "2.4" +requires_python = ">=3.8" +summary = "Bash style brace expander." +files = [ + {file = "bracex-2.4-py3-none-any.whl", hash = "sha256:efdc71eff95eaff5e0f8cfebe7d01adf2c8637c8c92edaf63ef348c241a82418"}, + {file = "bracex-2.4.tar.gz", hash = "sha256:a27eaf1df42cf561fed58b7a8f3fdf129d1ea16a81e1fadd1d17989bc6384beb"}, +] + [[package]] name = "cachetools" version = "5.3.2" @@ -1898,6 +1905,20 @@ files = [ {file = "mkdocs_gen_files-0.5.0.tar.gz", hash = "sha256:4c7cf256b5d67062a788f6b1d035e157fc1a9498c2399be9af5257d4ff4d19bc"}, ] +[[package]] +name = "mkdocs-include-markdown-plugin" +version = "6.0.4" +requires_python = ">=3.8" +summary = "Mkdocs Markdown includer plugin." +dependencies = [ + "mkdocs>=1.4", + "wcmatch<9,>=8", +] +files = [ + {file = "mkdocs_include_markdown_plugin-6.0.4-py3-none-any.whl", hash = "sha256:e7b8b5ecc41d6a3e16969cff3725ec3a391b68e9dfe1a4b4e36a8508becda835"}, + {file = "mkdocs_include_markdown_plugin-6.0.4.tar.gz", hash = "sha256:523c9c3a1d6a517386dc11bf60b0c0c564af1071bb6de8d213106d54f752dcc1"}, +] + [[package]] name = "mkdocs-literate-nav" version = "0.6.1" @@ -1944,6 +1965,19 @@ files = [ {file = "mkdocs_material_extensions-1.3.1.tar.gz", hash = "sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443"}, ] +[[package]] +name = "mkdocs-placeholder-plugin" +version = "0.4.1" +requires_python = ">=3.9" +summary = "Add dynamic placeholders to your mkdocs page" +dependencies = [ + "mkdocs>=1.4.0", +] +files = [ + {file = "mkdocs-placeholder-plugin-0.4.1.tar.gz", hash = "sha256:268ac6f1020a6c02e31358d390d68fc09fd1f7062101ce7787769be10678dc4e"}, + {file = "mkdocs_placeholder_plugin-0.4.1-py3-none-any.whl", hash = "sha256:976eb16659d38741d4345fd371d8137ad20051247680b68f27da943b6181778f"}, +] + [[package]] name = "mkdocs-section-index" version = "0.3.8" @@ -2511,15 +2545,15 @@ files = [ [[package]] name = "prompt-toolkit" -version = "3.0.41" +version = "3.0.43" requires_python = ">=3.7.0" summary = "Library for building powerful interactive command lines in Python" dependencies = [ "wcwidth", ] files = [ - {file = "prompt_toolkit-3.0.41-py3-none-any.whl", hash = "sha256:f36fe301fafb7470e86aaf90f036eef600a3210be4decf461a5b1ca8403d3cb2"}, - {file = "prompt_toolkit-3.0.41.tar.gz", hash = "sha256:941367d97fc815548822aa26c2a269fdc4eb21e9ec05fc5d447cf09bad5d75f0"}, + {file = "prompt_toolkit-3.0.43-py3-none-any.whl", hash = "sha256:a11a29cb3bf0a28a387fe5122cdb649816a957cd9261dcedf8c9f1fef33eacf6"}, + {file = "prompt_toolkit-3.0.43.tar.gz", hash = "sha256:3527b7af26106cbc65a040bcc84839a3566ec1b051bb0bfe953631e704b0ff7d"}, ] [[package]] @@ -3762,6 +3796,19 @@ files = [ {file = "watchdog-3.0.0.tar.gz", hash = "sha256:4d98a320595da7a7c5a18fc48cb633c2e73cda78f93cac2ef42d42bf609a33f9"}, ] +[[package]] +name = "wcmatch" +version = "8.5" +requires_python = ">=3.8" +summary = "Wildcard/glob file name matcher." +dependencies = [ + "bracex>=2.1.1", +] +files = [ + {file = "wcmatch-8.5-py3-none-any.whl", hash = "sha256:14554e409b142edeefab901dc68ad570b30a72a8ab9a79106c5d5e9a6d241bd5"}, + {file = "wcmatch-8.5.tar.gz", hash = "sha256:86c17572d0f75cbf3bcb1a18f3bf2f9e72b39a9c08c9b4a74e991e1882a8efb3"}, +] + [[package]] name = "wcwidth" version = "0.2.12" diff --git a/pyproject.toml b/pyproject.toml index c0d8598b..ee8dd229 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,8 +142,8 @@ fix-lint-tools = {composite = ["fix-lint-tools-js"]} fix-lint-tools-js = {composite = ["fix-lint-eslint tools"]} fix-lint-eslint = "npx eslint --ext .js,.cjs,.mjs --fix" -build-docs = "mkdocs build -f ./tools/docs/mkdocs.yml" -deploy-docs = "python ./tools/docs/deploy.py" +build-docs = {composite = ["python tools/docs/placeholder.py", "mkdocs build -f ./tools/docs/mkdocs.yml"]} +deploy-docs = {composite = ["python tools/docs/placeholder.py", "python ./tools/docs/deploy.py"]} deploy = "pip install -e ." build = {composite = ["python ./tools/ci/version.py False", "pdm build", "twine check dist/*.tar.gz dist/*.whl"]} @@ -238,6 +238,8 @@ docs = [ "mkdocstrings[python] ; python_version >= '3.10'", "mkdocs-gen-files ; python_version >= '3.10'", "mkdocs-coverage ; python_version >= '3.10'", + "mkdocs-placeholder-plugin>=0.4.1 ; python_version >= '3.10'", + "mkdocs-include-markdown-plugin ; python_version >= '3.10'", "mike ; python_version >= '3.10'", ] diff --git a/tools/docs/examples/mjs2md.mjs b/tools/docs/examples/mjs2md.mjs index b46061b9..535090e0 100644 --- a/tools/docs/examples/mjs2md.mjs +++ b/tools/docs/examples/mjs2md.mjs @@ -35,7 +35,7 @@ csv_url: ${assetsPath}/assets/data/${dataFileName}.csv from ipyvizzu import Chart, Data, Config, Style df = pd.read_csv( - "https://ipyvizzu.vizzuhq.com/latest/assets/data/${dataFileName}.csv", + "https://xIPYVIZZU_MINOR_VERSIONx/assets/data/${dataFileName}.csv", dtype={"Year": str, "Timeseries": str}, ) data = Data() diff --git a/tools/docs/mkdocs.yml b/tools/docs/mkdocs.yml index 1e569aeb..17f44a38 100644 --- a/tools/docs/mkdocs.yml +++ b/tools/docs/mkdocs.yml @@ -80,6 +80,8 @@ plugins: alias_type: symlink canonical_version: latest redirect_template: ./tools/docs/overrides/mike/redirect.html + - include-markdown + - placeholder - search - section-index - autorefs @@ -123,6 +125,7 @@ nav: - tutorial/geometry.md - Channels & legend: tutorial/channels_legend.md - Group/stack: tutorial/group_stack.md + - tutorial/stacking_explanation.md - tutorial/sorting.md - Align & range: tutorial/align_range.md - Changing dimensions: tutorial/changing_dimensions.md diff --git a/tools/docs/pages/gen_pages.py b/tools/docs/pages/gen_pages.py index 4d5483bc..beae39ad 100644 --- a/tools/docs/pages/gen_pages.py +++ b/tools/docs/pages/gen_pages.py @@ -22,9 +22,6 @@ from vizzu import ( # pylint: disable=import-error, wrong-import-position, wrong-import-order Vizzu, ) -from markdown_format import ( # pylint: disable=import-error, wrong-import-position, wrong-import-order - Markdown, -) from config import ( # pylint: disable=import-error, wrong-import-position, wrong-import-order MkdocsConfig, ) @@ -114,32 +111,10 @@ def generate(src: Path, dst: str, pos: str, site: str, keep: bool = False) -> No f_dst.write(content) -class Docs: - # pylint: disable=too-few-public-methods - - @staticmethod - def generate(skip: Optional[List[str]] = None) -> None: - docs_path = REPO_PATH / "docs" - for path in list(docs_path.rglob("*.md")) + list(docs_path.rglob("*.js")): - if skip and path.name in skip: - continue - with open(path, "rt", encoding="utf8") as f_src: - dst = path.relative_to(docs_path) - content = f_src.read() - if path.suffix == ".md": - content = Vizzu.set_version(content) - content = Markdown.format(content) - mkdocs_gen_files.set_edit_path(dst, dst) - with mkdocs_gen_files.open(dst, "w") as f_dst: - f_dst.write(content) - - def main() -> None: with chdir(REPO_PATH): config = MkdocsConfig.load(MKDOCS_PATH / "mkdocs.yml") - Docs.generate() - IndexPages.generate( nav_item=config["nav"], skip=["examples/index.md", "examples/analytical_operations/index.md"], diff --git a/tools/docs/placegolder.py b/tools/docs/placegolder.py new file mode 100644 index 00000000..7fc3b485 --- /dev/null +++ b/tools/docs/placegolder.py @@ -0,0 +1,50 @@ +# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring + +from pathlib import Path +import sys + + +REPO_PATH = Path(__file__).parent / ".." / ".." +TOOLS_PATH = REPO_PATH / "tools" +MKDOCS_PATH = TOOLS_PATH / "docs" + + +sys.path.insert(0, str(TOOLS_PATH / "modules")) + +from chdir import ( # pylint: disable=import-error, wrong-import-position, wrong-import-order + chdir, +) +from vizzu import ( # pylint: disable=import-error, wrong-import-position, wrong-import-order + Vizzu, +) + + +PLACEHOLDER = """placeholders: + IPYVIZZU_MINOR_VERSION: {} + LIB_MINOR_VERSION: {} +settings: + auto_placeholder_tables: false +""" + + +class Placeholder: + # pylint: disable=too-few-public-methods + + @staticmethod + def generate() -> None: + with open( + MKDOCS_PATH / "placeholder-plugin.yaml", "w", encoding="utf8" + ) as fh_config: + ipyvizzu_version = Vizzu.get_ipyvizzu_version().split(".") + ipyvizzu_minor = f"{ipyvizzu_version[0]}.{ipyvizzu_version[1]}" + vizzu_version = Vizzu.get_vizzu_version().split(".") + vizzu_minor = f"{vizzu_version[0]}.{vizzu_version[1]}" + fh_config.write(PLACEHOLDER.format(ipyvizzu_minor, vizzu_minor)) + + +def main() -> None: + with chdir(REPO_PATH): + Placeholder.generate() + + +main()