Compare commits
2 Commits
31859e9d03
...
efc98bdf4c
| Author | SHA1 | Date |
|---|---|---|
|
|
efc98bdf4c | |
|
|
f9979956a0 |
|
|
@ -20,8 +20,9 @@ Chart axes graphics and behavior.
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from typing import Callable
|
|
||||||
from math import floor
|
from math import floor
|
||||||
|
import platform
|
||||||
|
from typing import Callable
|
||||||
|
|
||||||
import polars as pl
|
import polars as pl
|
||||||
import pyqtgraph as pg
|
import pyqtgraph as pg
|
||||||
|
|
@ -42,6 +43,7 @@ from ._style import DpiAwareFont, hcolor, _font
|
||||||
from ._interaction import ChartView
|
from ._interaction import ChartView
|
||||||
from ._dataviz import Viz
|
from ._dataviz import Viz
|
||||||
|
|
||||||
|
_friggin_macos: bool = platform.system() == 'Darwin'
|
||||||
_axis_pen = pg.mkPen(hcolor('bracket'))
|
_axis_pen = pg.mkPen(hcolor('bracket'))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -172,6 +174,7 @@ class Axis(pg.AxisItem):
|
||||||
text_offset = None
|
text_offset = None
|
||||||
if self.orientation in ('bottom',):
|
if self.orientation in ('bottom',):
|
||||||
text_offset = floor(0.25 * font_size)
|
text_offset = floor(0.25 * font_size)
|
||||||
|
|
||||||
elif self.orientation in ('left', 'right'):
|
elif self.orientation in ('left', 'right'):
|
||||||
text_offset = floor(font_size / 2)
|
text_offset = floor(font_size / 2)
|
||||||
|
|
||||||
|
|
@ -293,15 +296,22 @@ class PriceAxis(Axis):
|
||||||
) -> None:
|
) -> None:
|
||||||
self._min_tick = size
|
self._min_tick = size
|
||||||
|
|
||||||
def size_to_values(self) -> None:
|
if _friggin_macos:
|
||||||
# Call PyQtGraph's internal width update mechanism
|
def size_to_values(self) -> None:
|
||||||
# This respects autoExpandTextSpace and updates min/max constraints
|
# Call PyQtGraph's internal width update mechanism
|
||||||
self._updateWidth()
|
# This respects autoExpandTextSpace and updates min/max constraints
|
||||||
# tell Qt our preferred size changed so layout recalculates
|
self._updateWidth()
|
||||||
self.updateGeometry()
|
# tell Qt our preferred size changed so layout recalculates
|
||||||
# force parent plot item to recalculate its layout
|
self.updateGeometry()
|
||||||
if self.pi and hasattr(self.pi, 'updateGeometry'):
|
# force parent plot item to recalculate its layout
|
||||||
self.pi.updateGeometry()
|
if self.pi and hasattr(self.pi, 'updateGeometry'):
|
||||||
|
self.pi.updateGeometry()
|
||||||
|
|
||||||
|
else:
|
||||||
|
def size_to_values(self) -> None:
|
||||||
|
# XXX, old code!
|
||||||
|
self.setWidth(self.typical_br.width())
|
||||||
|
|
||||||
|
|
||||||
# XXX: drop for now since it just eats up h space
|
# XXX: drop for now since it just eats up h space
|
||||||
|
|
||||||
|
|
@ -344,15 +354,21 @@ class DynamicDateAxis(Axis):
|
||||||
1: '%H:%M:%S',
|
1: '%H:%M:%S',
|
||||||
}
|
}
|
||||||
|
|
||||||
def size_to_values(self) -> None:
|
if _friggin_macos:
|
||||||
# Call PyQtGraph's internal height update mechanism
|
def size_to_values(self) -> None:
|
||||||
# This respects autoExpandTextSpace and updates min/max constraints
|
# Call PyQtGraph's internal height update mechanism
|
||||||
self._updateHeight()
|
# This respects autoExpandTextSpace and updates min/max constraints
|
||||||
# tell Qt our preferred size changed so layout recalculates
|
self._updateHeight()
|
||||||
self.updateGeometry()
|
# tell Qt our preferred size changed so layout recalculates
|
||||||
# force parent plot item to recalculate its layout
|
self.updateGeometry()
|
||||||
if self.pi and hasattr(self.pi, 'updateGeometry'):
|
# force parent plot item to recalculate its layout
|
||||||
self.pi.updateGeometry()
|
if self.pi and hasattr(self.pi, 'updateGeometry'):
|
||||||
|
self.pi.updateGeometry()
|
||||||
|
|
||||||
|
else:
|
||||||
|
def size_to_values(self) -> None:
|
||||||
|
# XXX, old code!
|
||||||
|
self.setHeight(self.typical_br.height() + 1)
|
||||||
|
|
||||||
def _indexes_to_timestrs(
|
def _indexes_to_timestrs(
|
||||||
self,
|
self,
|
||||||
|
|
|
||||||
|
|
@ -206,8 +206,8 @@ pyvnc = { git = "https://github.com/regulad/pyvnc.git" }
|
||||||
# xonsh = { git = 'https://github.com/xonsh/xonsh.git', branch = 'main' }
|
# xonsh = { git = 'https://github.com/xonsh/xonsh.git', branch = 'main' }
|
||||||
|
|
||||||
# XXX since, we're like, always hacking new shite all-the-time. Bp
|
# XXX since, we're like, always hacking new shite all-the-time. Bp
|
||||||
tractor = { git = "https://github.com/goodboy/tractor.git", branch ="main" }
|
# tractor = { git = "https://github.com/goodboy/tractor.git", branch ="main" }
|
||||||
# tractor = { git = "https://pikers.dev/goodboy/tractor", branch = "piker_pin" }
|
# tractor = { git = "https://pikers.dev/goodboy/tractor", branch = "piker_pin" }
|
||||||
# ------ goodboy ------
|
# ------ goodboy ------
|
||||||
# hackin dev-envs, usually there's something new he's hackin in..
|
# hackin dev-envs, usually there's something new he's hackin in..
|
||||||
# tractor = { path = "../tractor", editable = true }
|
tractor = { path = "../tractor", editable = true }
|
||||||
|
|
|
||||||
46
uv.lock
46
uv.lock
|
|
@ -1034,7 +1034,7 @@ requires-dist = [
|
||||||
{ name = "tomli", specifier = ">=2.0.1,<3.0.0" },
|
{ name = "tomli", specifier = ">=2.0.1,<3.0.0" },
|
||||||
{ name = "tomli-w", specifier = ">=1.0.0,<2.0.0" },
|
{ name = "tomli-w", specifier = ">=1.0.0,<2.0.0" },
|
||||||
{ name = "tomlkit", git = "https://github.com/pikers/tomlkit.git?branch=piker_pin" },
|
{ name = "tomlkit", git = "https://github.com/pikers/tomlkit.git?branch=piker_pin" },
|
||||||
{ name = "tractor", git = "https://github.com/goodboy/tractor.git?branch=main" },
|
{ name = "tractor", editable = "../tractor" },
|
||||||
{ name = "trio", specifier = ">=0.27" },
|
{ name = "trio", specifier = ">=0.27" },
|
||||||
{ name = "trio-typing", specifier = ">=0.10.0" },
|
{ name = "trio-typing", specifier = ">=0.10.0" },
|
||||||
{ name = "trio-util", specifier = ">=0.7.0,<0.8.0" },
|
{ name = "trio-util", specifier = ">=0.7.0,<0.8.0" },
|
||||||
|
|
@ -1680,7 +1680,7 @@ wheels = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tractor"
|
name = "tractor"
|
||||||
version = "0.1.0a6.dev0"
|
version = "0.1.0a6.dev0"
|
||||||
source = { git = "https://github.com/goodboy/tractor.git?branch=main#e77198bb64f0467a50e251ed140daee439752354" }
|
source = { editable = "../tractor" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "bidict" },
|
{ name = "bidict" },
|
||||||
{ name = "cffi" },
|
{ name = "cffi" },
|
||||||
|
|
@ -1693,6 +1693,48 @@ dependencies = [
|
||||||
{ name = "wrapt" },
|
{ name = "wrapt" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[package.metadata]
|
||||||
|
requires-dist = [
|
||||||
|
{ name = "bidict", specifier = ">=0.23.1" },
|
||||||
|
{ name = "cffi", specifier = ">=1.17.1" },
|
||||||
|
{ name = "colorlog", specifier = ">=6.8.2,<7" },
|
||||||
|
{ name = "msgspec", specifier = ">=0.19.0" },
|
||||||
|
{ name = "pdbp", specifier = ">=1.8.2,<2" },
|
||||||
|
{ name = "platformdirs", specifier = ">=4.4.0" },
|
||||||
|
{ name = "tricycle", specifier = ">=0.4.1,<0.5" },
|
||||||
|
{ name = "trio", specifier = ">0.27" },
|
||||||
|
{ name = "wrapt", specifier = ">=1.16.0,<2" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.metadata.requires-dev]
|
||||||
|
dev = [
|
||||||
|
{ name = "greenback", specifier = ">=1.2.1,<2" },
|
||||||
|
{ name = "pexpect", specifier = ">=4.9.0,<5" },
|
||||||
|
{ name = "prompt-toolkit", specifier = ">=3.0.50" },
|
||||||
|
{ name = "psutil", specifier = ">=7.0.0" },
|
||||||
|
{ name = "pyperclip", specifier = ">=1.9.0" },
|
||||||
|
{ name = "pytest", specifier = ">=8.3.5" },
|
||||||
|
{ name = "stackscope", specifier = ">=0.2.2,<0.3" },
|
||||||
|
{ name = "typing-extensions", specifier = ">=4.14.1" },
|
||||||
|
{ name = "xonsh", specifier = ">=0.22.2" },
|
||||||
|
]
|
||||||
|
devx = [
|
||||||
|
{ name = "greenback", specifier = ">=1.2.1,<2" },
|
||||||
|
{ name = "stackscope", specifier = ">=0.2.2,<0.3" },
|
||||||
|
{ name = "typing-extensions", specifier = ">=4.14.1" },
|
||||||
|
]
|
||||||
|
lint = [{ name = "ruff", specifier = ">=0.9.6" }]
|
||||||
|
repl = [
|
||||||
|
{ name = "prompt-toolkit", specifier = ">=3.0.50" },
|
||||||
|
{ name = "psutil", specifier = ">=7.0.0" },
|
||||||
|
{ name = "pyperclip", specifier = ">=1.9.0" },
|
||||||
|
{ name = "xonsh", specifier = ">=0.22.2" },
|
||||||
|
]
|
||||||
|
testing = [
|
||||||
|
{ name = "pexpect", specifier = ">=4.9.0,<5" },
|
||||||
|
{ name = "pytest", specifier = ">=8.3.5" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tricycle"
|
name = "tricycle"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue