Skip to content

Commit

Permalink
Merge pull request #259 from pikers/overlayed_dvlm
Browse files Browse the repository at this point in the history
Overlayed $vlm
  • Loading branch information
goodboy authored Jan 26, 2022
2 parents a40e949 + d351fe1 commit 8fe2bd6
Show file tree
Hide file tree
Showing 9 changed files with 379 additions and 201 deletions.
2 changes: 1 addition & 1 deletion piker/fsp/_momo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# piker: trading gear for hackers
# Copyright (C) 2018-present Tyler Goodlet (in stewardship of piker0)
# Copyright (C) Tyler Goodlet (in stewardship of pikers)

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
Expand Down
30 changes: 18 additions & 12 deletions piker/ui/_anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@
Anchor funtions for UI placement of annotions.
'''
from typing import Callable
from __future__ import annotations
from typing import Callable, TYPE_CHECKING

from PyQt5.QtCore import QPointF
from PyQt5.QtWidgets import QGraphicsPathItem

from ._label import Label
if TYPE_CHECKING:
from ._axes import PriceAxis
from ._chart import ChartPlotWidget
from ._label import Label


def marker_right_points(

chart: 'ChartPlotWidget', # noqa
chart: ChartPlotWidget, # noqa
marker_size: int = 20,

) -> (float, float, float):
'''Return x-dimension, y-axis-aware, level-line marker oriented scene values.
'''
Return x-dimension, y-axis-aware, level-line marker oriented scene
values.
X values correspond to set the end of a level line, end of
a paried level line marker, and the right most side of the "right"
Expand All @@ -57,16 +62,17 @@ def vbr_left(
label: Label,

) -> Callable[..., float]:
"""Return a closure which gives the scene x-coordinate for the
leftmost point of the containing view box.
'''
Return a closure which gives the scene x-coordinate for the leftmost
point of the containing view box.
"""
'''
return label.vbr().left


def right_axis(

chart: 'ChartPlotWidget', # noqa
chart: ChartPlotWidget, # noqa
label: Label,

side: str = 'left',
Expand Down Expand Up @@ -141,13 +147,13 @@ def gpath_pin(
return path_br.bottomRight() - QPointF(label.w, label.h / 6)



def pp_tight_and_right(
label: Label

) -> QPointF:
'''Place *just* right of the pp label.
'''
Place *just* right of the pp label.
'''
txt = label.txt
# txt = label.txt
return label.txt.pos() + QPointF(label.w - label.h/3, 0)
Loading

0 comments on commit 8fe2bd6

Please sign in to comment.