Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subplots are removed when selecting other items in the canvas #264

Open
wants to merge 55 commits into
base: fix_deleting_plot
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
2ba25ed
Allow to choose the gridaxis color of the plot (#259)
ghtmtt Mar 19, 2021
f14ca66
move layout properties to layout options group in widget
Mar 22, 2021
8acb437
hide axis min/max group and label if not needed
Mar 22, 2021
e518f0e
Remove spacer at manual bin size and bar gap properties
Mar 22, 2021
a096415
move more layout properties to layout option group
Mar 23, 2021
25ad00c
Move non-layout properties to first page on widget
Mar 26, 2021
889d219
Merge pull request #260 from SGroe/layout_property_widget
Mar 26, 2021
a5a1d44
when opening point to the first widget page
ghtmtt Mar 30, 2021
c2fd358
Revert "when opening point to the first widget page"
ghtmtt Mar 30, 2021
0e288e4
Expose Dataplotly on QGIS Server for a GetPrint request (#266)
Gustry Sep 28, 2021
495eaa8
bump version 3.8
ghtmtt Sep 28, 2021
3ece8d6
wrong panel on start fix #267
ghtmtt Sep 28, 2021
4e05ca4
bump version 3.8.1
ghtmtt Sep 28, 2021
097742f
Add plugin help button and remove extra menu (#268)
Gustry Oct 22, 2021
6c4b6d5
enable bins box when checkbox is checked fix #269 (#273)
ghtmtt Nov 2, 2021
ac75e1e
Fix TypeError with Python 3.10 (#276)
m-kuhn Feb 14, 2022
1132196
Add options to change title, xticks and yticks font sizes. (#278)
giliam Mar 10, 2022
1c20d52
bump version 3.9
ghtmtt Apr 11, 2022
be0691a
Fix #237 add data-driven color to Polar Plot marker color (#283)
jmonticolo Apr 20, 2022
e950661
Fix "Build a generic plot" processing algorithm (#285)
agiudiceandrea May 13, 2022
17526f3
CI - Use QGIS-Plugin-CI for packaging the plugin (#281)
Gustry Jun 1, 2022
606603b
Lint - Fix tests (#287)
Gustry Jun 1, 2022
b839896
update QGIS release in testing suite (#279)
ghtmtt Jun 1, 2022
fa8a93a
Update .gitignore with files from qgis-plugin-ci (#289)
Gustry Jun 21, 2022
c31674f
Update some deprecated notices about subplots (#290)
Gustry Jun 22, 2022
8638168
[feature] New custom function to get the colors from categories used …
ghtmtt Aug 20, 2022
b37aaee
release 3.9.1
ghtmtt Aug 20, 2022
3372e72
fix action and release 3.9.1
ghtmtt Aug 20, 2022
cb0f635
fixing tests (#296)
ghtmtt Aug 21, 2022
d48fc26
add test badge
ghtmtt Aug 21, 2022
07976c1
fix wrong button for 2dhistogram and contour (#297)
ghtmtt Aug 21, 2022
d626e43
fix stacktrace when removing all the plots in the print layout (#298)
ghtmtt Aug 21, 2022
9f62843
Refactor Processing algorithm (#300)
ghtmtt Aug 23, 2022
bfc4e5a
fix signal when changing the plot idenx combobox (#301)
ghtmtt Aug 23, 2022
d0ad3f4
More Processing (#302)
ghtmtt Aug 30, 2022
ce4b3b1
Fix correct version in the changelog (#303)
Gustry Aug 30, 2022
f4cc7d4
Bar width data defined (#304)
ghtmtt Aug 31, 2022
b9003c8
update QGIS release in docker (#315)
ghtmtt Apr 4, 2023
985f113
WIP : Add multiple docks (#314)
jdlom Apr 13, 2023
380686f
Auto create clear plot (#318)
jdlom Apr 13, 2023
cb8883f
feat: add hole option to pie chart (#317)
jdlom Apr 17, 2023
3d0a3bb
update changelog for version 4.0.0
ghtmtt Apr 17, 2023
121f43d
try to fix qt5 installation trouble in workflow
ghtmtt Apr 17, 2023
aa4bf76
Fix bar width (#321)
ghtmtt May 12, 2023
1258d38
Python cleanup, raise to 3.7 minimum due to QGIS 3.28 (#323)
Gustry May 15, 2023
5129f4a
Python - Remove some unused code now that QGIS 3.28 is the minimum (#…
Gustry May 15, 2023
68f303c
fix : #324 key error pie_hole (#326)
jdlom Jun 23, 2023
c3f4e4e
prepare changelog for 4.0.2
ghtmtt Jun 24, 2023
7b5d552
Fix parsing changelog (#327)
Gustry Jun 26, 2023
95d3cde
Docs - Add some badges in the readme
Gustry Jun 26, 2023
db35c51
fix: really fix this time #324 (#329)
jdlom Jun 27, 2023
b6b0fe7
prepare changelog for 4.0.3
ghtmtt Jun 27, 2023
e14209b
Fix loading of the plugin without pandas installed (#332)
Gustry Jul 4, 2023
2c9a215
prepare changelog for 4.1.0
ghtmtt Nov 15, 2023
7ab2553
Do not add docks if self.iface is not defined when using qgis_process…
Gustry Feb 21, 2024
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
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release 🚀

on:
push:
tags:
- "*"

jobs:
release:

runs-on: ubuntu-latest
if: github.repository_owner == 'ghtmtt' && contains(github.ref, 'refs/tags/')

steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- uses: actions/checkout@v2

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install Qt lrelease
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qt5-qmake qttools5-dev-tools

- name: Install Python requirements
run: pip install qgis-plugin-ci

- name : Get current changelog
run: qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md

- name: Create release on GitHub
uses: ncipollo/release-action@v1.10.0
with:
bodyFile: release.md
token: ${{ secrets.GITHUB_TOKEN }}

- name: Package and deploy the zip
run: >-
qgis-plugin-ci
release ${{ env.RELEASE_VERSION }}
--github-token ${{ secrets.GITHUB_TOKEN }}
--transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
--osgeo-username ${{ secrets.OSGEO_USERNAME }}
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}
--create-plugin-repo
2 changes: 1 addition & 1 deletion .github/workflows/test_plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

strategy:
matrix:
docker_tags: [release-3_16, release-3_18, latest]
docker_tags: [release-3_28, latest]

steps:

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/transifex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Transifex 🗺

on:
push:
branches:
- master
paths:
- '**.py'
- '**.ui'

jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'ghtmtt'
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install Python requirements
run: pip install qgis-plugin-ci

- name: Push to Transifex
run: qgis-plugin-ci push-translation ${{ secrets.TRANSIFEX_TOKEN }}
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
# Python
*.pyc
.venv
venv
__pycache__/

# IDE
.idea/*

.backuputils.py
help/.tx/*
*.zip
__pycache__/

# QGIS-Plugin-CI
DataPlotly.*.zip
DataPlotly/i18n/

.coverage
.noseids

# Vscode
.vscode/*

# Test
*.qgs~
10 changes: 0 additions & 10 deletions .tx/config

This file was deleted.

160 changes: 160 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Changelog

## Unreleased

- Fix loading of the plugin when used with `qgis_process`, contribution from @Gustry

## 4.1.0 - 2023-11-15

- Fix loading of the plugin when the Pandas library is not found, contribution from @Gustry

## 4.0.3 - 2023-06-27

- fix bug with old projects (second part) thanks to @jdlom

## 4.0.2 - 2023-06-24

- fix bug with old projects thanks to @jdlom

## 4.0.1 - 2023-05-12

- tweak the bar width values, useful with time series
- minimum QGIS version to 3.28 LTR

## 4.0.0 - 2023-04-17

- multiple plot docks thanks to @jdlom
- add a pie hole parameter to have donuts like charts thanks to @jdlom

## 3.9.2 - 2022-08-30

- test added for Processing
- Processing algorithm refactored using plotly.express (scatter plot)
- fix stacktrace when removing all the plots from the layout
- fix signal not updating the fields in the data defined buttons automatically

## 3.9.1 - 2022-08-20

- Add custom function to have plot color the same as map color
- Fix #237 add data-driven color to Polar Plot marker color. Kudos to @jmonticolo
- Fix "Build a generic plot" processing algorithm. Kudos to @agiudiceandrea

## 3.9.0 - 2022-04-11

- Customize font for plot title and plot axis. Kudos to @giliam
- Support for Python 3.10

## 3.8.1 - 2021-09-28

- bugfix

## 3.8.0 - 2021-09-28

- [feature] expose DataPlotly on QGIS Server for a GetPrint request kudos to @Gustry

## 3.7.1 - 2020-05-15

- bugfix

## 3.7.0

- [feature] histogram and pie chart bar and slices with same color of category! kudos to @jdugge
- [feature] plot background transparent in layouts!

## 3.6.0

- [feature] Multi Plot in layout composer! Ultra kudos to @SGroe
- [bugfix] Fix layout composer issue with many plots (ref #207). Thanks to the Italian Community for testing
- [bugfix] Fix categorical bar plot wrong behavior
- [bugfix] code cleaning

## 3.5.0

- [bugfix] Fix loading old projects

## 3.4.0

- [feature] get labels within the plot itself
- [bugfix] Native datetime support! thanks @jdugge
- [bugfix] Fix histogram selection

## 3.3.0

- [bugfix] better loading project part 2

## 3.2.0

- [bugfix] fix violin plot bug
- [bugfix] better loading project handling

## 3.1.0

- [feature] more data defined options available (in layout customization). Thanks @SGroe
- [feature] X and Y axis bounds limits. Thanks @SGroe
- [feature] add box plot within violin plots
- [feature] renaming of plugin metadata to better search. Thanks @Gustry
- [bugfix] Box plot not working when no group is selected
- [bugfix] Data-defined property overrides do not work in layout

## 3.0.0

- [feature] total refactoring of the code
- [feature] plots also in print composer
- [feature] atlas based plots
- [feature] chance to save/load configuration file of plot setting
- [feature] plot settings saved together with the project
- [feature] more datadefined properties
- [feature] show only selected/visible/filtered features
- [feature] unit tests and continuous integration

## 2.3.0

- [feature] tweaks polar plots, thanks @josephholler

## 2.2.0

- [feature] UI tweaks, thanks @nyalldawson

## 2.1.0

- [fix] typos in UI (thanks @leonmvd and @nyalldawson)
- [fix] better python packages imports (thanks @nyalldawson)

## 2.0.0

- [feature] DataPlotly is updated with plotly 3.3 version

## 1.6.0

- [feature] wheel zoom! Give it a try
- [feature] Edit plot title and X/Y labels in place

## 1.5.1

- [feature] Spanish translation. Special thanks to Luca Bellani
- [bugfix] always open English manual if locale not translated

## 1.5.0

- [feature] **new** Violin plots!
- [feature] **new** Polar plot layout!
- [feature] better default color choice

## 1.4.3

- [bugfix] correct interaction with pie plot
- update plotly.js to v 1.34.0

## 1.4.2

- [bugfix] correct saving html plot

## 1.4.1

- [bugfixing] adaptation for new API

## 1.4.0

- [feature] update plotly.js to v 1.33.1
- [feature] multiple selection with Shift + selection tool
- [feature] DataPlotly as Processing provider, thanks to Michaël Douchin of 3Liz
20 changes: 17 additions & 3 deletions DataPlotly/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DataPlotly
Expand All @@ -22,8 +21,6 @@
This script initializes the plugin, making it known to QGIS.
"""

from .data_plotly import DataPlotly


# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
Expand All @@ -32,4 +29,21 @@ def classFactory(iface): # pylint: disable=invalid-name
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
# pylint: disable=import-outside-toplevel
from .data_plotly import DataPlotly
return DataPlotly(iface)


def serverClassFactory(server_iface):
"""Load DataPlotly server.

:param server_iface: A QGIS Server interface instance.
:type server_iface: QgsServerInterface
"""
_ = server_iface
# pylint: disable=import-outside-toplevel
from qgis.core import QgsApplication, QgsMessageLog, Qgis
from DataPlotly.layouts.plot_layout_item import PlotLayoutItemMetadata

QgsApplication.layoutItemRegistry().addLayoutItemType(PlotLayoutItemMetadata())
QgsMessageLog.logMessage("Custom DataPlotly layout item loaded", "DataPlotly", Qgis.Info)
31 changes: 31 additions & 0 deletions DataPlotly/core/core_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""COre Utilities

.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
import uuid
from qgis.PyQt.QtCore import QByteArray


def safe_str_xml(s):
""" replaces spaces by .
"""
return s.replace(" ", ".")


def restore_safe_str_xml(s):
""" replaces . by spaces
"""
return s.replace(".", " ")


def restore(b_str_64):
"""state and geom are stored in str(Base64) in project xml file"""
return QByteArray.fromBase64(QByteArray(b_str_64.encode()))


def uuid_suffix(string: str) -> str:
""" uuid4 suffix"""
return f"{string}{uuid.uuid4()}"
Loading
Loading