Skip to content

chg: NodeGraphicsItem in Node.py#2869

Merged
j9ac9k merged 3 commits intopyqtgraph:masterfrom
Doralitze:patch-1
Nov 11, 2023
Merged

chg: NodeGraphicsItem in Node.py#2869
j9ac9k merged 3 commits intopyqtgraph:masterfrom
Doralitze:patch-1

Conversation

@Doralitze
Copy link
Copy Markdown
Contributor

Made title and node offsets configurable.

There are a lot of places where additional data needs to be rendered together with the node. Usually people inherit from NodeGraphicsItem in that case and completely reimplement updateTerminals when all that would be required is reconfigurability for the space occupied by the terminals.

Other Tasks

Bump Dependency Versions

Files that need updates

Confirm the following files have been either updated or there has been a determination that no update is needed.

  • README.md
  • setup.py
  • tox.ini
  • .github/workflows/main.yml and associated requirements.txt and conda environemt.yml files
  • pyproject.toml
  • binder/requirements.txt
Pre-Release Checklist

Pre Release Checklist

  • Update version info in __init__.py
  • Update CHANGELOG primarily using contents from automated changelog generation in GitHub release page
  • Have git tag in the format of pyqtgraph-
Post-Release Checklist

Steps To Complete

  • Append .dev0 to __version__ in __init__.py
  • Announce on mail list
  • Announce on Twitter

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Nov 2, 2023

how would you feel about adding setter/getter methods such as setTitleOffset/setNodeOffset and titleOffset/nodeOffset methods for getters and setters, store the value in self._titleOffset/self._nodeOffset that way it's easier to modify w/o having to do inheritance?

Note that i chose a different name for the nodeOffset property for the external interface as the parameter actually affects the offset between terminals within one node instead of the offset between nodes.
@Doralitze
Copy link
Copy Markdown
Contributor Author

how would you feel about adding setter/getter methods such as setTitleOffset/setNodeOffset and titleOffset/nodeOffset methods for getters and setters, store the value in self._titleOffset/self._nodeOffset that way it's easier to modify w/o having to do inheritance?

I've added the methods that you requested. First of all, note that i chose a different name for the nodeOffset property for the external interface as the parameter actually affects the offset between terminals within one node instead of the offset between nodes. I also decided to not include type hints as I was not sure if this library still targets pre python 3.6 code. I also didn't use properties in order to stick with the Qt naming convention (but you also recommended these names so I think that I'm on the clear side here). Please let me know if I should include type hints though.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Nov 11, 2023

This LGTM @Doralitze thanks for the PR!

Our flowchart module can certainly use a lot more love and attention!

@j9ac9k j9ac9k merged commit 71c160d into pyqtgraph:master Nov 11, 2023
@Doralitze Doralitze deleted the patch-1 branch November 11, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants