Compare commits
12 Commits
d2b539edbd
...
662c71dcec
| Author | SHA1 | Date |
|---|---|---|
|
|
662c71dcec | |
|
|
31859e9d03 | |
|
|
e30957b62f | |
|
|
b87710e999 | |
|
|
392ea6162a | |
|
|
d98c1706d6 | |
|
|
88d309a613 | |
|
|
87707e4239 | |
|
|
073176a4c2 | |
|
|
8c08ddd38c | |
|
|
b4c905b592 | |
|
|
494bc4ce85 |
|
|
@ -20,9 +20,8 @@ Chart axes graphics and behavior.
|
|||
"""
|
||||
from __future__ import annotations
|
||||
from functools import lru_cache
|
||||
from math import floor
|
||||
import platform
|
||||
from typing import Callable
|
||||
from math import floor
|
||||
|
||||
import polars as pl
|
||||
import pyqtgraph as pg
|
||||
|
|
@ -43,7 +42,6 @@ from ._style import DpiAwareFont, hcolor, _font
|
|||
from ._interaction import ChartView
|
||||
from ._dataviz import Viz
|
||||
|
||||
_friggin_macos: bool = platform.system() == 'Darwin'
|
||||
_axis_pen = pg.mkPen(hcolor('bracket'))
|
||||
|
||||
|
||||
|
|
@ -174,7 +172,6 @@ class Axis(pg.AxisItem):
|
|||
text_offset = None
|
||||
if self.orientation in ('bottom',):
|
||||
text_offset = floor(0.25 * font_size)
|
||||
|
||||
elif self.orientation in ('left', 'right'):
|
||||
text_offset = floor(font_size / 2)
|
||||
|
||||
|
|
@ -296,22 +293,15 @@ class PriceAxis(Axis):
|
|||
) -> None:
|
||||
self._min_tick = size
|
||||
|
||||
if _friggin_macos:
|
||||
def size_to_values(self) -> None:
|
||||
# Call PyQtGraph's internal width update mechanism
|
||||
# This respects autoExpandTextSpace and updates min/max constraints
|
||||
self._updateWidth()
|
||||
# tell Qt our preferred size changed so layout recalculates
|
||||
self.updateGeometry()
|
||||
# force parent plot item to recalculate its layout
|
||||
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())
|
||||
|
||||
def size_to_values(self) -> None:
|
||||
# Call PyQtGraph's internal width update mechanism
|
||||
# This respects autoExpandTextSpace and updates min/max constraints
|
||||
self._updateWidth()
|
||||
# tell Qt our preferred size changed so layout recalculates
|
||||
self.updateGeometry()
|
||||
# force parent plot item to recalculate its layout
|
||||
if self.pi and hasattr(self.pi, 'updateGeometry'):
|
||||
self.pi.updateGeometry()
|
||||
|
||||
# XXX: drop for now since it just eats up h space
|
||||
|
||||
|
|
@ -354,21 +344,15 @@ class DynamicDateAxis(Axis):
|
|||
1: '%H:%M:%S',
|
||||
}
|
||||
|
||||
if _friggin_macos:
|
||||
def size_to_values(self) -> None:
|
||||
# Call PyQtGraph's internal height update mechanism
|
||||
# This respects autoExpandTextSpace and updates min/max constraints
|
||||
self._updateHeight()
|
||||
# tell Qt our preferred size changed so layout recalculates
|
||||
self.updateGeometry()
|
||||
# force parent plot item to recalculate its layout
|
||||
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 size_to_values(self) -> None:
|
||||
# Call PyQtGraph's internal height update mechanism
|
||||
# This respects autoExpandTextSpace and updates min/max constraints
|
||||
self._updateHeight()
|
||||
# tell Qt our preferred size changed so layout recalculates
|
||||
self.updateGeometry()
|
||||
# force parent plot item to recalculate its layout
|
||||
if self.pi and hasattr(self.pi, 'updateGeometry'):
|
||||
self.pi.updateGeometry()
|
||||
|
||||
def _indexes_to_timestrs(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Reference in New Issue