plotly-extend-wrapper 1.0.0__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. plotly_extend_wrapper-1.1.0/.devcontainer/Dockerfile +43 -0
  2. plotly_extend_wrapper-1.1.0/.devcontainer/devcontainer.json +32 -0
  3. plotly_extend_wrapper-1.1.0/.github/workflows/deploy_pages.yaml +44 -0
  4. plotly_extend_wrapper-1.1.0/.github/workflows/pypi_release.yml +25 -0
  5. plotly_extend_wrapper-1.1.0/.github/workflows/unittest.yml +24 -0
  6. plotly_extend_wrapper-1.1.0/.gitignore +159 -0
  7. plotly_extend_wrapper-1.1.0/.python-version +1 -0
  8. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/PKG-INFO +8 -13
  9. plotly_extend_wrapper-1.1.0/codecov.yaml +13 -0
  10. plotly_extend_wrapper-1.1.0/docs/Makefile +20 -0
  11. plotly_extend_wrapper-1.1.0/docs/conf.py +30 -0
  12. plotly_extend_wrapper-1.1.0/docs/index.rst +49 -0
  13. plotly_extend_wrapper-1.1.0/docs/make.bat +35 -0
  14. plotly_extend_wrapper-1.1.0/docs/source/introduction.md +1 -0
  15. plotly_extend_wrapper-1.1.0/docs/source/wrapper.md +49 -0
  16. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/plotly_extend_wrapper/__init__.py +1 -1
  17. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/plotly_extend_wrapper/wrapper.py +53 -0
  18. plotly_extend_wrapper-1.1.0/pyproject.toml +41 -0
  19. plotly_extend_wrapper-1.1.0/requirements-dev.lock +246 -0
  20. plotly_extend_wrapper-1.1.0/requirements.lock +38 -0
  21. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/test/test_wrapper.py +28 -0
  22. plotly-extend-wrapper-1.0.0/plotly_extend_wrapper.egg-info/PKG-INFO +0 -67
  23. plotly-extend-wrapper-1.0.0/plotly_extend_wrapper.egg-info/SOURCES.txt +0 -16
  24. plotly-extend-wrapper-1.0.0/plotly_extend_wrapper.egg-info/dependency_links.txt +0 -1
  25. plotly-extend-wrapper-1.0.0/plotly_extend_wrapper.egg-info/requires.txt +0 -3
  26. plotly-extend-wrapper-1.0.0/plotly_extend_wrapper.egg-info/top_level.txt +0 -1
  27. plotly-extend-wrapper-1.0.0/pyproject.toml +0 -34
  28. plotly-extend-wrapper-1.0.0/setup.cfg +0 -4
  29. plotly-extend-wrapper-1.0.0/setup.py +0 -43
  30. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/LICENSE +0 -0
  31. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/README.md +0 -0
  32. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/plotly_extend_wrapper/common.py +0 -0
  33. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/plotly_extend_wrapper/updater.py +0 -0
  34. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/test/test_common.py +0 -0
  35. {plotly-extend-wrapper-1.0.0 → plotly_extend_wrapper-1.1.0}/test/test_updater.py +0 -0
@@ -0,0 +1,43 @@
1
+ FROM mcr.microsoft.com/devcontainers/base:jammy
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+ ARG USER=vscode
5
+
6
+ RUN DEBIAN_FRONTEND=noninteractive \
7
+ && apt-get update \
8
+ && apt-get install -y build-essential --no-install-recommends make \
9
+ ca-certificates \
10
+ git \
11
+ libssl-dev \
12
+ zlib1g-dev \
13
+ libbz2-dev \
14
+ libreadline-dev \
15
+ libsqlite3-dev \
16
+ wget \
17
+ curl \
18
+ llvm \
19
+ libncurses5-dev \
20
+ xz-utils \
21
+ tk-dev \
22
+ libxml2-dev \
23
+ libxmlsec1-dev \
24
+ libffi-dev \
25
+ liblzma-dev
26
+
27
+ # Python and poetry installation
28
+ USER $USER
29
+ ARG HOME="/home/$USER"
30
+ ARG PYTHON_VERSION=3.10
31
+
32
+ ENV PYENV_ROOT="${HOME}/.pyenv"
33
+ ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH"
34
+
35
+ RUN echo "Installing pyenv" \
36
+ && curl https://pyenv.run | bash \
37
+ && echo "Installing Python" \
38
+ && pyenv install ${PYTHON_VERSION} \
39
+ && echo "Setting Python version" \
40
+ && pyenv global ${PYTHON_VERSION} \
41
+ && echo "Installing poetry" \
42
+ && curl -sSL https://install.python-poetry.org | python3 - \
43
+ && poetry config virtualenvs.in-project true
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "poetry3-poetry-pyenv",
3
+ "build": {
4
+ "dockerfile": "Dockerfile"
5
+ },
6
+
7
+ // 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
8
+ // "features": {},
9
+
10
+ // 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
11
+ // "forwardPorts": [],
12
+
13
+ // 👇 Use 'postCreateCommand' to run commands after the container is created.
14
+ // "postCreateCommand": "",
15
+
16
+ // 👇 Configure tool-specific properties.
17
+ "customizations": {
18
+ "vscode": {
19
+ "extensions":[
20
+ "ms-python.python",
21
+ "njpwerner.autodocstring",
22
+ "charliermarsh.ruff",
23
+ ]
24
+ }
25
+ },
26
+ "features": {
27
+ "ghcr.io/devcontainers-contrib/features/live-server:1": {}
28
+ }
29
+
30
+ // 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
31
+ // "remoteUser": "root"
32
+ }
@@ -0,0 +1,44 @@
1
+ name: Deploy Sphinx documentation to Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [main, rye] # branch to trigger deployment
6
+
7
+ concurrency:
8
+ group: "pages"
9
+ cancel-in-progress: false
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v4
17
+ - name: Install a specific version
18
+ uses: eifinger/setup-rye@v3
19
+ with:
20
+ version: 'latest'
21
+ - name: Install dependencies
22
+ run: rye sync
23
+ - name: Build Sphinx
24
+ run: rye run sphinx-build docs/ docs/_build
25
+
26
+ deploy:
27
+ needs: build
28
+ runs-on: ubuntu-latest
29
+ permissions:
30
+ pages: write
31
+ id-token: write
32
+ environment:
33
+ name: github-pages
34
+ url: ${{ steps.deployment.outputs.page_url }}
35
+ steps:
36
+ # - name: Setup Pages
37
+ # uses: actions/configure-pages
38
+ - name: Upload artifact
39
+ uses: actions/upload-pages-artifact@v3
40
+ with:
41
+ path: 'docs/_build'
42
+ - name: Deploy to GitHub Pages
43
+ id: deployment
44
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,25 @@
1
+ name: Release package to pypi
2
+
3
+ on:
4
+ release:
5
+ types: [created]
6
+
7
+ jobs:
8
+ deploy:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - name: Install a specific version
13
+ uses: eifinger/setup-rye@v3
14
+ with:
15
+ version: 'latest'
16
+ - name: Install dependencies
17
+ run: rye sync
18
+ - name: Build
19
+ run: rye build
20
+ - name: Publish a Python distribution to PyPI
21
+ if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
22
+ uses: pypa/gh-action-pypi-publish@release/v1.8
23
+ with:
24
+ user: __token__
25
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,24 @@
1
+ name: Unit test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ Unit-test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - name: Install a specific version
13
+ uses: eifinger/setup-rye@v3
14
+ with:
15
+ version: 'latest'
16
+ - name: Install dependencies
17
+ run: rye sync
18
+ - name: Test
19
+ run: |
20
+ rye run pytest test --cov=./plotly_extend_wrapper --cov-report=xml
21
+ - name: Upload coverage reports to Codecov
22
+ uses: codecov/codecov-action@v4
23
+ env:
24
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,159 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ develop-eggs/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ share/python-wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ *.py,cover
49
+ .hypothesis/
50
+ .pytest_cache/
51
+ cover/
52
+
53
+ # Translations
54
+ *.mo
55
+ *.pot
56
+
57
+ # Django stuff:
58
+ *.log
59
+ local_settings.py
60
+ db.sqlite3
61
+ db.sqlite3-journal
62
+
63
+ # Flask stuff:
64
+ instance/
65
+ .webassets-cache
66
+
67
+ # Scrapy stuff:
68
+ .scrapy
69
+
70
+ # Sphinx documentation
71
+ docs/_build/
72
+
73
+ # PyBuilder
74
+ .pybuilder/
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ # For a library or package, you might want to ignore these files since the code is
86
+ # intended to run in multiple environments; otherwise, check them in:
87
+ # .python-version
88
+
89
+ # pipenv
90
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
91
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
92
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
93
+ # install all needed dependencies.
94
+ #Pipfile.lock
95
+
96
+ # poetry
97
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
98
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
99
+ # commonly ignored for libraries.
100
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
101
+ #poetry.lock
102
+
103
+ # pdm
104
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
105
+ #pdm.lock
106
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
107
+ # in version control.
108
+ # https://pdm.fming.dev/#use-with-ide
109
+ .pdm.toml
110
+
111
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
112
+ __pypackages__/
113
+
114
+ # Celery stuff
115
+ celerybeat-schedule
116
+ celerybeat.pid
117
+
118
+ # SageMath parsed files
119
+ *.sage.py
120
+
121
+ # Environments
122
+ .env
123
+ .venv
124
+ env/
125
+ venv/
126
+ ENV/
127
+ env.bak/
128
+ venv.bak/
129
+
130
+ # Spyder project settings
131
+ .spyderproject
132
+ .spyproject
133
+
134
+ # Rope project settings
135
+ .ropeproject
136
+
137
+ # mkdocs documentation
138
+ /site
139
+
140
+ # mypy
141
+ .mypy_cache/
142
+ .dmypy.json
143
+ dmypy.json
144
+
145
+ # Pyre type checker
146
+ .pyre/
147
+
148
+ # pytype static type analyzer
149
+ .pytype/
150
+
151
+ # Cython debug symbols
152
+ cython_debug/
153
+
154
+ # PyCharm
155
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
156
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
157
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
158
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
159
+ #.idea/
@@ -0,0 +1 @@
1
+ 3.9.19
@@ -1,20 +1,15 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: plotly-extend-wrapper
3
- Version: 1.0.0
4
- Summary: plotly-extend-wrapper: Extended Python library for Plotly
5
- Home-page: https://github.com/Laplusdestiny/plotly_extend_wrapper
6
- Download-URL: https://github.com/Laplusdestiny/plotly_extend_wrapper
7
- Author: Laplusdestiny
8
- Author-email: prayonshootingstars@gmail.com
9
- Maintainer: Laplusdestiny
10
- Maintainer-email: prayonshootingstars@gmail.com
11
- License: MIT
12
- Requires-Python: >=3.9
13
- Description-Content-Type: text/markdown
3
+ Version: 1.1.0
4
+ Author-email: Laplusdestiny <prayonshootingstars@gmail.com>
14
5
  License-File: LICENSE
15
- Requires-Dist: plotly>=5.15.0
6
+ Requires-Python: >=3.9
16
7
  Requires-Dist: kaleido==0.2.1
17
8
  Requires-Dist: pandas>=2.0.0
9
+ Requires-Dist: plotly>=5.15.0
10
+ Requires-Dist: pyarrow>=10.0.0
11
+ Requires-Dist: scipy>=1.12.0
12
+ Description-Content-Type: text/markdown
18
13
 
19
14
  # plotly_extend_wrapper
20
15
 
@@ -0,0 +1,13 @@
1
+ coverage:
2
+ status:
3
+ project:
4
+ default:
5
+ target: 100%
6
+ threshold: 1%
7
+ comment: # this is a top-level key
8
+ layout: " diff, flags, files"
9
+ behavior: default
10
+ require_changes: false # if true: only post the comment if coverage changes
11
+ require_base: false # [true :: must have a base report to post]
12
+ require_head: true # [true :: must have a head report to post]
13
+ hide_project_coverage: false # [true :: only show coverage on the git diff]
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,30 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ project = 'plotly-extend-wrapper'
10
+ copyright = '2024, Laplusdestiny'
11
+ author = 'Laplusdestiny'
12
+
13
+ # -- General configuration ---------------------------------------------------
14
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15
+
16
+ extensions = ['myst_parser', 'sphinx.ext.autodoc', 'sphinx.ext.napoleon']
17
+
18
+ templates_path = ['_templates']
19
+ exclude_patterns = []
20
+ source_suffix = {
21
+ '.rst': 'restructuredtext',
22
+ '.txt': 'markdown',
23
+ '.md': 'markdown',
24
+ }
25
+
26
+ # -- Options for HTML output -------------------------------------------------
27
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
28
+
29
+ html_theme = 'furo'
30
+ html_static_path = ['_static']
@@ -0,0 +1,49 @@
1
+ .. plotly-extend-wrapper documentation master file, created by
2
+ sphinx-quickstart on Fri Apr 12 16:08:02 2024.
3
+ You can adapt this file completely to your liking, but it should at least
4
+ contain the root `toctree` directive.
5
+
6
+ Welcome to plotly-extend-wrapper's documentation!
7
+ =================================================
8
+
9
+ .. toctree::
10
+ :maxdepth: 2
11
+ :caption: Contents:
12
+
13
+ source/introduction
14
+ source/wrapper
15
+
16
+
17
+ =========
18
+
19
+ .. image:: https://img.shields.io/github/last-commit/Laplusdestiny/plotly_extend_wrapper?display_timestamp=author&logo=github
20
+ :alt: GitHub last commit
21
+ :target: https://github.com/Laplusdestiny/plotly_extend_wrapper/commits/main/
22
+
23
+ .. image:: https://img.shields.io/codecov/c/github/Laplusdestiny/plotly_extend_wrapper?style=flat&logo=codecov
24
+ :alt: Codecov
25
+ :target: https://app.codecov.io/gh/Laplusdestiny/plotly_extend_wrapper
26
+
27
+ .. image:: https://img.shields.io/github/release-date/Laplusdestiny/plotly_extend_wrapper?logo=github
28
+ :alt: GitHub Release Date
29
+ :target: https://github.com/Laplusdestiny/plotly_extend_wrapper/releases
30
+
31
+ .. image:: https://img.shields.io/pypi/v/plotly-extend-wrapper?logo=pypi
32
+ :alt: PyPI - Version
33
+ :target: https://pypi.org/project/plotly-extend-wrapper/
34
+
35
+ Certainly! Here's an introduction for the top page of the Plotly-Extend-Wrapper
36
+ library:
37
+
38
+ Plotly-Extend-Wrapper: Extended Plotly for Interactive Graphs
39
+ -------------------------------------------------------------
40
+
41
+ Overview: Plotly-Extend-Wrapper is a Python library that extends the capabilities of Plotly, an interactive graphing library. While Plotly provides powerful tools for creating visualizations, Plotly-Extend-Wrapper offers additional features that are not readily available through simple options or methods in the official Plotly library.
42
+
43
+
44
+ Key Features:
45
+ -------------
46
+
47
+ 1. Seamless Integration with Plotly: Plotly-Extend-Wrapper seamlessly integrates with Plotly, allowing users to leverage the existing functionality while enhancing it with additional features.Users can continue using familiar Plotly syntax and methods, but with added capabilities.
48
+ 2. Advanced Methods for Common Tasks: Plotly-Extend-Wrapper provides convenient methods for tasks that are commonly required but not directly available in the standard Plotly library.Users can easily perform complex operations without having to write custom code.
49
+ 3. Automated Data Preprocessing: Some graph types require specific data formats or preprocessing steps before visualization.Plotly-Extend-Wrapper automatically handles data preprocessing for certain graph types, making it easier for users to create meaningful visualizations without manual data manipulation.
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1 @@
1
+ # introduction
@@ -0,0 +1,49 @@
1
+ # wrapper
2
+
3
+ ## Plot_pie
4
+
5
+ > Plot_pie(data: `pd.DataFrame`, target: `str`, **kwargs)
6
+
7
+ Make pie plot
8
+
9
+ ### Parameters
10
+ - data : `pd.DataFrame`
11
+ - pandas.DataFrame included data to make pie chart
12
+ - target : `str`
13
+ - String which column you would like to use for pie chart
14
+
15
+ ### Returns
16
+
17
+ `plotly.graph_objects`
18
+
19
+ Object of pie chart
20
+
21
+
22
+ ## Plot_sunburst
23
+
24
+ > Plot_sunburst(data: `pd.DataFrame`, groups: `list`, **kwargs)
25
+
26
+ Make sunburst plot
27
+
28
+ ### Parameters
29
+ - data : `pd.DataFrame`
30
+ - pandas.DataFrame included data to make sunburst chart
31
+ - group : `list`
32
+ - Strings list of group
33
+ - Changed when you replace the order
34
+
35
+ ### Returns
36
+
37
+ `plotly.graph_objects`
38
+
39
+ Object of sunburst chart
40
+
41
+ ## Plot_bubble_chart
42
+
43
+
44
+ ## Plot_line
45
+
46
+
47
+ ## Plot_bubble_chart_with_line
48
+
49
+
@@ -2,4 +2,4 @@ from plotly_extend_wrapper.wrapper import *
2
2
  from plotly_extend_wrapper.updater import *
3
3
  from plotly_extend_wrapper.common import *
4
4
 
5
- __version__ = "1.0.0"
5
+ __version__ = "1.1.0"
@@ -2,6 +2,9 @@ from plotly import express as px
2
2
  from plotly.subplots import make_subplots
3
3
  import pandas as pd
4
4
  from plotly_extend_wrapper.common import check_directory
5
+ from plotly import graph_objects as go
6
+ from scipy.interpolate import griddata
7
+ import numpy as np
5
8
 
6
9
 
7
10
  def Plot_pie(data: pd.DataFrame, target: str, **kwargs):
@@ -369,3 +372,53 @@ def Plot_bubble_chart_with_line(
369
372
  subfig.layout.yaxis.title = ytitle
370
373
  subfig.update_layout(**kwargs)
371
374
  return subfig
375
+
376
+
377
+ def Plot_surface(
378
+ df: pd.DataFrame,
379
+ x: str,
380
+ y: str,
381
+ z: str,
382
+ fill_value=0,
383
+ smoothing=False,
384
+ smooth_point_num=100,
385
+ title=None,
386
+ height=None,
387
+ width=None,
388
+ **kwargs,
389
+ ):
390
+ def smooth_df(x: np.ndarray, y: np.ndarray, z: np.ndarray, num: int):
391
+ xi = np.linspace(x.min(), x.max(), num)
392
+ yi = np.linspace(y.min(), y.max(), num)
393
+ xi, yi = np.meshgrid(xi, yi)
394
+ zi = griddata((x,y), z, (xi.ravel(), yi.ravel()), method="cubic")
395
+ zi = zi.reshape(xi.shape)
396
+ zi = np.nan_to_num(zi)
397
+ return xi, yi, zi
398
+
399
+ if smoothing:
400
+ X = df[x].values
401
+ Y = df[y].values
402
+ Z = df[z].values
403
+ X, Y, Z = smooth_df(X, Y, Z, smooth_point_num)
404
+ else:
405
+ pivot_df = pd.pivot_table(df, index=x, columns=y, values=z, fill_value=fill_value)
406
+
407
+ X = pivot_df.columns.values
408
+ Y = pivot_df.index.values
409
+ Z = pivot_df.values
410
+
411
+
412
+ data = [go.Surface(x=X, y=Y, z=Z)]
413
+ layout = go.Layout(
414
+ title=title,
415
+ scene=dict(
416
+ xaxis=dict(title=y), # need to be replaced
417
+ yaxis=dict(title=x),
418
+ zaxis=dict(title=z),
419
+ ),
420
+ height=height,
421
+ width=width,
422
+ )
423
+ fig = go.Figure(data=data, layout=layout)
424
+ return fig
@@ -0,0 +1,41 @@
1
+ [project]
2
+ name = "plotly-extend-wrapper"
3
+ version = "1.1.0"
4
+ authors = [
5
+ { name = "Laplusdestiny", email = "prayonshootingstars@gmail.com" }
6
+ ]
7
+ dependencies = [
8
+ "plotly>=5.15.0",
9
+ "kaleido==0.2.1",
10
+ "pyarrow>=10.0.0",
11
+ "pandas>=2.0.0",
12
+ "scipy>=1.12.0",
13
+ ]
14
+ readme = "README.md"
15
+ requires-python = ">= 3.9"
16
+
17
+ [build-system]
18
+ requires = ["hatchling"]
19
+ build-backend = "hatchling.build"
20
+
21
+ [tool.rye]
22
+ managed = true
23
+ dev-dependencies = [
24
+ "ruff>=0.5.0",
25
+ "ipykernel>=6.29.4",
26
+ "pytest>=8.2.2",
27
+ "pytest-cov>=5.0.0",
28
+ "scikit-learn>=1.5.1",
29
+ "twine>=5.1.1",
30
+ "wheel>=0.43.0",
31
+ "build>=1.2.1",
32
+ "sphinx>=7.3.7",
33
+ "myst-parser>=3.0.1",
34
+ "furo>=2024.5.6",
35
+ ]
36
+
37
+ [tool.hatch.metadata]
38
+ allow-direct-references = true
39
+
40
+ [tool.hatch.build.targets.wheel]
41
+ packages = ["plotly_extend_wrapper/"]
@@ -0,0 +1,246 @@
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: false
8
+ # with-sources: false
9
+ # generate-hashes: false
10
+ # universal: false
11
+
12
+ -e file:.
13
+ alabaster==0.7.16
14
+ # via sphinx
15
+ asttokens==2.4.1
16
+ # via stack-data
17
+ babel==2.15.0
18
+ # via sphinx
19
+ backports-tarfile==1.2.0
20
+ # via jaraco-context
21
+ beautifulsoup4==4.12.3
22
+ # via furo
23
+ build==1.2.1
24
+ certifi==2024.7.4
25
+ # via requests
26
+ cffi==1.16.0
27
+ # via cryptography
28
+ charset-normalizer==3.3.2
29
+ # via requests
30
+ comm==0.2.2
31
+ # via ipykernel
32
+ coverage==7.6.0
33
+ # via pytest-cov
34
+ cryptography==42.0.8
35
+ # via secretstorage
36
+ debugpy==1.8.2
37
+ # via ipykernel
38
+ decorator==5.1.1
39
+ # via ipython
40
+ docutils==0.21.2
41
+ # via myst-parser
42
+ # via readme-renderer
43
+ # via sphinx
44
+ exceptiongroup==1.2.2
45
+ # via ipython
46
+ # via pytest
47
+ executing==2.0.1
48
+ # via stack-data
49
+ furo==2024.5.6
50
+ idna==3.7
51
+ # via requests
52
+ imagesize==1.4.1
53
+ # via sphinx
54
+ importlib-metadata==8.0.0
55
+ # via build
56
+ # via jupyter-client
57
+ # via keyring
58
+ # via sphinx
59
+ # via twine
60
+ iniconfig==2.0.0
61
+ # via pytest
62
+ ipykernel==6.29.5
63
+ ipython==8.18.1
64
+ # via ipykernel
65
+ jaraco-classes==3.4.0
66
+ # via keyring
67
+ jaraco-context==5.3.0
68
+ # via keyring
69
+ jaraco-functools==4.0.1
70
+ # via keyring
71
+ jedi==0.19.1
72
+ # via ipython
73
+ jeepney==0.8.0
74
+ # via keyring
75
+ # via secretstorage
76
+ jinja2==3.1.4
77
+ # via myst-parser
78
+ # via sphinx
79
+ joblib==1.4.2
80
+ # via scikit-learn
81
+ jupyter-client==8.6.2
82
+ # via ipykernel
83
+ jupyter-core==5.7.2
84
+ # via ipykernel
85
+ # via jupyter-client
86
+ kaleido==0.2.1
87
+ # via plotly-extend-wrapper
88
+ keyring==25.2.1
89
+ # via twine
90
+ markdown-it-py==3.0.0
91
+ # via mdit-py-plugins
92
+ # via myst-parser
93
+ # via rich
94
+ markupsafe==2.1.5
95
+ # via jinja2
96
+ matplotlib-inline==0.1.7
97
+ # via ipykernel
98
+ # via ipython
99
+ mdit-py-plugins==0.4.1
100
+ # via myst-parser
101
+ mdurl==0.1.2
102
+ # via markdown-it-py
103
+ more-itertools==10.3.0
104
+ # via jaraco-classes
105
+ # via jaraco-functools
106
+ myst-parser==3.0.1
107
+ nest-asyncio==1.6.0
108
+ # via ipykernel
109
+ nh3==0.2.18
110
+ # via readme-renderer
111
+ numpy==2.0.0
112
+ # via pandas
113
+ # via pyarrow
114
+ # via scikit-learn
115
+ # via scipy
116
+ packaging==24.1
117
+ # via build
118
+ # via ipykernel
119
+ # via plotly
120
+ # via pytest
121
+ # via sphinx
122
+ pandas==2.2.2
123
+ # via plotly-extend-wrapper
124
+ parso==0.8.4
125
+ # via jedi
126
+ pexpect==4.9.0
127
+ # via ipython
128
+ pkginfo==1.10.0
129
+ # via twine
130
+ platformdirs==4.2.2
131
+ # via jupyter-core
132
+ plotly==5.22.0
133
+ # via plotly-extend-wrapper
134
+ pluggy==1.5.0
135
+ # via pytest
136
+ prompt-toolkit==3.0.47
137
+ # via ipython
138
+ psutil==6.0.0
139
+ # via ipykernel
140
+ ptyprocess==0.7.0
141
+ # via pexpect
142
+ pure-eval==0.2.2
143
+ # via stack-data
144
+ pyarrow==16.1.0
145
+ # via plotly-extend-wrapper
146
+ pycparser==2.22
147
+ # via cffi
148
+ pygments==2.18.0
149
+ # via furo
150
+ # via ipython
151
+ # via readme-renderer
152
+ # via rich
153
+ # via sphinx
154
+ pyproject-hooks==1.1.0
155
+ # via build
156
+ pytest==8.2.2
157
+ # via pytest-cov
158
+ pytest-cov==5.0.0
159
+ python-dateutil==2.9.0.post0
160
+ # via jupyter-client
161
+ # via pandas
162
+ pytz==2024.1
163
+ # via pandas
164
+ pyyaml==6.0.1
165
+ # via myst-parser
166
+ pyzmq==26.0.3
167
+ # via ipykernel
168
+ # via jupyter-client
169
+ readme-renderer==44.0
170
+ # via twine
171
+ requests==2.32.3
172
+ # via requests-toolbelt
173
+ # via sphinx
174
+ # via twine
175
+ requests-toolbelt==1.0.0
176
+ # via twine
177
+ rfc3986==2.0.0
178
+ # via twine
179
+ rich==13.7.1
180
+ # via twine
181
+ ruff==0.5.1
182
+ scikit-learn==1.5.1
183
+ scipy==1.13.1
184
+ # via plotly-extend-wrapper
185
+ # via scikit-learn
186
+ secretstorage==3.3.3
187
+ # via keyring
188
+ six==1.16.0
189
+ # via asttokens
190
+ # via python-dateutil
191
+ snowballstemmer==2.2.0
192
+ # via sphinx
193
+ soupsieve==2.5
194
+ # via beautifulsoup4
195
+ sphinx==7.3.7
196
+ # via furo
197
+ # via myst-parser
198
+ # via sphinx-basic-ng
199
+ sphinx-basic-ng==1.0.0b2
200
+ # via furo
201
+ sphinxcontrib-applehelp==1.0.8
202
+ # via sphinx
203
+ sphinxcontrib-devhelp==1.0.6
204
+ # via sphinx
205
+ sphinxcontrib-htmlhelp==2.0.5
206
+ # via sphinx
207
+ sphinxcontrib-jsmath==1.0.1
208
+ # via sphinx
209
+ sphinxcontrib-qthelp==1.0.7
210
+ # via sphinx
211
+ sphinxcontrib-serializinghtml==1.1.10
212
+ # via sphinx
213
+ stack-data==0.6.3
214
+ # via ipython
215
+ tenacity==8.5.0
216
+ # via plotly
217
+ threadpoolctl==3.5.0
218
+ # via scikit-learn
219
+ tomli==2.0.1
220
+ # via build
221
+ # via coverage
222
+ # via pytest
223
+ # via sphinx
224
+ tornado==6.4.1
225
+ # via ipykernel
226
+ # via jupyter-client
227
+ traitlets==5.14.3
228
+ # via comm
229
+ # via ipykernel
230
+ # via ipython
231
+ # via jupyter-client
232
+ # via jupyter-core
233
+ # via matplotlib-inline
234
+ twine==5.1.1
235
+ typing-extensions==4.12.2
236
+ # via ipython
237
+ tzdata==2024.1
238
+ # via pandas
239
+ urllib3==2.2.2
240
+ # via requests
241
+ # via twine
242
+ wcwidth==0.2.13
243
+ # via prompt-toolkit
244
+ wheel==0.43.0
245
+ zipp==3.19.2
246
+ # via importlib-metadata
@@ -0,0 +1,38 @@
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: false
8
+ # with-sources: false
9
+ # generate-hashes: false
10
+ # universal: false
11
+
12
+ -e file:.
13
+ kaleido==0.2.1
14
+ # via plotly-extend-wrapper
15
+ numpy==2.0.0
16
+ # via pandas
17
+ # via pyarrow
18
+ # via scipy
19
+ packaging==24.1
20
+ # via plotly
21
+ pandas==2.2.2
22
+ # via plotly-extend-wrapper
23
+ plotly==5.22.0
24
+ # via plotly-extend-wrapper
25
+ pyarrow==16.1.0
26
+ # via plotly-extend-wrapper
27
+ python-dateutil==2.9.0.post0
28
+ # via pandas
29
+ pytz==2024.1
30
+ # via pandas
31
+ scipy==1.13.1
32
+ # via plotly-extend-wrapper
33
+ six==1.16.0
34
+ # via python-dateutil
35
+ tenacity==8.5.0
36
+ # via plotly
37
+ tzdata==2024.1
38
+ # via pandas
@@ -7,6 +7,7 @@ from plotly_extend_wrapper.wrapper import (
7
7
  Plot_line,
8
8
  Plot_bubble_chart,
9
9
  Plot_bubble_chart_with_line,
10
+ Plot_surface
10
11
  )
11
12
  from plotly import graph_objects as go
12
13
  import pandas as pd
@@ -285,3 +286,30 @@ def test_PlotBubbleStrangeParameter2():
285
286
  offset=0.01,
286
287
  )
287
288
  bubble()
289
+
290
+
291
+ def test_PlotSurface():
292
+ data = load_iris(as_frame=True)
293
+
294
+ surface = Plot_surface(
295
+ data["frame"],
296
+ x="sepal length (cm)",
297
+ y="petal length (cm)",
298
+ z="petal width (cm)"
299
+ )
300
+
301
+ assert isinstance(surface, go.Figure)
302
+
303
+
304
+ def test_PlotSurface_with_smoothing():
305
+ data = load_iris(as_frame=True)
306
+
307
+ surface = Plot_surface(
308
+ data["frame"],
309
+ x="sepal length (cm)",
310
+ y="petal length (cm)",
311
+ z="petal width (cm)",
312
+ smoothing=True
313
+ )
314
+
315
+ assert isinstance(surface, go.Figure)
@@ -1,67 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: plotly-extend-wrapper
3
- Version: 1.0.0
4
- Summary: plotly-extend-wrapper: Extended Python library for Plotly
5
- Home-page: https://github.com/Laplusdestiny/plotly_extend_wrapper
6
- Download-URL: https://github.com/Laplusdestiny/plotly_extend_wrapper
7
- Author: Laplusdestiny
8
- Author-email: prayonshootingstars@gmail.com
9
- Maintainer: Laplusdestiny
10
- Maintainer-email: prayonshootingstars@gmail.com
11
- License: MIT
12
- Requires-Python: >=3.9
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: plotly>=5.15.0
16
- Requires-Dist: kaleido==0.2.1
17
- Requires-Dist: pandas>=2.0.0
18
-
19
- # plotly_extend_wrapper
20
-
21
- [![GitHub last commit (branch)](https://img.shields.io/github/last-commit/Laplusdestiny/plotly_extend_wrapper/main?logo=github)](https://github.com/Laplusdestiny/plotly_extend_wrapper/commits/main/)
22
- [![Codecov](https://img.shields.io/codecov/c/gh/Laplusdestiny/plotly_extend_wrapper?style=flat&logo=codecov)](https://app.codecov.io/gh/Laplusdestiny/plotly_extend_wrapper)
23
- [![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/Laplusdestiny/plotly_extend_wrapper?logo=github)](https://github.com/Laplusdestiny/plotly_extend_wrapper/releases)
24
- [![PyPI - Version](https://img.shields.io/pypi/v/plotly_extend_wrapper?logo=pypi)](https://pypi.org/project/plotly-extend-wrapper/)
25
-
26
-
27
- Extended Python library for Plotly
28
-
29
- You can make plot simply
30
-
31
- ## Requirement
32
-
33
- - Python >= 3.9
34
- - Plotly >= 5.0.0
35
- - kaleido = 0.2.1
36
- - pandas >= 2.2.0
37
-
38
- ## Graph
39
-
40
- - Pie (`wrapper.Plot_pie`)
41
- - Sunburst (`wrapper.Plot_sunburst`)
42
- - Bubble (`wrapper.Plot_bubble_chart`)
43
- - Line with secondary y-axis (`wrapper.Plot_line`)
44
- - Bubble with linear line (`wrapper.Plot_bubble_with_line`)
45
-
46
- ## Common function
47
-
48
- - updater
49
- - Add options
50
- - Available options
51
- - x-axis title
52
- - y-axis title
53
- - secondary_y-axis title
54
- - show legend
55
- - height
56
- - width
57
- - marker size
58
- - common
59
- - check_directory
60
- - Check directory with pathlib
61
- - Make directory if parent directory doesn't exist
62
-
63
-
64
- ## Issue
65
- If there are some bugs, please make issue to tell me!
66
-
67
- [![GitHub issues](https://img.shields.io/github/issues/Laplusdestiny/plotly_extend_wrapper?logo=github)](https://github.com/Laplusdestiny/plotly_extend_wrapper/issues)
@@ -1,16 +0,0 @@
1
- LICENSE
2
- README.md
3
- pyproject.toml
4
- setup.py
5
- plotly_extend_wrapper/__init__.py
6
- plotly_extend_wrapper/common.py
7
- plotly_extend_wrapper/updater.py
8
- plotly_extend_wrapper/wrapper.py
9
- plotly_extend_wrapper.egg-info/PKG-INFO
10
- plotly_extend_wrapper.egg-info/SOURCES.txt
11
- plotly_extend_wrapper.egg-info/dependency_links.txt
12
- plotly_extend_wrapper.egg-info/requires.txt
13
- plotly_extend_wrapper.egg-info/top_level.txt
14
- test/test_common.py
15
- test/test_updater.py
16
- test/test_wrapper.py
@@ -1,3 +0,0 @@
1
- plotly>=5.15.0
2
- kaleido==0.2.1
3
- pandas>=2.0.0
@@ -1 +0,0 @@
1
- plotly_extend_wrapper
@@ -1,34 +0,0 @@
1
- [tool.poetry]
2
- name = "plotly-extend-wrapper"
3
- version = "1.0.0"
4
- description = ""
5
- authors = ["Toru Sumi <prayonshootingstars@gmail.com>"]
6
- readme = "README.md"
7
-
8
- [tool.poetry.dependencies]
9
- python = ">=3.9"
10
- plotly = "^5.15.0"
11
- kaleido = "0.2.1"
12
- pyarrow = "*"
13
- pandas = "^2.0.0"
14
-
15
-
16
- [tool.poetry.group.test.dependencies]
17
- pytest = "*"
18
- pytest-cov = "*"
19
- scikit-learn = "*"
20
-
21
-
22
- [tool.poetry.group.dev.dependencies]
23
- ruff = "*"
24
- ipykernel = "*"
25
-
26
-
27
- [tool.poetry.group.deploy.dependencies]
28
- setuptools = "*"
29
- twine = "*"
30
- wheel = "*"
31
-
32
- [build-system]
33
- requires = ["poetry-core"]
34
- build-backend = "poetry.core.masonry.api"
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
@@ -1,43 +0,0 @@
1
- # Author: Laplusdestiny <prayonshootingstars@gmail.com>
2
- # Copyright (c) 2023-2023 Laplusdestiny
3
- # License: MIT
4
-
5
- from setuptools import setup
6
- import plotly_extend_wrapper
7
-
8
- DESCRIPTION = "plotly-extend-wrapper: Extended Python library for Plotly"
9
- NAME = "plotly-extend-wrapper"
10
- AUTHOR = "Laplusdestiny"
11
- AUTHOR_EMAIL = "prayonshootingstars@gmail.com"
12
- URL = "https://github.com/Laplusdestiny/plotly_extend_wrapper"
13
- LICENSE = "MIT"
14
- DOWNLOAD_URL = "https://github.com/Laplusdestiny/plotly_extend_wrapper"
15
- VERSION = plotly_extend_wrapper.__version__
16
- PYTHON_REQUIRES = ">=3.9"
17
-
18
- INSTALL_REQUIRES = ["plotly>=5.15.0", "kaleido==0.2.1", "pandas>=2.0.0"]
19
- PACKAGES = ["plotly_extend_wrapper"]
20
- CLASSIFIERS = []
21
-
22
- with open("README.md", "r") as fp:
23
- readme = fp.read()
24
- LONG_DESCRIPTION_CONTENT_TYPE = "text/markdown"
25
-
26
- setup(
27
- name=NAME,
28
- author=AUTHOR,
29
- author_email=AUTHOR_EMAIL,
30
- maintainer=AUTHOR,
31
- maintainer_email=AUTHOR_EMAIL,
32
- description=DESCRIPTION,
33
- long_description=readme,
34
- long_description_content_type=LONG_DESCRIPTION_CONTENT_TYPE,
35
- license=LICENSE,
36
- url=URL,
37
- version=VERSION,
38
- download_url=DOWNLOAD_URL,
39
- python_requires=PYTHON_REQUIRES,
40
- install_requires=INSTALL_REQUIRES,
41
- packages=PACKAGES,
42
- classifiers=CLASSIFIERS,
43
- )